Contracts

Note: Program IDs are placeholders until public release.

  • Shielded Pool Program: MuReNa1111111111111111111111111111111
  • Relayer Registry: MuReNaReLay111111111111111111111111111

Accounts

  • Global: parameters, known roots, vk references
  • Nullifier Set (PDA): stores used nullifiers
  • Commitment Tree (PDA): rolling Merkle tree metadata

Events (logs)

  • ProofVerified(root, nullifiers[])
  • NewCommitments(commitments[])
  • Relayed(signature, relayer_id)

Instruction sketch (Rust)

pub enum Instruction {
  Verify { proof: Vec<u8>, public_signals: Vec<[u8;32]> },
  AppendRoot { root: [u8;32] },
}

pub fn process(ctx: Context<Process>, ix: Instruction) -> Result<()> {
  match ix {
    Instruction::Verify { proof, public_signals } => {
      verify_and_record(ctx, proof, public_signals)?
    }
    Instruction::AppendRoot { root } => {
      ctx.accounts.global.roots.push(root);
    }
  }
  Ok(())
}

IDL (excerpt)

{
  "name": "shielded_pool",
  "instructions": [
    { "name": "verify", "accounts": ["global","nullifierSet","authority"], "args": ["proof","publicSignals"] },
    { "name": "appendRoot", "accounts": ["global","authority"], "args": ["root"] }
  ]
}