nillionnetwork / nillion-python-starter Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Describe the bug
When trying to follow the Millionaire demo project on the Nillion.Docs, I came across the error: "storing program: program is not valid: ["io error: "]" when trying to run the command: python3 01_store_secret_party_1.py
How to reproduce
Follow the exact Nillion docs guide:
Expected behavior
Expected output is the following:
Storing program in the network: millionaires
[2024-06-11T21:11:30Z ERROR node::managers::compute::handlers::compute] Failed to process message: task StoreProgramCompute<71d3259f-b042-4273-9736-b2ad0cf82161> not found
[2024-06-11T21:11:30Z ERROR node::managers::compute::handlers::compute] Failed to process message: task StoreProgramCompute<71d3259f-b042-4273-9736-b2ad0cf82161> not found
Alice stores millionaires program at program_id: 3PYSzv55jRS4k6nuiF8YgLgruUdgqtobnsnA1oJrTEu21bGdpeBPfGmjw57GRCwXQ5YEbQFaMjS5MjSquF9p7Ynf/millionaires
Alice tells Bob and Charlie her user_id and the millionaires program_id
📋⬇️ Copy and run the following command to store Bob and Charlie's salaries in the network
python3 02_store_secret_party_n.py --user_id_1 3PYSzv55jRS4k6nuiF8YgLgruUdgqtobnsnA1oJrTEu21bGdpeBPfGmjw57GRCwXQ5YEbQFaMjS5MjSquF9p7Ynf --program_id 3PYSzv55jRS4k6nuiF8YgLgruUdgqtobnsnA1oJrTEu21bGdpeBPfGmjw57GRCwXQ5YEbQFaMjS5MjSquF9p7Ynf/millionaires
(.venv) Vladzor-PC:~/nillion-python-starter/examples_and_tutorials/mi
Screenshots
https://cdn.discordapp.com/attachments/1204182804817121334/1250185046774775869/image.png?ex=666a050e&is=6668b38e&hm=619b610b20f35cd65e3ab87593f3e932a9de8f8eaa3372cb1758f90f6f74c2e7&)
Code links
https://github.com/NillionNetwork/nillion-python-starter/tree/main/examples_and_tutorials/millionaires_problem_example
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Managed to fix it by:
I noticed that this pathing is handled differently in the nillion-python-starter/examples_and_tutorials/core_concept_multi_party_compute
Here, the problem is fixed by adding the nada.bin path to the Config file. I will make a PR with this fix.
Optional - ETH Address
Optionally add your ETH Address here.
0x8Ed084fe1502dAF70A1085e1AD6941DbE52D08c8
pip install nillion.crypto
ERROR: Could not find a version that satisfies the requirement nillion.crypto (from versions: none)
ERROR: No matching distribution found for nillion.crypto
**What section of the docs could be improved? **
The entire collection of the Nillion Python Starter programs.
What part(s) of the docs would you like to see updated?
Comments which explain which parts of the outputs and bits of information are available to which parties based on the definitions. Adding some inline comments to, for example, the honest voting program in the form of # result_c0 stores y information, and can be viewed by x party
would be really helpful.
Additional context
I was trying to explore what is possible currently with Nillion, and the Python examples were my go to as I assume they will be for many others. Unfortunately it's still confusing at the moment to understand what exactly the examples are accomplishing without switching back and forth between the python client reference
What section of the docs could be improved?
Naming used for the single_party_compute example files.
What part(s) of the docs would you like to see updated?
The example files have the same names as the programs they use, which is confusing.
Recommendation: Append "_example" to the example files.
e.g., "addition_simple_example.py" in single_party_compute examples would use "addition_simple.py" from programs.
**What section of the docs could be improved? **
I went through the steps in the docs. But it seemed that the py_client was not installed when I ran bootstrap-local-cluster and then the dovtenv was not installed (or requirements.txt was not installed) at any point.
I may have gone through the steps in a wrong order, or made a mistake. But perhaps we can check this when we get a few user testers going through the flow
Is it correct that:
Describe the bug
I'm trying to follow a quickstart guide with SDK v2024-03-12-d2d0a82c8
for x86_64-unknown-linux-musl
and nada_dsl-0.1.0-py3-none-any.whl
, py_nillion_client-0.1.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
. OS: Ubuntu 22.04.3 (amd64).
Rigth after start, the following errors start appearing in the terminal:
(.venv) lexx@lexx-ubuntu:~/code/nillion/nillion-python-starter$ ./bootstrap-local-environment.sh
NILLION_SDK_ROOT is set to: '/home/lexx/code/nillion/nillion-binaries/v2024-03-12-d2d0a82c8/x86_64-unknown-linux-musl'
/home/lexx/code/nillion/nillion-binaries/v2024-03-12-d2d0a82c8/x86_64-unknown-linux-musl/run-local-cluster
ℹ️ found bin RUN_LOCAL_CLUSTER -> [/home/lexx/code/nillion/nillion-binaries/v2024-03-12-d2d0a82c8/x86_64-unknown-linux-musl/run-local-cluster]
ℹ️ found bin USER_KEYGEN -> [/home/lexx/code/nillion/nillion-binaries/v2024-03-12-d2d0a82c8/x86_64-unknown-linux-musl/user-keygen]
ℹ️ found bin NODE_KEYGEN -> [/home/lexx/code/nillion/nillion-binaries/v2024-03-12-d2d0a82c8/x86_64-unknown-linux-musl/node-keygen]
/tmp/tmp.PFIOJq5Zve
Bootstrapping environment and updating your .env file...
✔️cluster is running, bootnode is at /ip4/127.0.0.1/tcp/44245/p2p/12D3KooWESg6ku4GJLzRYbcSUinGYbosqyZnWxgxga9eijMdQk51
ℹ️ Cluster has been STARTED (see /tmp/tmp.PFIOJq5Zve)
ℹ️cluster id is 8fc1e6ca-fbb7-4200-bbaa-c5e944abb1a8
ℹ️using 256 bit prime
ℹ️storing state in /tmp/.tmpvU0jRt
⛓️starting blockchain node...
✔️blockchain node running on endpoint http://localhost:45685
🏃starting node 12D3KooWESg6ku4GJLzRYbcSUinGYbosqyZnWxgxga9eijMdQk51
⏳waiting until bootnode is up...
🏃starting node 12D3KooWRTrWjncVzQtcmiwqYTAMaBsT2ktjjXEGhbPfq7z862YS
🏃starting node 12D3KooWGeQ28g4dHfeiHPyzsiPjVM5QDd5N29P5PYHZZcvCw6Fz
🏃starting node 12D3KooWDG8b72yXfTMmTmbHKSyu2n2UtKPrkKTTxwLfopvJMWmu
🏃starting node 12D3KooWKRn6RhmHfTEMFDSQDskHFfDQFEpbx49bJK3QG9BF4xAP
🎁wallet keys written to /tmp/.tmpvU0jRt/private-keys.txt
📝payments configuration written to /tmp/.tmpvU0jRt/payments-config.yaml
🥾bootnode config written to /tmp/.tmpvU0jRt/bootnode.yaml
📝configuration written to /home/lexx/.config/nil-cli/config.yaml
✔️cluster is running, bootnode is at /ip4/127.0.0.1/tcp/44245/p2p/12D3KooWESg6ku4GJLzRYbcSUinGYbosqyZnWxgxga9eijMdQk51
🔗websocket: /ip4/127.0.0.1/tcp/42765/ws/p2p/12D3KooWESg6ku4GJLzRYbcSUinGYbosqyZnWxgxga9eijMdQk51
🔑 Generating a node key and user keys (reader key and writer key)
🔑 Node key and user keys have been generated
--------------------
💻 Your Nillion local cluster is still running - process pid: 21511
22522
ℹ️ Updated your .env file configuration variables: bootnode, cluster id, keys, blockchain info
📋 Compile all Nada programs './compile_programs.sh'
(.venv) lexx@lexx-ubuntu:~/code/nillion/nillion-python-starter$ [2024-03-21T11:42:38Z ERROR node::managers::preprocessing::handlers::preprocessing] Failed to process pre-processing message: send failed because receiver is gone
(.venv) lexx@lexx-ubuntu:~/code/nillion/nillion-python-starter$ [2024-03-21T11:42:48Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: adding shares
[2024-03-21T11:42:49Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: adding shares
[2024-03-21T11:42:49Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:49Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:49Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: adding shares
[2024-03-21T11:42:49Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:49Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:49Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:49Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:49Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:49Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:49Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: adding shares
[2024-03-21T11:42:49Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:49Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:49Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:49Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:50Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:50Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:50Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:50Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:50Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:50Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:50Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:50Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 5363f407-a20e-9ef0-b59e-a689181f30de batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:53Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action c0c5af72-249a-757c-401d-647a6ce89626 batch 0 message handling failed: adding shares
[2024-03-21T11:42:53Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action c0c5af72-249a-757c-401d-647a6ce89626 batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:53Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action c0c5af72-249a-757c-401d-647a6ce89626 batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:53Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action c0c5af72-249a-757c-401d-647a6ce89626 batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:53Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action c0c5af72-249a-757c-401d-647a6ce89626 batch 0 message handling failed: state unavailable: state is taken
[2024-03-21T11:42:53Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action c0c5af72-249a-757c-401d-647a6ce89626 batch 0 message handling failed: state unavailable: state is taken
(.venv) lexx@lexx-ubuntu:~/code/nillion/nillion-python-starter$ [2024-03-21T11:43:15Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 357c889a-bada-0ab9-b18d-d22a5fc8ba7e batch 0 message handling failed: failed to compute final output: not a quadratic residue
[2024-03-21T11:43:15Z ERROR node::managers::preprocessing::actions::preprocessing::handlers::action_message] Action 357c889a-bada-0ab9-b18d-d22a5fc8ba7e batch 0 message handling failed: failed to compute final output: not a quadratic residue
How to reproduce
I was following a quick start guide from the docs.
Expected behavior
No error message
Desktop (please complete the following information):
SDK v2024-03-12-d2d0a82c8
for x86_64-unknown-linux-musl
and nada_dsl-0.1.0-py3-none-any.whl
, py_nillion_client-0.1.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
OS: Ubuntu 22.04.3 (amd64).
Python 3.10.12
I wonder if in all the files to run programs e.g. client_single_party_compute/addition_simple.py
we should also add code to upload the program in the file.
Otherwise, users have to store at the cli everytime before they can actually run those files.
The docs walk the user through this step, but it may get annoying for users to always have to store the program from the cli.
However, we should avoid confusion by having the docs tell them to upload from the cli then when they run the python script, it says "storing program". Maybe we have a bit in the python script that checks to see if the program is already stored, and if not, stores it for the user
Just an idea
Thank you for reading the docs and suggesting an improvement!
**What section of the docs could be improved? **
I got confused which env file to put my ROOT paths in. What is the difference between .env
and .env.sample
Thank you for reading the docs and suggesting an improvement!
First things first
**What section of the docs could be improved? **
Python Developer Quickstart section
What part(s) of the docs would you like to see updated?
The entire Python Developer Quickstart section is repeated twice and the section called "Using the Python client to run your program" has been modified to directly write the program instead of letting the devs a chance for completing the programs by themselves.
Additional context
Add any other context here.
Optional - ETH Address
0x95D36a9d1C9D89c2053090C35cb98FbF0AB73e22
Describe the bug
The following programs do not run in the client_single_party_compute
directory.
Mostly it is because the equivalent programs do not exist in the programs
directory.
I suggest we remove them from the client_single_party
directory so not to cause confusion (or we add the relevant programs in the programs
directory.
"division_simple.py", "input_array.py", "modulo_simple.py", "nada_fn_composition.py", "power_simple.py", "reuse_simple_sub.py", "simple_sub.py", "single_addition.py", "tiny_secret_addition.py"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.