This is an example of blind computation with Nillion to figure out how many pizzas to order for Bitcoin Pizza Day.
Check out the determine_pizza_count.py Nada program.
Alex, the pizza purchaser, needs to figure out how many pizzas to order for his 3 friends without having any of the friends reveal how many pieces of pizza they plan to eat. Alex also wants to know how many slices will be leftover.
-
Install the Nillion SDK and Tools
-
Clone this repo
git clone https://github.com/oceans404/btc-pizza-day-nada.git cd btc-pizza-day-nada
-
Set up a Python virtual environment following steps here
-
Change directory into the nada project folder
cd nada-pizza-programs
-
Build (compile) all Nada programs listed in the
nada-project.toml
nada build
-
Run Nada program with test values set in tests folder yaml files
nada run order-perfect-amount nada run order-with-leftovers
-
Optional: Create new tests to try different scenarios. Update these tests' yaml values and run the test
Generate test file:
nada generate-test --test-name <test-name> determine_pizza_count
Run test:
nada test <test-name>
-
Keep building! Add more programs, compile programs, and test programs following nada docs
-
Get rewarded for building on Nillion. Check out Nillion Builder Bounties, linked in the Build section of the Nillion docs