Solution: LP-0005 — Private Balance Attestation#64
Open
edenbd1 wants to merge 1 commit into
Open
Conversation
✅ Validation passedA reviewer will assess against the prize criteria. Automated check. See solution template and TERMS. |
c9cb327 to
e39303b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation of LP-0005: a reusable private token balance attestation primitive for the Logos Execution Zone.
solutions/LP-0005.md✅ Deployed live on the public Logos Execution Zone testnet — with a confirmed on-chain
gated_checkhttps://testnet.lez.logos.cohttps://explorer.testnet.lez.logos.coCbgR6tj5kWx5oziiFptM7jMvrQeYY3Mzaao6ciuhSr2rPublic on-chain evidence — every tx independently verifiable via
getTransactionJSON-RPC or by clicking the explorer link:wallet deploy-program— attestation circuit (Risc0 guest provingbalance ≥ N, ImageIDdbc40b94…6a9d4d)4593060b…3db989dwallet deploy-program— verifier program v2 (SPEL, deep gate viaChainedCall, ImageID7715f791…d8a1db429)2bf10138…23723a9wallet deploy-program— verifier program v3 (SPEL, shallow gate, ImageIDb32c6662…df85952a)a0ec45bb…d341c5caspel gated_checkCONFIRMED on chain — real Risc0 receipt + real ECDSA-signed challenge → v3 verifier accepts262bbe95…6babfd5eFull deployment record (with reproduction commands) in
docs/DEPLOYMENT.md.Summary
A presenter holding a shielded LEZ token account can prove
balance ≥ Nwithout revealing the account'snpk, exact balance, or identity. Two verification paths:#[lez_program](crates/verifier-program-spel/methods/guest-shallow/src/bin/attestation_verifier_shallow.rs), validates context binding + threshold floor + ECDSA presenter signature. Confirmed end-to-end against the v3 verifier above.crates/verifier-offchain/) that runs the samecheck_gaterules locally against a Risc0 receipt delivered over any transport (in-memory backend committed;qt_bridgefeature gate for the production Logos Delivery binding).Highlights vs the spec
https://testnet.lez.logos.co. Anyone cangetTransactionthem or open the explorer link.gated_checkconfirmed — not just a deployed program, but a real ECDSA-signed gate call that the verifier accepted and that landed in a block.scripts/demo.shexportsRISC0_DEV_MODE=0as its first non-comment line; the demo prints the banner as its first non-blank output. Composite receipt 300,863 bytes in ~6.5 s; Groth16-wrapped receipt 1,479 bytes (203× smaller) in ~150 s viaattest prove --groth16for Logos Delivery payload-cap compatibility.attestation-core,attestation-verifier-program,attestation-sequencer-client,attestation-delivery-transport. External builders cancargo adddirectly..lgxpublished —app/lp-0005-attestation.lgx2.1 MB,lgx verify ✅, SHA-256193a903a…94c89770.integrations/— governance-gate, chat-gate, premium-features, andnostr-auth-gate(NIP-42 relay AUTH starter for the outside-party port).cargo test --workspace --release), CI green onmain.scripts/demo.shruns the full pipeline against the public testnet from a clean clone, requires onlycurl,python3,jq, andcargo.Per-criterion compliance map
See
docs/criteria-checklist.mdfor the row-by-row mapping from every line of the prize text to the code, test, or transaction hash that satisfies it.Architecture
LEZ verifier as a SPEL program (justified vs zone-SDK in ADR-001): a single
gated_checkinstruction takes the flattened journal + ECDSA challenge response + caller-pinned context/threshold, runs the host-side gate, and (in the deep variant) declares aChainedCallso the LEZ PPE pipeline composes the inner Risc0 receipt viaenv::verify. Three-piece structure (portable kernel + deep guest + shallow guest) covers both the architecturally-ideal path and the confirmable-today path. Decision write-up: ADR-002.