P76 BATCH LAB

inspect any batch(0xFF) tx

the canonical reference for the p-token batch instruction wire format. live size + CU calculator. decoder. worked example from $76 genesis tx. measured numbers only.

← FACTORY
SIZE CALCULATOR

live numbers from the day 5 devnet benchmark. drag to see how the tx scales. the binding constraint is tx size, not CU.

5
1max safe: 11 (size-bound)30
TX SIZE
763 B
limit 1232
CU TODAY (legacy ATA)
82,970
of 1,400,000
CU WITH P-ATA (est)
20,400
80.9% off
WORKED EXAMPLE: $76 GENESIS

12 bytes that minted $76. fetched, decoded, annotated. the batch encoder in lib/batch.ts ships this exact format.

FF03090700AB870400000000
byte 0BATCH DISC0xFF = process_batch
byte 1NUM_ACCS3 accounts: mint, dest_ata, mint_authority
byte 2IX_LEN9 bytes follow
byte 3INNER DISC0x07 = MintTo
byte 4-11AMOUNT u64 LE0x04 87 AB 00 = 76,000,000
DECODED BY @P76/BATCH-SDK
{
  "innerInstructions": [
    {
      "numAccounts": 3,
      "discriminator": "0x07",
      "dataHex": "07 00 AB 87 04 00 00 00 00"
    }
  ]
}
verify on-chain: 5cqt7QpW...wJP2iW8 →
DECODER

paste any batch(0xFF) instruction data (hex). returns the decoded inner instructions via @p76/batch-sdk.

WIRE FORMAT

the layout that p-token process_batch parses. identical to docs/BATCH_FORMAT.md in this repo.

[0xFF]                          // batch discriminator
[n_accounts: u8] [data_len: u8] // inner 1 header
[data ...data_len bytes]        // inner 1 data (byte 0 = p-token disc)
[n_accounts: u8] [data_len: u8] // inner 2 header
[data ...]                      // inner 2 data
...                             // loop until bytes exhausted

inner discriminators are dispatched inside p-token (Transfer, MintTo, Burn, Initialize, etc.). cross-program CPI is not possible — CreateAssociatedTokenAccount lives in the ATA program, not p-token.

ownership pre-checks fire for selected discriminators (3/7/8/12/14/15 and 4-13/22/38/45) because the runtime owner check only runs after the outer tx.

u8 limits: max 255 accounts per inner, max 255 bytes per inner data. ample for normal token ops.

LIBRARY

this whole page is powered by @p76/batch-sdk: encoder, decoder, types. use it in your own project:

npm install @p76/batch-sdk

import { encodeBatchData, decodeBatchData } from '@p76/batch-sdk';

const encoded = encodeBatchData([
  { numAccounts: 3, data: new Uint8Array([0x07, ...amountLE]) },
]);