Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

my new nada program #68

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions nohup.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ℹ️ cluster id is 9e68173f-9c23-4acc-ba81-4f079b639964
ℹ️ using 256 bit prime
ℹ️ storing state in /tmp/.tmpMFjKdN (80.01Gbs available)
🏃 starting nilchain node in: /tmp/.tmpMFjKdN/nillion-chain
⛓ nilchain JSON RPC available at http://127.0.0.1:48102
⛓ nilchain REST API available at http://localhost:26650
⛓ nilchain gRPC available at localhost:26649
🏃 starting node 12D3KooWMvw1hEqm7EWSDEyqTb6pNetUVkepahKY6hixuAuMZfJS
⏳ waiting until bootnode is up...
🏃 starting node 12D3KooWAiwGZUwSUaT2bYVxGS8jmfMrfsanZYkHwH3uL7WJPsFq
🏃 starting node 12D3KooWM3hsAswc7ZT6VpwQ1TCZU4GCYY55nLhcsxCcfjuixW57
👛 funding nilchain keys
📝 nillion CLI configuration written to /root/.config/nillion/nillion-cli.yaml
🌄 environment file written to /root/.config/nillion/nillion-devnet.env
7 changes: 7 additions & 0 deletions quickstart/nada_quickstart_programs/nada-project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name = "nada_quickstart_programs"
version = "0.1.0"
authors = [""]

[[programs]]
path = "src/main.py"
prime_size = 128
12 changes: 12 additions & 0 deletions quickstart/nada_quickstart_programs/src/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from nada_dsl import *

def nada_main():
party1 = Party(name="Party1")
party2 = Party(name="Party2")
party3 = Party(name="Party3")
a = SecretInteger(Input(name="A", party=party1))
b = SecretInteger(Input(name="B", party=party2))

result = a + b

return [Output(result, "my_output", party3)]
Binary file not shown.
19 changes: 19 additions & 0 deletions quickstart_complete/nada_quickstart_programs/=0.9.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Requirement already satisfied: cosmpy in /usr/local/lib/python3.10/dist-packages (0.9.2)
Requirement already satisfied: bech32 in /usr/local/lib/python3.10/dist-packages (from cosmpy) (1.2.0)
Requirement already satisfied: ecdsa in /usr/local/lib/python3.10/dist-packages (from cosmpy) (0.19.0)
Requirement already satisfied: googleapis-common-protos in /usr/local/lib/python3.10/dist-packages (from cosmpy) (1.63.2)
Requirement already satisfied: grpcio in /usr/local/lib/python3.10/dist-packages (from cosmpy) (1.64.1)
Requirement already satisfied: jsonschema<5,>=3.2.0 in /usr/local/lib/python3.10/dist-packages (from cosmpy) (4.19.2)
Requirement already satisfied: protobuf<5.0dev,>=4.21.6 in /usr/local/lib/python3.10/dist-packages (from cosmpy) (4.25.3)
Requirement already satisfied: pycryptodome<4.0.0,>=3.18.0 in /usr/local/lib/python3.10/dist-packages (from cosmpy) (3.20.0)
Requirement already satisfied: python-dateutil in /usr/local/lib/python3.10/dist-packages (from cosmpy) (2.8.2)
Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from cosmpy) (2.31.0)
Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.10/dist-packages (from jsonschema<5,>=3.2.0->cosmpy) (23.2.0)
Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.10/dist-packages (from jsonschema<5,>=3.2.0->cosmpy) (2023.12.1)
Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.10/dist-packages (from jsonschema<5,>=3.2.0->cosmpy) (0.35.1)
Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/lib/python3.10/dist-packages (from jsonschema<5,>=3.2.0->cosmpy) (0.19.0)
Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.10/dist-packages (from ecdsa->cosmpy) (1.16.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->cosmpy) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->cosmpy) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->cosmpy) (2.0.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->cosmpy) (2024.7.4)
Submodule nillion-python-starter added at 15e9fe
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ def nada_main():

party1 = Party(name="Party1")

my_int1 = SecretInteger(Input(name="my_int1", party=party1))
# Define a list of secret integers as inputs
secret_integers = [
SecretInteger(Input(name=f"int{i+1}", party=party1))
for i in range(5) # Let's assume we are taking 5 integers for simplicity
]

my_int2 = SecretInteger(Input(name="my_int2", party=party1))
# Calculate the sum of the secret integers
total_sum = sum(secret_integers)

new_int = my_int1 + my_int2
# Calculate the average
average = total_sum / len(secret_integers)

return [Output(new_int, "my_output", party1)]
return [Output(average, "average_output", party1)]
Binary file not shown.