SPL Token Wrap: bridge Token and Token-2022 without a new asset story
solana-program/token-wrap is the official SPL program that creates 1:1 wrapped mints between SPL Token and Token-2022 (either direction), with escrow backing, backpointer PDAs, confidential transfer defaults, transfer-hook compatibility, and metadata sync. Program id, ops, and when to fork.
devrels.xyz/a/219short linkIf you already know “wrap SOL → wSOL,” park that. solana-program/token-wrap is a different primitive: an official SPL Token Wrap program that mints a 1:1 wrapped version of an existing mint so you can move between SPL Token and SPL Token-2022 (including Token-2022 ↔ Token-2022) and pick up extension features without migrating the original mint’s holders overnight.
Repo blurb: if you wish your mint could use the latest features of a specific token program, this might be for you. Docs/SDK: solana-program.com/docs/token-wrap.
Program identity
| Item | Value |
|---|---|
| Program ID | TwRapQCDhWkZRrDaHfZGuHxkZ91gHDRkyuzNqeU5MgR |
| IDL | idl.json in the repo |
| JS client | @solana-program/token-wrap (npm) |
| CLI | spl-token-wrap-cli (crates.io) |
| License | Apache-2.0 |
| Audits | Zellic (2025-05), Runtime Verification (2025-06, 2025-10) — PDFs under anza-xyz/security-audits |
Problem it solves
Token-2022 extensions (confidential transfers, transfer hooks, metadata extensions, etc.) live on mints owned by Token-2022. Classic SPL Token mints cannot “turn on” those extensions in place. Venues and wallets also still assume classic Token in places.
Token Wrap gives you a paired mint: deposit unwrapped tokens into program escrow, receive the same amount of wrapped mint; burn wrapped to withdraw unwrapped. Interoperability without a bridge or a rebranded asset with unclear backing — the backing is the escrow.
How it works
CreateMint
- Creates a wrapped mint (Token or Token-2022) whose address is a PDA derived from the unwrapped mint and the wrapped token program id — deterministic 1:1 relationship.
- Mint authority is a PDA controlled by Token Wrap.
- Creates a backpointer account (PDA from the wrapped mint) storing the original unwrapped mint so anyone can reverse-resolve.
- Caller must pre-fund rent lamports (avoids needing writer+signer on every funding path).
- Extensible via a
MintCustomizertrait if you fork — add extensions, change freeze authority defaults, decimals, etc.
Wrap
- Transfer unwrapped tokens into an escrow token account (owner = wrap PDA).
- Mint the same amount of wrapped tokens to the user.
Unwrap
- Burn wrapped tokens.
- Release the same amount of unwrapped tokens from escrow.
CloseStuckEscrow
Edge case when an unwrapped mint with MintCloseAuthority is closed and recreated at the same address with different extensions — escrow ATA can be incompatible. Closes zero-balance stuck escrow and returns lamports; client must recreate the ATA correctly.
Metadata sync
SyncMetadataToToken2022— copy metadata onto wrapped Token-2022TokenMetadataextension (init if needed; pre-fund rent).SyncMetadataToSplToken— copy onto Metaplex metadata for wrapped classic SPL mints (create/update; wrap mint authority PDA pays Metaplex CPI — pre-fund).
unwrapped mint ──CreateMint──► wrapped mint (PDA) + backpointer (PDA)
│ │
│ Wrap: transfer to escrow │ mint wrapped 1:1
│ Unwrap: burn wrapped │ release escrow 1:1
▼ ▼
user unwrapped ATA user wrapped ATAPermissionless — with freeze preserved
Anyone can CreateMint (pay rent) and anyone holding unwrapped can Wrap / Unwrap. No whitelist. If the unwrapped mint has a freeze authority, that freeze authority is preserved on the wrapped side — wrapping is not a freeze escape hatch.
Confidential transfers by default (Token-2022 wraps)
Every Token-2022 wrapped mint includes ConfidentialTransferMint configured as:
- No authority — config immutable (privacy features can’t be turned off later by an admin key)
- No auditor — no third party configured to view confidential transfer details
- Automatic account approval — new accounts approved for confidential transfers by default
Transfer-hook–enabled unwrapped tokens are supported; multisig signers work on wrap/unwrap.
When you’d use it
- Ship Token-2022 features (e.g. confidential transfer option) for liquidity that still lives on a classic mint
- Integrate a Token-2022–only venue while your treasury mint is classic SPL (or the reverse)
- Normalize extension sets across two Token-2022 mints via a wrap pair
- Keep a clear, auditable 1:1 escrow story instead of a custom “wrapper token” program
Not for: wrapping native SOL (use wSOL /SyncNative); bridging to Ethereum; inventing yield-bearing receipts with different economics — this program is strict 1:1 escrow.
When to fork
Upstream says: if default wrapped mint config doesn’t fit, fork and implement MintCustomizer, swap it in the processor, re-test, and update CLI/JS mint size assumptions. Don’t expect every extension combo on the public deployment without reading the default customizer.
Builder checklist
- Confirm program id on your cluster matches docs/IDL.
- Pre-fund PDAs/mints for rent before CreateMint / metadata sync.
- Derive wrapped mint + backpointer PDAs; don’t invent addresses.
- Handle freeze: frozen unwrapped ⇒ frozen economics on wrapped.
- If mint can be closed/recreated, know
CloseStuckEscrow. - Sync metadata so explorers/wallets show the right name/symbol.
- Prefer audited commit pins from the README table for production reviews.
# Explore clients (see repo for current versions)
# npm: @solana-program/token-wrap
# cargo: spl-token-wrap-cli
# docs: https://www.solana-program.com/docs/token-wrap
# idl: https://github.com/solana-program/token-wrap/blob/main/idl.jsonRelated
- github.com/solana-program/token-wrap
- Token-2022 extension field guide (on DevRels if present in library)
- Native SOL ↔ wSOL is a different wrap path — don’t mix the names in UX copy
Summary
SPL Token Wrap (TwRapQCDhWkZRrDaHfZGuHxkZ91gHDRkyuzNqeU5MgR) is the permissionless Solana program for 1:1 wrapped mints across Token and Token-2022, with escrow backing, backpointers, metadata sync, transfer-hook and multisig support, and confidential-transfer defaults on Token-2022 wraps. Use it when extension interoperability is the product requirement; use wSOL when the asset is native SOL; fork when you need a different mint customizer than mainnet defaults.
Keep reading
One SPL approve per mint, many limited pull permissions on top — fixed caps, recurring allowances, and real subscription billing without signing every charge.
First non-EVM chain for 0x Swap API. Instructions-only design so Solana apps keep control of CU, priority fees, and landing.
Two products for bringing assets on-chain: Token Tool to deploy and manage tokens without writing Solidity/Rust, and Offering Manager to run the full investor primary market.
Get new articles in your inbox
Technical deep-dives on Solana tooling, infrastructure, and ecosystem. No noise.
