API reference
Instructions, the Step shape, and the plan wire format.
The full instruction and type surface exposed by the client. Program id on devnet:
A2kR2uTGLYfCqimqF4piRDh7aHfLRDf4gBg8LvmfMLrzInstructions
The program exposes two instructions. Both use the Anchor global namespace discriminator. The account order below is the exact order the client builds in ptbvm.ts; writability is marked w.
| Instruction | Accounts (in order) | Data |
|---|---|---|
| init_registers | registers PDA (w), payer (signer, w), system program | disc("global", "init_registers") (8 bytes, no args) |
| execute | registers PDA (w), authority PDA (w), payer (signer, w), then every pooled account in intern order (each w if any step needs it writable) | disc("global", "execute") + the serialized plan (see the wire format below) |
Discriminators
Both instructions use an 8-byte discriminator derived from the Anchor namespace: the first 8 bytes of sha256("global:<name>"). The client exposes disc("global", name) to build them, and u64le(n) to encode a little-endian u64 argument.
Plan wire format
compile() serializes the plan after the execute discriminator as:
u32 stepCount
repeat per step:
u16 programIndex
u32 accountCount
repeat per account:
u8 source // 0 Pool, 1 Register, 2 Authority
u16 index
u8 isSigner
u8 isWritable
u32 dataLen
bytes data
u32 spliceCount
repeat per splice:
u16 offset
u8 register
u8 width
u8 captureInto? // 0 = none, else 1 + slot
u8 capturePubkey
u8 signed
u8 obligation // 0 None, 1 Open, 2 Close
u64 obligationTagAccount sources
| Field | Type | Note |
|---|---|---|
| Pool (0) | fixed pubkey | A concrete account, interned into the account pool by index. |
| Register (1) | captured pubkey | An account whose pubkey a prior step captured into a register. |
| Authority (2) | authority PDA | The plan's authority PDA, used when a step is signed. |
In this section
- Error reference: Every failure mode and what triggers it.
- Limits: The achievable subset: what pipes, what does not, and why.