Skip to content

figure out how many pizzas to order for your friends with blind computation

Notifications You must be signed in to change notification settings

oceans404/btc-pizza-day-nada

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Blind Computation on Bitcoin Pizza Day 🍕🙈

This is an example of blind computation with Nillion to figure out how many pizzas to order for Bitcoin Pizza Day.

Program logic

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.

Run this example

  1. Install the Nillion SDK and Tools

  2. Clone this repo

    git clone https://github.com/oceans404/btc-pizza-day-nada.git
    cd btc-pizza-day-nada
  3. Set up a Python virtual environment following steps here

  4. Change directory into the nada project folder

    cd nada-pizza-programs
  5. Build (compile) all Nada programs listed in the nada-project.toml

    nada build
  6. Run Nada program with test values set in tests folder yaml files

    nada run order-perfect-amount
    nada run order-with-leftovers
  7. 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>
  8. Keep building! Add more programs, compile programs, and test programs following nada docs

  9. Get rewarded for building on Nillion. Check out Nillion Builder Bounties, linked in the Build section of the Nillion docs

About

figure out how many pizzas to order for your friends with blind computation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages