Skip to content

Solution: LP-0005 — Private Balance Attestation#64

Open
edenbd1 wants to merge 1 commit into
logos-co:masterfrom
edenbd1:lp-0005-private-balance-attestation-submission
Open

Solution: LP-0005 — Private Balance Attestation#64
edenbd1 wants to merge 1 commit into
logos-co:masterfrom
edenbd1:lp-0005-private-balance-attestation-submission

Conversation

@edenbd1
Copy link
Copy Markdown

@edenbd1 edenbd1 commented May 24, 2026

Implementation of LP-0005: a reusable private token balance attestation primitive for the Logos Execution Zone.

✅ Deployed live on the public Logos Execution Zone testnet — with a confirmed on-chain gated_check

Public on-chain evidence — every tx independently verifiable via getTransaction JSON-RPC or by clicking the explorer link:

# Action Tx hash
1 wallet deploy-program — attestation circuit (Risc0 guest proving balance ≥ N, ImageID dbc40b94…6a9d4d) 4593060b…3db989d
2 wallet deploy-program — verifier program v2 (SPEL, deep gate via ChainedCall, ImageID 7715f791…d8a1db429) 2bf10138…23723a9
3 wallet deploy-program — verifier program v3 (SPEL, shallow gate, ImageID b32c6662…df85952a) a0ec45bb…d341c5ca
4 spel gated_check CONFIRMED on chain — real Risc0 receipt + real ECDSA-signed challenge → v3 verifier accepts 262bbe95…6babfd5e

Full deployment record (with reproduction commands) in docs/DEPLOYMENT.md.

Summary

A presenter holding a shielded LEZ token account can prove balance ≥ N without revealing the account's npk, exact balance, or identity. Two verification paths:

  • On-chain — SPEL #[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.
  • Off-chain — Rust library (crates/verifier-offchain/) that runs the same check_gate rules locally against a Risc0 receipt delivered over any transport (in-memory backend committed; qt_bridge feature gate for the production Logos Delivery binding).

Highlights vs the spec

  • Verifiable public-testnet deployment — the 4 tx hashes above, all live on https://testnet.lez.logos.co. Anyone can getTransaction them or open the explorer link.
  • End-to-end on-chain gated_check confirmed — not just a deployed program, but a real ECDSA-signed gate call that the verifier accepted and that landed in a block.
  • Real Risc0 proofsscripts/demo.sh exports RISC0_DEV_MODE=0 as 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 via attest prove --groth16 for Logos Delivery payload-cap compatibility.
  • Four reusable crates published on crates.ioattestation-core, attestation-verifier-program, attestation-sequencer-client, attestation-delivery-transport. External builders can cargo add directly.
  • Basecamp .lgx publishedapp/lp-0005-attestation.lgx 2.1 MB, lgx verify ✅, SHA-256 193a903a…94c89770.
  • Four reference integrations under integrations/ — governance-gate, chat-gate, premium-features, and nostr-auth-gate (NIP-42 relay AUTH starter for the outside-party port).
  • 57 tests passing across the workspace (cargo test --workspace --release), CI green on main.
  • 30-second reproducible demoscripts/demo.sh runs the full pipeline against the public testnet from a clean clone, requires only curl, python3, jq, and cargo.

Per-criterion compliance map

See docs/criteria-checklist.md for 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_check instruction takes the flattened journal + ECDSA challenge response + caller-pinned context/threshold, runs the host-side gate, and (in the deep variant) declares a ChainedCall so the LEZ PPE pipeline composes the inner Risc0 receipt via env::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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 24, 2026

✅ Validation passed

A reviewer will assess against the prize criteria.
ℹ️ Solution submission for LP-0005.
ℹ️ Checking repo: https://github.com/edenbd1/lp-0005-private-token-balance-attestation


Automated check. See solution template and TERMS.

@edenbd1 edenbd1 force-pushed the lp-0005-private-balance-attestation-submission branch from c9cb327 to e39303b Compare May 24, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant