Program instructions
Every instruction of the Plaza program with its arguments, accounts and the errors it raises, generated from the IDL.
The Plaza program is Ag4v61FJpf422HEeftGvJoxmzMmQikgVDTZT5E1D9uYe, an Anchor program. Every instruction emits its event through Anchor's self-CPI, so the last two accounts of each are the event authority and the program. Seeds are listed on Addresses.
| Instruction | Signers | Compute units |
|---|---|---|
init | admin | |
set_fee | admin | |
register_asp | authority | 13,937 |
publish_root | authority | 15,495 to 22,967 |
clear_roots | authority | 21,896 |
register_venue | authority, destination | 13,216 |
set_accepted | authority | |
deposit | depositor | SOL 94,058; SPL 96,812 |
transact | payer | transfer SOL 283,593, SPL 281,247; withdrawal SOL 258,703, SPL to a venue 274,006 |
ragequit | payer | SOL 264,131; SPL 277,112 |
Compute units are measured on localnet.
init
Creates the program Config and the empty deposit tree, and registers Plaza's ring authority with SPP. Signed once by the admin key the program is built with.
Arguments
recipientPubkeyrequired- The fee recipient.
fee_bpsu16required- The withdrawal fee in basis points, 0 to 10,000.
windowu8required- How many recent roots each ASP keeps, 1 to 32.
Accounts
| Account | Writable | Signer | Notes |
|---|---|---|---|
admin | yes | yes | The admin key. Fixed: 9yabAfpdfa9eRBwUT2mcezJQLkBVuN14ZJXc9uKbvAbi. |
config | yes | The program Config. | |
tree | yes | The DepositTree. | |
ring_auth | yes | Plaza's ring authority, owned by SPP. Plaza signs SPP calls with it. | |
protocol | SPP's protocol configuration. Fixed: EienwBSpsbAetT3RAAMzVA9rB5RHgCF7yTH7FFST6AK5. | ||
spp | The Solana Privacy Program. Fixed: ring1GaLCuJnkUMVkX2JeZLTTX17wKsV4fZmPVzXANW. | ||
system_program | The system program. Fixed: 11111111111111111111111111111111. | ||
event_authority | Anchor's event authority, for events emitted by self-CPI. | ||
program | The Plaza program. |
Discriminator [220, 59, 207, 236, 108, 250, 47, 100]. Raises InvalidConfig.
set_fee
Changes the fee recipient and rate. Admin only.
Arguments
recipientPubkeyrequired- The new fee recipient.
fee_bpsu16required- The new rate in basis points, 0 to 10,000.
Accounts
| Account | Writable | Signer | Notes |
|---|---|---|---|
admin | yes | The admin key. | |
config | yes | The program Config. | |
event_authority | Anchor's event authority, for events emitted by self-CPI. | ||
program | The Plaza program. |
Discriminator [18, 154, 24, 18, 237, 214, 19, 80]. Raises InvalidConfig.
register_asp
Creates an Asp account for the signing authority. One per authority.
Arguments
namestringrequired- 1 to 96 bytes.
manifest_uristringrequired- 1 to 512 bytes.
Accounts
| Account | Writable | Signer | Notes |
|---|---|---|---|
authority | yes | yes | The ASP's or venue's authority. |
asp | yes | The Asp account. | |
system_program | The system program. Fixed: 11111111111111111111111111111111. | ||
event_authority | Anchor's event authority, for events emitted by self-CPI. | ||
program | The Plaza program. |
Discriminator [33, 250, 94, 131, 107, 252, 58, 138]. Raises InvalidManifest.
publish_root
Appends a root to the ASP's window, dropping the oldest when the window is full. Only the ASP's authority signs.
Arguments
root[u8; 32]required- The new root, 32 bytes big-endian.
membersu32required- Labels under the root. The program records the number in
RootPublishedand doesn't check it. manifest_hash[u8; 32]required- A hash of the manifest the root is published under.
Accounts
| Account | Writable | Signer | Notes |
|---|---|---|---|
authority | yes | The ASP's or venue's authority. | |
config | The program Config. | ||
asp | yes | The Asp account. | |
event_authority | Anchor's event authority, for events emitted by self-CPI. | ||
program | The Plaza program. |
Discriminator [50, 189, 35, 212, 180, 100, 87, 25].
clear_roots
Empties the ASP's window, so no root published before it proves any more, and emits RootsCleared. An ASP sends it before publish_root when the new root leaves out a label an earlier one held; without it that label keeps proving against the older roots until 32 newer ones push them out. Only the ASP's authority signs.
Accounts
| Account | Writable | Signer | Notes |
|---|---|---|---|
authority | yes | The ASP's or venue's authority. | |
config | The program Config. | ||
asp | yes | The Asp account. | |
event_authority | Anchor's event authority, for events emitted by self-CPI. | ||
program | The Plaza program. |
Discriminator [152, 174, 89, 177, 168, 29, 220, 137].
register_venue
Creates a Venue account for a deposit address. The venue's authority and the deposit address both sign.
Arguments
acceptedVec<Pubkey>required- ASP accounts the venue accepts, at most 32, none twice.
Accounts
| Account | Writable | Signer | Notes |
|---|---|---|---|
authority | yes | yes | The ASP's or venue's authority. |
destination | yes | The deposit address (register_venue) or the withdrawal's destination (transact). For a private transfer, any account the intent names. | |
venue | yes | The Venue account for the destination. In transact it is passed even when no venue is registered there. | |
system_program | The system program. Fixed: 11111111111111111111111111111111. | ||
event_authority | Anchor's event authority, for events emitted by self-CPI. | ||
program | The Plaza program. |
Discriminator [116, 155, 199, 243, 228, 180, 176, 173]. Raises InvalidSets.
set_accepted
Replaces a venue's accepted list. Only the venue's authority signs.
Arguments
acceptedVec<Pubkey>required- The new list, at most 32, none twice.
Accounts
| Account | Writable | Signer | Notes |
|---|---|---|---|
authority | yes | The ASP's or venue's authority. | |
venue | yes | The Venue account for the destination. In transact it is passed even when no venue is registered there. | |
event_authority | Anchor's event authority, for events emitted by self-CPI. | ||
program | The Plaza program. |
Discriminator [250, 215, 254, 235, 140, 30, 106, 174]. Raises InvalidSets.
deposit
Computes the deposit's label from the depositor, mint, amount, slot and deposit counter, writes it into the note, calls SPP's ring deposit, appends the label to the deposit tree and emits Deposited. SOL or one SPL mint, one note per deposit.
Arguments
wirebytesrequired- SPP's ring deposit instruction data. The program patches the label into the note before passing it on. SPP's accounts follow as remaining accounts.
Accounts
| Account | Writable | Signer | Notes |
|---|---|---|---|
depositor | yes | yes | The wallet depositing. It pays and signs. |
config | yes | The program Config. | |
tree | yes | The DepositTree. | |
ring_auth | Plaza's ring authority, owned by SPP. Plaza signs SPP calls with it. | ||
system_program | The system program. Fixed: 11111111111111111111111111111111. | ||
event_authority | Anchor's event authority, for events emitted by self-CPI. | ||
program | The Plaza program. |
Discriminator [242, 35, 198, 137, 82, 225, 242, 182]. Raises InvalidWire, InvalidBinding, TreeFull, DepositLabelChanged.
transact
Verifies the policy proof, calls SPP's transact, and for a withdrawal pays the destination and the fee recipient. One input note and up to two outputs.
Arguments
proofPolicyProofrequired- The Groth16 membership proof and its seven public signals.
wirebytesrequired- SPP's transact instruction data. SPP's accounts follow as remaining accounts; for an SPL withdrawal, the destination's and the fee recipient's token accounts come last.
Accounts
| Account | Writable | Signer | Notes |
|---|---|---|---|
payer | yes | yes | The fee payer: the relayer for a relayed spend, or the holder's wallet. |
config | The program Config. | ||
policy | What the proof is checked against: the chosen set's Asp account in transact, the DepositTree in ragequit. | ||
destination | yes | The deposit address (register_venue) or the withdrawal's destination (transact). For a private transfer, any account the intent names. | |
venue | The Venue account for the destination. In transact it is passed even when no venue is registered there. | ||
recipient | yes | The fee recipient from Config. | |
payout | yes | Plaza's payout escrow. SPP releases a withdrawal here; Plaza pays it out in the same instruction. | |
ring_auth | Plaza's ring authority, owned by SPP. Plaza signs SPP calls with it. | ||
spp | The Solana Privacy Program. Fixed: ring1GaLCuJnkUMVkX2JeZLTTX17wKsV4fZmPVzXANW. | ||
system_program | The system program. Fixed: 11111111111111111111111111111111. | ||
event_authority | Anchor's event authority, for events emitted by self-CPI. | ||
program | The Plaza program. |
Discriminator [217, 149, 130, 143, 221, 52, 252, 119]. Raises InvalidWire, VenueRefused, RootOutsideWindow, InvalidBinding, InvalidProof, InvalidSettlement.
ragequit
Pays a note out in full to the address that deposited it, with no fee and no set. The proof reveals the note's label and proves it under the deposit tree's current root or one of the roots its last 32 deposits replaced; the program recomputes the label from the destination, the mint and origin, so the destination can only be the original depositor. No outputs and no venue check.
Arguments
proofPolicyProofrequired- The membership proof on its exit path:
rootis the deposit tree's current root or one in itsrecentlist, andexitLabelis the label. wirebytesrequired- SPP's transact instruction data for a full withdrawal with no outputs.
originDepositOriginrequired- The deposit's
amount,slotandnonce, from itsDepositedevent.
Accounts
| Account | Writable | Signer | Notes |
|---|---|---|---|
payer | yes | yes | The fee payer: the relayer for a relayed spend, or the holder's wallet. |
config | The program Config. | ||
policy | What the proof is checked against: the chosen set's Asp account in transact, the DepositTree in ragequit. | ||
destination | yes | The deposit address (register_venue) or the withdrawal's destination (transact). For a private transfer, any account the intent names. | |
venue | The Venue account for the destination. In transact it is passed even when no venue is registered there. | ||
recipient | yes | The fee recipient from Config. | |
payout | yes | Plaza's payout escrow. SPP releases a withdrawal here; Plaza pays it out in the same instruction. | |
ring_auth | Plaza's ring authority, owned by SPP. Plaza signs SPP calls with it. | ||
spp | The Solana Privacy Program. Fixed: ring1GaLCuJnkUMVkX2JeZLTTX17wKsV4fZmPVzXANW. | ||
system_program | The system program. Fixed: 11111111111111111111111111111111. | ||
event_authority | Anchor's event authority, for events emitted by self-CPI. | ||
program | The Plaza program. |
Discriminator [142, 182, 225, 76, 251, 128, 172, 31]. Raises InvalidWire, RootOutsideWindow, InvalidBinding, InvalidProof, InvalidSettlement.
Argument types
PolicyProof
A Groth16 proof over BN254 with its public signals.
a[u8; 64]- The proof's A point.
b[u8; 128]- The proof's B point.
c[u8; 64]- The proof's C point.
signals[[u8; 32]; 7]- The seven public signals, 32 bytes big-endian each, in the order on Circuits.
DepositOrigin
The public facts of a deposit that, with the destination and mint, rebuild its label.
amountu64- Base units.
slotu64- The slot the deposit executed in.
nonceu64- The deposit counter it used.