Skip to content
Open app

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.

InstructionSignersCompute units
initadmin
set_feeadmin
register_aspauthority13,937
publish_rootauthority15,495 to 22,967
clear_rootsauthority21,896
register_venueauthority, destination13,216
set_acceptedauthority
depositdepositorSOL 94,058; SPL 96,812
transactpayertransfer SOL 283,593, SPL 281,247; withdrawal SOL 258,703, SPL to a venue 274,006
ragequitpayerSOL 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

AccountWritableSignerNotes
adminyesyesThe admin key. Fixed: 9yabAfpdfa9eRBwUT2mcezJQLkBVuN14ZJXc9uKbvAbi.
configyesThe program Config.
treeyesThe DepositTree.
ring_authyesPlaza's ring authority, owned by SPP. Plaza signs SPP calls with it.
protocolSPP's protocol configuration. Fixed: EienwBSpsbAetT3RAAMzVA9rB5RHgCF7yTH7FFST6AK5.
sppThe Solana Privacy Program. Fixed: ring1GaLCuJnkUMVkX2JeZLTTX17wKsV4fZmPVzXANW.
system_programThe system program. Fixed: 11111111111111111111111111111111.
event_authorityAnchor's event authority, for events emitted by self-CPI.
programThe 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

AccountWritableSignerNotes
adminyesThe admin key.
configyesThe program Config.
event_authorityAnchor's event authority, for events emitted by self-CPI.
programThe 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

AccountWritableSignerNotes
authorityyesyesThe ASP's or venue's authority.
aspyesThe Asp account.
system_programThe system program. Fixed: 11111111111111111111111111111111.
event_authorityAnchor's event authority, for events emitted by self-CPI.
programThe 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 RootPublished and doesn't check it.
manifest_hash[u8; 32]required
A hash of the manifest the root is published under.

Accounts

AccountWritableSignerNotes
authorityyesThe ASP's or venue's authority.
configThe program Config.
aspyesThe Asp account.
event_authorityAnchor's event authority, for events emitted by self-CPI.
programThe 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

AccountWritableSignerNotes
authorityyesThe ASP's or venue's authority.
configThe program Config.
aspyesThe Asp account.
event_authorityAnchor's event authority, for events emitted by self-CPI.
programThe 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

AccountWritableSignerNotes
authorityyesyesThe ASP's or venue's authority.
destinationyesThe deposit address (register_venue) or the withdrawal's destination (transact). For a private transfer, any account the intent names.
venueyesThe Venue account for the destination. In transact it is passed even when no venue is registered there.
system_programThe system program. Fixed: 11111111111111111111111111111111.
event_authorityAnchor's event authority, for events emitted by self-CPI.
programThe 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

AccountWritableSignerNotes
authorityyesThe ASP's or venue's authority.
venueyesThe Venue account for the destination. In transact it is passed even when no venue is registered there.
event_authorityAnchor's event authority, for events emitted by self-CPI.
programThe 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

AccountWritableSignerNotes
depositoryesyesThe wallet depositing. It pays and signs.
configyesThe program Config.
treeyesThe DepositTree.
ring_authPlaza's ring authority, owned by SPP. Plaza signs SPP calls with it.
system_programThe system program. Fixed: 11111111111111111111111111111111.
event_authorityAnchor's event authority, for events emitted by self-CPI.
programThe 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

AccountWritableSignerNotes
payeryesyesThe fee payer: the relayer for a relayed spend, or the holder's wallet.
configThe program Config.
policyWhat the proof is checked against: the chosen set's Asp account in transact, the DepositTree in ragequit.
destinationyesThe deposit address (register_venue) or the withdrawal's destination (transact). For a private transfer, any account the intent names.
venueThe Venue account for the destination. In transact it is passed even when no venue is registered there.
recipientyesThe fee recipient from Config.
payoutyesPlaza's payout escrow. SPP releases a withdrawal here; Plaza pays it out in the same instruction.
ring_authPlaza's ring authority, owned by SPP. Plaza signs SPP calls with it.
sppThe Solana Privacy Program. Fixed: ring1GaLCuJnkUMVkX2JeZLTTX17wKsV4fZmPVzXANW.
system_programThe system program. Fixed: 11111111111111111111111111111111.
event_authorityAnchor's event authority, for events emitted by self-CPI.
programThe 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: root is the deposit tree's current root or one in its recent list, and exitLabel is the label.
wirebytesrequired
SPP's transact instruction data for a full withdrawal with no outputs.
originDepositOriginrequired
The deposit's amount, slot and nonce, from its Deposited event.

Accounts

AccountWritableSignerNotes
payeryesyesThe fee payer: the relayer for a relayed spend, or the holder's wallet.
configThe program Config.
policyWhat the proof is checked against: the chosen set's Asp account in transact, the DepositTree in ragequit.
destinationyesThe deposit address (register_venue) or the withdrawal's destination (transact). For a private transfer, any account the intent names.
venueThe Venue account for the destination. In transact it is passed even when no venue is registered there.
recipientyesThe fee recipient from Config.
payoutyesPlaza's payout escrow. SPP releases a withdrawal here; Plaza pays it out in the same instruction.
ring_authPlaza's ring authority, owned by SPP. Plaza signs SPP calls with it.
sppThe Solana Privacy Program. Fixed: ring1GaLCuJnkUMVkX2JeZLTTX17wKsV4fZmPVzXANW.
system_programThe system program. Fixed: 11111111111111111111111111111111.
event_authorityAnchor's event authority, for events emitted by self-CPI.
programThe 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.