Documentation

Everything you need to know about Skaf's PDA design tools.

$ Getting Started

What is Skaf?

Skaf is a PDA (Program Derived Address) design simulator for Solana. It lets you visually design account structures, check for seed collisions, simulate write-lock contention, and generate production-ready Anchor code — all before writing a single line of on-chain code.

Who is it for?

  • >Solana developers designing account architectures
  • >Protocol architects planning PDA seed structures
  • >Auditors reviewing existing program account layouts
  • >Teams migrating or refactoring on-chain programs
[i]
No signup required. All core tools (PDA Designer, Rent Calculator, Code Generator) are available for free. Just open skaf.fun/designer and start building.

Quick start

1
Go to /designer
2
Enter a Solana program ID (or use the default)
3
Add PDA accounts and configure seeds
4
Run collision checks with "Check All"
5
Export generated Anchor code

# PDA Designer

The visual PDA designer is the core of Skaf. It provides a canvas-based interface for designing Solana account structures with drag-and-drop seed management.

Adding a PDA

1
Click the + Add PDA button in the top toolbar
2
The new PDA node appears at the center of your current viewport
3
Click on the PDA node to select it and open the Properties Panel on the right

Configuring seeds

Each PDA can have multiple seeds. In the Properties Panel, click "Add Seed" to add one. Available seed types:

literal

Fixed byte string

string

Dynamic string value

pubkey

32-byte public key

u8

1-byte unsigned int

u16

2-byte unsigned int

u32 / u64

4 or 8-byte unsigned int

Canvas controls

  • PanClick and drag on empty canvas area
  • ZoomMouse wheel or pinch gesture
  • SelectClick on a node
  • Multi-selectShift + click multiple nodes
  • DeleteSelect a PDA, then click the delete button on the node header or Properties Panel

! Collision Check

Collision checking verifies that none of your PDA seed combinations produce overlapping on-chain addresses. Skaf cross-checks every combination across your entire design.

How to run

1
Add at least 2 PDA accounts in the designer
2
Click Check All in the bottom toolbar
3
Results appear in the collision panel at the bottom of the screen

Reading results

Each PDA account gets a status card showing its derived address and check result. Node borders on the canvas also update to reflect the status:

SafeNo collision detected. Address is unique across all seeds.
CollisionThis PDA shares a derived address with another account. Seed redesign needed.
UncheckedNot yet checked. Click 'Check All' to validate.
[i]
The collision checker uses the actual Solana PDA derivation engine (solders) on the backend — not a client-side approximation. Results match what you'd get on devnet/mainnet.

> Code Export

Skaf generates production-ready Anchor code from your PDA design, including account structs with seeds constraints and instruction context boilerplate.

How to export

1
Select a PDA account in the designer
2
Open the Properties Panel (right side)
3
Click Generate Code
4
Review the generated Anchor struct, seeds constraint, and instruction context
5
Copy individual sections or download the full snippet

Generated output

The code generator produces four sections:

>
Account StructThe #[account] struct with field definitions
>
Seeds ConstraintThe seeds = [...] and bump constraint for #[derive(Accounts)]
>
Instruction ContextThe full #[derive(Accounts)] struct ready to paste into your program
>
Full SnippetAll of the above combined into a single copy-paste block
#[account]
pub struct UserPosition {
    pub authority: Pubkey,
    pub amount: u64,
    pub bump: u8,
}

#[derive(Accounts)]
pub struct CreatePosition<'info> {
    #[account(
        init,
        payer = authority,
        space = 8 + 32 + 8 + 1,
        seeds = [b"position", authority.key().as_ref()],
        bump,
    )]
    pub position: Account<'info, UserPosition>,
    #[account(mut)]
    pub authority: Signer<'info>,
    pub system_program: Program<'info, System>,
}

% Rent Calculator

Every Solana account requires a minimum balance to be rent-exempt. Skaf calculates the exact SOL cost based on the account's data size.

How it works

1
Select a PDA in the designer
2
In the Properties Panel, set the "Space" value (in bytes)
3
The rent cost in SOL and lamports updates automatically

Space calculation

The total account size = 8 bytes (Anchor discriminator) + your data fields. Common field sizes:

Pubkey32B
u648B
u324B
u8 / bool1B
i648B
String(n)4 + nB
Vec<T>(n)4 + n*TB
Option<T>1 + TB
[i]
Rent is calculated using the same formula as Solana mainnet. The minimum balance for rent exemption = (account size + 128) * 6.96 lamports/byte/year * 2 years.

< IDL Reverse Engineer

Analyze any deployed Solana program by its ID. Skaf fetches the on-chain IDL, parses account structures, and maps the entire PDA topology into a readable graph.

How to use

1
Go to /reverse
2
Paste a deployed program ID (e.g., Raydium AMM, Orca Whirlpool, Marinade)
3
Skaf queries the on-chain IDL account and parses it automatically
4
View the full account hierarchy, seed structures, and PDA topology
5
Optionally load the result into the PDA Designer for further editing

Use cases

  • >Auditing existing programs — understand account layout at a glance
  • >Migration planning — visualize old structure before designing the new one
  • >Learning — study how top Solana protocols structure their PDAs
  • >Documentation — generate visual account maps for your team
[i]
The program must have an on-chain IDL (deployed via anchor idl init). If no IDL is found, Skaf will notify you. Most major Anchor-based protocols have published IDLs.

~ Lock Analysis

Lock Analysis simulates Solana's Sealevel write-lock behavior against your PDA design. It runs 100 concurrent transactions and shows per-account contention scores, identifying bottlenecks before you deploy.

How to run

1
Open the designer and add at least 2 PDA accounts
2
Click Lock Analysis in the toolbar
3
Skaf auto-generates two scenarios: all-writable (worst case) and first-read-only (common pattern)
4
Results appear as per-account risk cards in the analysis panel

Reading results

Each account card displays:

  • >Color-coded risk bar (green → yellow → red)
  • >Read count vs. write count from the simulation
  • >Contention score as a percentage (0-100%)
  • >Risk level: low / medium / high / critical
  • >Bottleneck flag — whether this account serializes transactions

Optimization strategies

[#]
Account Sharding

Split hot accounts into N partitions

[U]
Per-User PDAs

Derive unique PDA per user wallet

[T]
Epoch Rotation

Rotate accounts by time window

[R]
Read-only Separation

Separate config from mutable state

[i]
For a deep dive into how Solana account locks work, including visual scenarios, case studies, and before/after comparisons, visit the Lock Analysis guide.

* Token Tiers

Most Skaf features are free. Holding $SKAF tokens unlocks higher limits and premium features. Connect your Solana wallet to check your tier automatically.

Tier breakdown

Free0 $SKAF
> Visual PDA builder> Rent calculator> Code generator> 3 collision checks/day
Basic100+ $SKAF
> Unlimited collision checks> 5 saved designs> Code export
Pro1,000+ $SKAF
> Full suite access> Unlimited saves> Lock Analysis
Elite10,000+ $SKAF
> Everything in Pro> Priority new features> Early access
Whale100,000+ $SKAF
> All Elite benefits> Direct feature requests> Premium support

Connecting your wallet

1
Click Connect Wallet in the header
2
Approve the connection in your Solana wallet (Phantom, Solflare, etc.)
3
Your $SKAF balance is checked automatically and your tier is applied
[i]
Token balances are checked in real time. If you acquire more $SKAF tokens, your tier upgrades automatically on the next page load — no manual action needed.

Ready to build?

Design your PDA structure, validate it, and export production-ready code.