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 #75

Open
wants to merge 1 commit 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
8 changes: 8 additions & 0 deletions nohup.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ℹ️ cluster id is 9e68173f-9c23-4acc-ba81-4f079b639964
ℹ️ using 256 bit prime
ℹ️ storing state in /tmp/.tmp1eGYZV (77.82Gbs available)
🏃 starting nilchain node in: /tmp/.tmp1eGYZV/nillion-chain
Error: launching nilchain proxy

Caused by:
Address in use (os error 98)
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.
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
from nada_dsl import *
def nada_main():

def nada_main():
# Define three parties
party1 = Party(name="Party1")
party2 = Party(name="Party2")
party3 = Party(name="Party3")

# Define secret integers for each party
my_int1_party1 = SecretInteger(Input(name="my_int1_party1", party=party1))
my_int2_party1 = SecretInteger(Input(name="my_int2_party1", party=party1))
my_int3_party1 = SecretInteger(Input(name="my_int3_party1", party=party1))

my_int1_party2 = SecretInteger(Input(name="my_int1_party2", party=party2))
my_int2_party2 = SecretInteger(Input(name="my_int2_party2", party=party2))
my_int3_party2 = SecretInteger(Input(name="my_int3_party2", party=party2))

my_int1_party3 = SecretInteger(Input(name="my_int1_party3", party=party3))
my_int2_party3 = SecretInteger(Input(name="my_int2_party3", party=party3))
my_int3_party3 = SecretInteger(Input(name="my_int3_party3", party=party3))

my_int1 = SecretInteger(Input(name="my_int1", party=party1))
# Perform complex operation involving all parties
intermediate_result1 = my_int1_party1 * my_int2_party2
intermediate_result2 = my_int2_party1 + my_int3_party2
intermediate_result3 = my_int3_party1 - my_int1_party2

my_int2 = SecretInteger(Input(name="my_int2", party=party1))
final_result_party1 = intermediate_result1 + intermediate_result2
final_result_party2 = intermediate_result2 * intermediate_result3
final_result_party3 = intermediate_result3 + intermediate_result1

new_int = my_int1 + my_int2
# Define outputs for each party
outputs = [
Output(final_result_party1, "output_party1", party1),
Output(final_result_party2, "output_party2", party2),
Output(final_result_party3, "output_party3", party3)
]

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