1. Goals and non-goals
The BAP wallet layer is responsible for how humans actually touch the protocol: identities, keys, proofs, and how they survive over time.
Goals
- Identity
- Manage one or more long-lived BAP identities as hash commitments.
- Authorization
- Generate local ZK proofs instead of broadcasting raw signatures.
- Key management
- Mnemonic-based, rotation-friendly, backup-friendly.
- Extensibility
- Anonymous voting, PQ upgrades, shielded governance.
- Fee integration
- A clean path to Lightning, L402 and Fedimint.
Non-goals
- Not a general zkVM or prover marketplace.
- Not a generic privacy wallet for other chains.
- Not itself a Lightning node implementation.
- Not an all-purpose MPC wallet.
2. Identity model
2.1 Commitments as public identity
In BAP, the chain never sees public keys directly. It only sees commitments:
commitment = Poseidon(SK)
// optionally domain-separated
commitment = Poseidon("BAP_IDENTITY", SK)These commitments represent any actor in the protocol: owners, guardians, delegates, voters, and more. They're stable handles you can reason about without leaking key details.
2.2 Secret keys
- Derived from a mnemonic seed or generated randomly.
- Stored only on the user's devices.
- Used strictly inside local signing and ZK circuits.
- Implementation can swap primitives later (e.g. PQ), while commitments stay stable.
3. Seed, mnemonics and derivation
The wallet is seeded once, then fans out into specific roles: identity, anonymous voting, keyper and fee keys.
3.1 Mnemonics
Required:
- 12-word mnemonics (good default).
- 24-word mnemonics (high assurance).
mnemonic → seed (512 bits) → role-specific key derivation3.2 Logical roles
- m/0
- Primary BAP identity (owning, minting, recovering).
- m/1
- Anonymous voting identity (Semaphore-style).
- m/2
- Keyper / governance encryption keys.
- m/3
- Fee / payment subkeys (Lightning / L402 etc.).
3.3 Multiple accounts
From the same seed, users can spin up multiple identities:
Account 0: SK_0 → commitment_0
Account 1: SK_1 → commitment_1
...4. ZK-LIB and identity proofs
ZK-LIB is a small, fixed-circuit library shared by wallets and nodes. Wallets prove; nodes verify.
fn identity_prove(
sk: SecretKey,
commitment: Field,
event_hash: Field,
) -> ZKProof;
fn identity_verify(
proof: ZKProof,
commitment: Field,
event_hash: Field,
) -> bool;Inside the circuit we check that the commitment matches SK, a signature over event_hash is valid, and that the domain / nonce rules are followed so proofs can't be replayed.
5. Event authorization flow
- Wallet builds the event payload.
- Wallet computes canonical event_hash.
- Wallet selects identity SK and commitment.
- Wallet calls identity_prove(sk, commitment, event_hash).
- Wallet attaches an auth block to the event:
{
"commitment": "<field value>",
"proof": "<ZKProof bytes>"
}Nodes recompute event_hash from the payload and run identity_verify. They never see SK, PK, or raw signatures.
6. Modes, backup and roadmap
Governance modes
- Public voting
- Identity-visible with identity_prove().
- Shielded
- Encrypted votes with delayed reveal.
- Anonymous
- Semaphore-style groups and nullifiers.
- Homomorphic
- ElGamal-style aggregation with range proofs.
Backup and rotation
- Mnemonic is the root of all BAP identities.
- Optional Shamir splitting of the seed for high-value setups.
- Protocol-level rotation events (e.g. controller rotate).
Implementation phases
Phase 1: minimal wallet
Single identity, local proving, core events (mint, transfer, recovery).
Phase 2: multiple identities
Multiple accounts, rotation, better UI affordances.
Phase 3: governance hooks
Public + shielded voting integrations.
Phase 4: advanced privacy and post-quantum
Anonymous voting, homomorphic modes, PQ internal schemes.
7. Summary
The BAP wallet is a seeded identity manager, a commitment factory and a ZK prover client, not just a place to park a key pair.
// Wallet side
identity_prove(sk, commitment, event_hash) -> ZKProof
// Node side
identity_verify(proof, commitment, event_hash) -> boolEverything else, from governance to agents, guardians and committees, builds on that simple, auditable contract.