Home/Docs/Recipe Book/Accounts & PDAs

On-chain account structure and PDA derivation.

Accounts & PDAs

RecipeBook account

One per deployed program.

FieldTypeDescription
target_program_idpubkeyThe program this RecipeBook tracks
authoritypubkeyWho initialized it
entry_countu64Total deploy entries
bumpu8PDA bump

PDA seeds

["recipe_book", target_program_id]

Derivation

typescript
PublicKey.findProgramAddressSync(
  [Buffer.from("recipe_book"), targetProgramId.toBuffer()],
  RECIPE_BOOK_PROGRAM_ID
)

Entry account

One per deploy.

FieldTypeDescription
recipe_bookpubkeyParent RecipeBook
indexu640-indexed deploy number
repostringGit remote URL or short name
commitstringGit commit SHA
build_hash[u8; 32]SHA-256 of compiled binary
bufferpubkeyBuffer program account
deployerpubkeyWallet that deployed
timestampi64Unix timestamp
bumpu8PDA bump

PDA seeds

["entry", recipe_book_pubkey, entry_index_le_bytes]

Derivation

typescript
const indexBuf = Buffer.alloc(8);
indexBuf.writeBigUInt64LE(index);

PublicKey.findProgramAddressSync(
  [Buffer.from("entry"), recipeBookPubkey.toBuffer(), indexBuf],
  RECIPE_BOOK_PROGRAM_ID
)

Relationships

RecipeBook (1)
    โ””โ”€โ”€ Entry (many)
        โ”œโ”€โ”€ Entry #0
        โ”œโ”€โ”€ Entry #1
        โ””โ”€โ”€ Entry #2

Each RecipeBook tracks one target program. Each Entry is a single deploy event.

IDL

The IDL is at lib/idl/recipe_book.json in the dashboard repo โ€” hand-verified against the deployed program. Do not auto-generate a replacement.

Sourced from local MDX in docs/content/docs