Note Fingerprints — Web3

Keep Pasar Hewan Pon's book honest with real keccak, Merkle trees and secp256k1 signatures. 14 levels, played right in the browser with nothing to install.

What the levels ask

  1. The Pon Livestock Market is open again. Last month Si Belang the cow was written down as sold twice and a page of the old book was written over, so Ms. Lestari keeps the book a new way: every note gets a fingerprint, the keccak-256 of what the note says. This morning three people bring a copy of Si Belang's sale note. Tap each copy to fingerprint it, then pick the copy whose fingerprint is the one in the book and Approve it.
  2. Ms. Lestari finds an old book of five pages. Each page starts with the fingerprint of the page before it (prev), and the last page's fingerprint was written on the board when the market closed. One page was written over after that. Tap Check on each page to fingerprint it and compare it with what the next page remembers, then point at the page that was written over.
  3. The market closes. Today's four notes hang on the twigs of the Note Tree in the book's order. Tie them two by two into knots (tap the left child first, then the right), then tie the two knots into the root. The district works out the root from the same book; send yours and see if it matches.
  4. Mr. Karim wants to be able to prove that the note for the calf he bought (note 6) is in today's root, without taking the whole book home and without seeing anyone else's notes. Tap the knots on the tree he has to carry, then Hand over the proof. Mr. Karim will climb from his leaf to the root.
  5. Mrs. Lastri gets the proof for note 11 of today's 16 notes: four hashes in a list, bottom up, with no picture of the tree. For each hash, decide whether it is tied on the left or the right of the hash in hand, then Fold. The result has to be the root on the board.
  6. Mrs. Lastri buys a nanny goat from Mr. Tono, Rp2,400,000. From today a payment note is written like an Ethereum transaction: a nonce, a recipient, an amount, a memo and the market's chain number, but no sender field. Pick the stamp (key) that signs this note, then Stamp it.
  7. Mrs. Lastri has gone home. Mr. Gondo brings three notes carrying exactly the same signature of Mrs. Lastri's. Only one was really signed by her. Tap Recover on each note to see the address its signature gives, then enter the real one.
  8. Mr. Gondo, a cattle broker from Ngadirejo, registers at Pon Market. His card shows his public key (65 bytes, starting with 04), and he signed a registration greeting. Put together the steps that turn that public key into his Ethereum address, then Register it. It has to be the address recovered from his greeting.
  9. Mr. Karim tries to cash Mrs. Lastri's chicken note (nonce 4) again, though it was paid yesterday, and the market refuses it. Now Mrs. Lastri writes a new note to Mr. Tono, Rp1,200,000. The book already holds five notes from her. Pick the nonce for the new note, then sign it.
  10. Mr. Tono also keeps money at Kliwon Market in Ngadirejo, with the same stamp, and there too his next note has nonce 6. He pays Mr. Gondo for a kambing jawa goat at Pon Market. Mr. Gondo is known to carry notes over to Kliwon Market. Pick the chain number written on the note, then sign it. Both markets will check it.
  11. This month's book was copied to three places: the hall (the neighbourhood head), Mrs. Sari's stall and the school (Mrs. Ratna). Under the board Ms. Lestari wrote the book's CID, as IPFS does. Today someone needs the original book. Tap each copy to work out its CID, then pick the copy that may be used.
  12. Mr. Gondo offers a Market App on his phone and asks Mr. Tono to sign three requests with his stamp. Only one is safe. Pick the request Mr. Tono may sign.

And more, 14 levels in all.