You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nillion SDK Release 0.2.1 includes new Nada language features, improvements to the nada tool, 2 breaking changes to the Nillion Python Client, and the sunsetting of SecretArrays.
How to upgrade
Upgrade to version 0.2.1 using nilup, the installer and version manager for the Nillion SDK
If you are using Nada programs, you need to recompile all programs. Programs compiled with a previous version of the Nillion SDK need to be recompiled with pynadac to be stored and used with version 0.2.1 of the SDK.
If you are using the Nillion Python Client, follow migration steps for breaking changes to user_id and party_id (see below)
What’s new
🎉 New Nada Language Features
Nillion SDK Release 0.2.1 introduces private equality, left shift, right shift, and probabilistic truncation to the Nada language.
The nada tool now has the ability to print program requirements, and get a Nada program’s protocols model and bytecode in text format. Check out the nada tool documentation to learn more about usage https://docs.nillion.com/nada
Print program requirements
The new program-requirements command prints the runtime requirements of the preprocessing elements of a program.
Example: 3 Party addition program
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 + breturn [Output(result, "my_output", party3)]
Command: nada program-requirements <program-name>
Program requirements printed for the 3 Party addition program example with nada program-requirements main
Get a Nada program’s protocols model in text format
Command: nada run <test-name> --protocols-text
Protocols model main.nada.protocols.txt text file generated for the 3 Party addition program example with nada run main --protocols-text
Inputs:
iaddr(0): A (ref 0) (sizeof: 1)
iaddr(1): B (ref 0) (sizeof: 1)
Literals:
Protocols:
rty(ShamirShareInteger) = P2S iaddr(0) # result = a + b -> main.py:10
rty(ShamirShareInteger) = P2S iaddr(1) # result = a + b -> main.py:10
rty(ShamirShareInteger) = ADD addr(2) addr(3) # result = a + b -> main.py:10
Outputs:
addr(4): my_output
Nillion Python Client user_id and party_id have changed from methods to attributes
The user_id() and party_id() Nillion Python Client methods have been deprecated and replaced with attributes. This change reduces the overhead of method calls for accessing these properties and keeps the Nillion Python Client consistent with the Nillion JavaScript Client, which has user_id and party_id attributes. Check out user_id and party_id in the Python Client Reference.
user_id() → user_id
party_id() → party_id
Migration Steps:
Search for instances: Use your IDE or code searching tools to find all instances where user_id() and party_id() are called on the Nillion Python Client.
Replace method calls: Replace all method calls with attribute accesses as shown in the Version 0.2.1 example.
Test: Thoroughly test your application to ensure that there are no issues due to this change.
# Version 0.2.1: user_id and party_id attributesprint("User ID:", client.user_id)
print("Party ID:", client.party_id)
🌅 Sunsetting SecretArray in favor of Python lists
We are removing any reference to the experimental SecretArray type from the documentation. We believe the use of Python lists is more effective for development. The Nada DSL supports the introduction and use of Python lists that contain secret integer values. This includes using a subset of the list comprehension syntax supported by Python. Check out updated Nada Language documentation and examples of using Python lists of SecretIntegers:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Nillion SDK Release 0.2.1 includes new Nada language features, improvements to the
nada
tool, 2 breaking changes to the Nillion Python Client, and the sunsetting of SecretArrays.How to upgrade
pynadac
to be stored and used with version 0.2.1 of the SDK.user_id
andparty_id
(see below)What’s new
🎉 New Nada Language Features
Nillion SDK Release 0.2.1 introduces private equality, left shift, right shift, and probabilistic truncation to the Nada language.
(
P: Public
,S: Secret
)x == y
S ← S == S
,S ← S == P
,S ← P == S
,P ← P == P
x << y
P ← P << P
,S ← S << P
x >> y
P ← P >> P
,S ← S >> P
x.trunc_pr(y)
S ← S.trunc_pr(P)
Check out https://docs.nillion.com/nada-lang-operators for a full overview of the primitive Nada operations.
⛏️ Nada Tool Improvements
The
nada
tool now has the ability to print program requirements, and get a Nada program’s protocols model and bytecode in text format. Check out thenada
tool documentation to learn more about usage https://docs.nillion.com/nadaPrint program requirements
The new
program-requirements
command prints the runtime requirements of the preprocessing elements of a program.Example: 3 Party addition program
Command:
nada program-requirements <program-name>
Program requirements printed for the 3 Party addition program example with
nada program-requirements main
Check out the docs here: https://docs.nillion.com/nada#get-program-requirements
Get a Nada program’s protocols model in text format
Command:
nada run <test-name> --protocols-text
Protocols model
main.nada.protocols.txt
text file generated for the 3 Party addition program example withnada run main --protocols-text
Check out the docs here: https://docs.nillion.com/nada#run-and-get-protocols-model-text-file
Get a Nada program’s bytecode in text format
Here’s the bytecode
main.nada.bytecode.txt
text file generated for the 3 Party addition program example withnada run main --bytecode-text
Check out the docs here: https://docs.nillion.com/nada#run-and-get-bytecode-in-text-format
⛓️💥 Breaking Changes
Nillion Python Client user_id and party_id have changed from methods to attributes
The
user_id()
andparty_id()
Nillion Python Client methods have been deprecated and replaced with attributes. This change reduces the overhead of method calls for accessing these properties and keeps the Nillion Python Client consistent with the Nillion JavaScript Client, which hasuser_id
andparty_id
attributes. Check out user_id and party_id in the Python Client Reference.user_id()
→user_id
party_id()
→party_id
Migration Steps:
user_id()
andparty_id()
are called on the Nillion Python Client.🌅 Sunsetting SecretArray in favor of Python lists
We are removing any reference to the experimental SecretArray type from the documentation. We believe the use of Python lists is more effective for development. The Nada DSL supports the introduction and use of Python lists that contain secret integer values. This includes using a subset of the list comprehension syntax supported by Python. Check out updated Nada Language documentation and examples of using Python lists of SecretIntegers:
Beta Was this translation helpful? Give feedback.
All reactions