Commitment only
On-chain (here: simulated) state holds H(amount ‖ note ‖ salt ‖ domain) + optional range claim. No ADA amount in the clear.
- Commitment hash (hex)
- Timestamp / pledge id
- Optional disclosed flag / range tag
Dual-state · private tip jar
World-class educational tip jar for Midnight’s dual-state model: seal a private amount + note, commit only a public hash to the simulated ledger, then prove a threshold (amount ≥ X) without disclosing the exact tip — or selectively disclose when you choose. By @kshot9000 · nightdream.xyz.
Labeled phases from private compose → public commitment → selective disclose. Error / reject is first-class.
Phase: idle — compose a private pledge to begin.
Public ledger sees a commitment. Private vault keeps amount + salt. Threshold proofs disclose a predicate — not the tip itself.
On-chain (here: simulated) state holds H(amount ‖ note ‖ salt ‖ domain) + optional range claim. No ADA amount in the clear.
Amount, note, and salt stay in localStorage — a stand-in for Compact witnesses / local state that never leave the client.
amountAda (decimal)note (private message)salt (32-byte hex)Observers see only the commitment. Exact tip stays veiled.
Threshold or full disclose trades privacy for proof / gratitude.
Build a private pledge, seal witnesses, then commit the hash to the public board. No Compact runtime — educational only.
Amount and note stay in the vault until you disclose.
No sealed draft.
Domain-separated SHA-256 stand-in for a Compact commitment.
Seal first, then commit.
Real Cardano donation address for this lab — copy anytime. The pledge theater does not send ADA.
addr1q8hnl6vl5a6k3rw3n5g3jtte696zcl76kfatzv7gpswa9r0dj7fma6klq55y4ffm7tf0em09udnyhuk4ah92pl5x9jpqjae44v
Prove amount ≥ threshold without revealing the exact tip. Reject is a first-class outcome when the vault cannot satisfy the claim.
No proof attempted.
Public commitments first. Private bodies stay veiled until threshold or full disclose. Real localStorage (schema v2) + multi-tab sync + JSON export/import — still LOCAL-TRUE, not on-chain.
localStorage schema v2 · BroadcastChannel sync · Export may include amounts/salts — treat as sensitive. LOCAL-TRUE ≠ on-chain.
Visual fill from local pledges. Real tips still go to the Cardano address below — this jar does not move coins.
Built by @kshot9000 (creator of nightdream.xyz). Paste this address in Lace / any Cardano wallet. Optional memo: “Veil Pledge”.
addr1q8hnl6vl5a6k3rw3n5g3jtte696zcl76kfatzv7gpswa9r0dj7fma6klq55y4ffm7tf0em09udnyhuk4ah92pl5x9jpqjae44v
Jar fill is from local simulated pledges only.
Not compilable as-is — verify against current Compact docs / Zswap APIs before shipping.
export ledger tipAda: Uint<64>;
export circuit tip(amount: Uint<64>): [] {
// Everyone sees the tip forever
tipAda = amount;
}
witness tipAmount(): Uint<64>;
witness tipSalt(): Bytes<32>;
export ledger commitment: Bytes<32>;
export circuit seal(): [] {
commitment = disclose(
persistentHash<…>([tipAmount(), tipSalt()])
);
}
// Later: prove tipAmount() >= threshold in-circuit
// without writing the exact amount to the ledger.
Prefer official starters:
example-bboard
·
Compact docs
·
security best practices.
Auth gates: never assert(ownPublicKey() == owner) alone — see
Auth Forge Studio / MPS-0029.