Users of Jubmoji.quest tap NFC cards to collect signatures. By collecting these signatures, they complete quests. In order to complete a quest, a user must generate a client-side zero knowledge proof about the signatures they have collected. In particular, we allow users to complete quests which will send their proof to an external server for custom verification.
We have distributed 201 NFC Cards across Zuconnect/Devconnect. Each of these cards has a BabyJubJub ECDSA private key stored in its trusted hardware, a list of all public keys can be found here. When a user taps an NFC Card, the card increments a nonce and signs the pair (nonce, randomSalt)
with its private key. This signature is the Jubmoji.
As of today, there is one general purpose proof which encompasses all the statements a user can prove, NUniqueJubmojisInCollection. This proof represents the fact that "I own N Jubmojis which were given by unique cards in this list". There are many interesting things we can do with just this one statement:
- Prove a user has met every person at an event (give everyone a card, set collection = list of people's card public keys, N = # of people)
- Prove a user has joined any team in a game (have one card for each team, set collection = list of team card public keys, N = 1)
- Prove a user owns a Jubmoji from a specific card (set collection = a list consisting of one card, N = 1)
Talk to Andrew or Vivek to get a quest set up for your project. In particular, we will give you a few NFC cards to hand out signatures with, and create the quest for you on jubmoji.quest. When users complete your quest, they will generate a proof client-side and be redirected to a url of your choice with the proof.
Proofs are sent to a url of your choice in the proof
url param, i.e. https://url.com/jubmojis?proof=EXAMPLE_SERIALIZED_PROOF. There is an example verification script located here, to use it you must install jubmoji-api: npm i jubmoji-api
. Optionally, for more general elliptic curve and BabyJubJub utilities, see babyjubjub-ecdsa.
Install yarn: corepack enable
.
Run yarn install
in root directory.
- Install and run Postgres locally.
- Set the DATABASE_PRISMA_URL and DATABASE_URL_NON_POOLING env variables to be a URL pointing to your local database.
- Run
npx prisma migrate dev --name [name]
to create a dev migration. - Run
npx prisma generate
to regenerate the prisma client.
Run both of these from root:
cd packages/jubmoji-api && yarn run build
cd apps/jubmoji-quest && yarn dev
We are grateful for all the work done by others that was needed for this to exist. A few special shoutouts: