Token-2022 Malicious TransferHook Detector: Auditing Custom CPI Sell-Blockers at the Byte Level
Solana's Token-2022 program (TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb) introduced Extension Type 14 (TransferHook), enabling arbitrary external program execution on every single token transfer—and handing scammers EVM-grade programmable honeypots on Solana. Attackers deploy custom hook CPIs that whitelist AMM vault buys while reverting every retail wallet sell, or hot-swap dormant hook program IDs mid-pump via active hook authorities. Solana Rent & Rug Shield deploys live Layer-10 TLV byte inspection inside our 11-Layer Block-0 Jito/Sybil defense to stop TransferHook traps missed by RugCheck, SolSniffer, and GoPlus, while recovering 2,039,280 lamports (0.00203928 SOL) per empty ATA at 0% 1st-claim fee versus Sol Incinerator (~2%) and ClaimYourSol (5%), plus a 30% ?ref= split.
Bundled Rug Loss Prevention + Dead ATA Rent Recovery Estimator
Estimate how much SOL our 11-Layer Block-0 Jito/Sybil & Token-2022 TLV Shield saves per month compared to relying on RugCheck, SolSniffer, or GoPlus — plus instant 0%-fee 1st-claim recovery (2,039,280 lamports = 0.00203928 SOL per dead ATA).
Byte-Level Mechanics of Token-2022 Extension Type 14 (TransferHook) Sell-Blockers
Every Token-2022 mint with extensions pads its legacy header out to offset 165 (where AccountType == 0x01 denotes Mint) and appends sequential Type-Length-Value records starting at byte 166. When ExtensionType::TransferHook (u16 little-endian 0x0e00, payload length 64 bytes / 0x4000) is present, the runtime stores two 32-byte OptionalNonZeroPubkey fields: authority (bytes 0..31) and program_id (bytes 32..63). On every TransferChecked call, Token-2022 sets the TransferHookAccount.transferring byte on source and destination accounts, resolves supplementary accounts from the ExtraAccountMetaList PDA seeded by ['extra-account-metas', mint_pubkey], and invokes the external hook program's Execute instruction (Anchor discriminator 105, 37, 101, 197, 75, 251, 102, 26).
Malicious hook authors exploit that mandatory CPI callback in two lethal ways. First, the hook's Execute handler compares the transfer's source_token_account against the AMM pool vault: when source equals the Raydium or Meteora vault (a retail buy), the CPI returns Ok(()); when destination equals the pool vault and owner is not on the deployer's Sybil allowlist (a retail sell), it throws ProgramError::Custom and aborts the swap. Second, an attacker launches with program_id set to all zeroes—passing superficial scanners—while keeping authority active, then fires TransferHookInstruction::Update ([0x24, 0x01]) mid-rally to attach a sell-blocking program instantly.
Program Owner : TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb Mint Buffer : 234 Bytes Total (82B Base + 83B Pad + 1B Type + 68B TLV) Offset [000..082] : Base Mint Struct (mint_authority=None, freeze_authority=None) Offset [082..165] : Zero Padding (83 bytes -> 0x00...00) Offset [165] : 0x01 (AccountType::Mint) Offset [166..168] : 0x0e00 (u16 LE = 14 -> ExtensionType::TransferHook) Offset [168..170] : 0x4000 (u16 LE = 64 -> Value Payload Length) Offset [170..202] : authority = 8kPv3mNx...2qWr9tYb (NON-ZERO -> Hot-Swap Trap!) Offset [202..234] : program_id = HookTrap11...7zLm4vQa (Custom Unverified CPI) Layer-10 + Layer-7 Combined Verdict: ExtraAccountMetaList PDA : Found (3 Dynamic Whitelist Accounts Injected) Simulated Retail Sell : REVERTED (Custom Hook Error 0x1771 on Execute) Action : CRITICAL_BLOCK (Mutable TransferHook Honeypot)
Lamport & EV Forensics: Hook-Extended ATA Rent Costs & Zero-Fee Cleanup Math
Token-2022 TransferHook honeypots inflict a double penalty on unsuspecting traders: 100% of invested SOL principal is trapped inside an unsellable position, AND every Token-2022 Associated Token Account created for a hooked mint requires extra on-chain byte allocation beyond standard 165-byte SPL accounts. Specifically, a Token-2022 ATA initialized for a TransferHook mint appends 1 byte for AccountType (0x02), 4 bytes for ExtensionType::ImmutableOwner (type 7, length 0), and 5 bytes for ExtensionType::TransferHookAccount (type 15, length 1 boolean transferring flag)—expanding total account size to 175 bytes and locking (128 + 175) * 6,960 = 2,108,880 lamports.
Blocking just one 3.0 SOL buy into a staged TransferHook rug preserves 3,000,000,000 lamports—more than enough to cover 60x a $49.99 API/Pro pass ($0 auto-billing). Meanwhile, for wallets cluttered with legacy 165-byte SPL ATAs (2,039,280 lamports each) and zero-balance Token-2022 ATAs (2,074,080 to 2,157,600+ lamports each) where transfers remain unblocked, Solana Rent & Rug Shield routes native 0x09 CloseAccount instructions to the exact owning token program ID with a 0% 1st-claim fee, beating Sol Incinerator (~2%–5%) and ClaimYourSol (5%) while paying 30% ?ref= SOL rewards.
Solana Mainnet Rent Formula: (128 overhead + data_len) * 6,960 lamports/byte Standard SPL ATA (165B) : 293 * 6,960 = 2,039,280 lamports (0.00203928 SOL) Token-2022 ImmutableOwner ATA (170B): 298 * 6,960 = 2,074,080 lamports (0.00207408 SOL) Token-2022 TransferHook ATA (175B) : 303 * 6,960 = 2,108,880 lamports (0.00210888 SOL) Token-2022 Fee + Hook ATA (187B) : 315 * 6,960 = 2,192,400 lamports (0.00219240 SOL) Mixed 60-ATA Wallet Cleanup (40 SPL @ 165B + 20 Token-2022 @ 175B): Total Gross Locked SOL : 123,748,800 lamports (0.12374880 SOL) ClaimYourSol (5% Fee) : 117,561,360 lamports (-6,187,440 lamports lost) Rent & Rug Shield (0% 1st Claim) : 123,748,800 lamports (100% returned to owner)
11-Layer TLV Byte Defense vs RugCheck, SolSniffer & GoPlus Cache Blindness
Most retail scanners were architected for legacy 82-byte Tokenkeg mints and bolt on partial Token-2022 warnings via delayed indexers. Two fatal gaps emerge in live adversarial launches: first, when an attacker deploys ExtensionType::TransferHook with program_id initialized to zero bytes and mint/freeze authorities revoked, superficial checklists label the hook inactive while overlooking the non-zero authority pubkey at TLV bytes [0..31] waiting to execute Update ([0x24, 0x01]). Second, cached REST endpoints on SolSniffer, RugCheck, and GoPlus lag 30 to 180 seconds behind on-chain state transitions—an eternity when a Jito bundle flips the hook program and drains buyers in 400ms.
Solana Rent & Rug Shield's Layer-10 engine fetches raw binary Mint data directly from low-latency mainnet RPC nodes in under 120ms, walks every TLV header from offset 166 to EOF, flags any mutable TransferHook authority as an immediate hot-swap threat, and hands off active hook program IDs to Layer-7 and Layer-9 for live retail-wallet sell simulation. Combined with Layer-11 Block-0 Sybil ancestry tracking, you never sign blind into programmable Token-2022 sell-locks.
Token-2022 TransferHook Auditing: Layer-10 Shield vs Legacy Tools
| Dimension | Solana Rent & Rug Shield | Sol Incinerator / ClaimYourSol | RugCheck / SolSniffer / GoPlus |
|---|---|---|---|
| TLV Offset [166+] Byte Walk | Live <120ms binary decode of Type 14 authority & program_id | No pre-buy Token-2022 mint TLV scanner | Cached indexer summaries lag 30-180s behind Update flips |
| Dormant Hook Authority Trap | Flags non-zero authority even when program_id == 0x00..00 | Zero authority-mutation risk modeling | Often marks zeroed program_id safe despite active authority |
| Hook Execute Sell Simulation | Simulates non-whitelisted EOA sell through ExtraAccountMetas | No swap or hook CPI simulation | Static extension flag cannot test dynamic PDA allowlists |
| Dual-Program ATA Rent Sweep | Closes both Tokenkeg (2,039,280) & TokenzQd (2,108,880+) ATAs | Charges ~2% to 5% fee on every SPL & Token-2022 close | No wallet rent reclamation engine |
| 1st-Claim Platform Fee | 0% fee — 100% of recovered lamports stay in your wallet | Deducts ~2% (Sol Incinerator) or 5% (ClaimYourSol) | N/A (read-only contract viewer) |
| Pass Terms & ?ref= Payout | 24h / 30-Day / Monthly ($0 auto-billing) + 30% ?ref= split | No x402 / sniper gate API; lower affiliate splits | Recurring SaaS plans with zero instant SOL referral payouts |
4-Step Playbook: Detect TransferHook Traps & Reclaim Token-2022 Rent
Step 1: Verify Mint Program ID & Layer-10 TLV Extensions
Paste the token mint into the 11-Layer scanner. Layer-10 immediately detects whether the mint belongs to TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb and decodes every TLV record from byte offset 166 onward.
Step 2: Reject Mutable Hook Authorities or Unverified Hook CPIs
Check the TransferHook authority and program_id fields. Block entry immediately if authority is non-zero (hot-swap risk) or if Layer-7 simulated retail selling reverts inside the hook's Execute CPI.
Step 3: Scan Dual-Program Wallets for Zero-Balance ATAs
Connect your wallet to enumerate empty 165-byte SPL accounts (2,039,280 lamports) alongside 170-to-187-byte Token-2022 accounts while isolating any hook-blocked or frozen traps.
Step 4: Execute 0%-Fee First Claim & Activate 30% ?ref= Rewards
Approve the unsigned CloseAccount transaction in your wallet to pocket 100% of your first rent recovery, and share your ?ref= link to earn 30% instant SOL commissions.
Frequently Asked Questions
Every TransferChecked instruction on a hooked Token-2022 mint invokes the external hook program's Execute instruction along with ExtraAccountMetaList PDAs. A malicious hook checks whether the source token account is the AMM liquidity vault—returning success on buys from the pool, but throwing a custom error whenever a retail wallet tries to transfer tokens back to the pool.
A developer cannot append ExtensionType 14 after mint initialization, but they CAN initialize ExtensionType 14 at launch with program_id set to zeroes and keep the 32-byte authority active. Later, calling TransferHookInstruction::Update ([0x24, 0x01]) swaps in a hostile hook program in one slot. Layer-10 flags any non-zero hook authority immediately.
Standard 165-byte SPL accounts lock (128 + 165) * 6,960 = 2,039,280 lamports. Token-2022 ATAs add 1 AccountType byte plus TLV headers like ImmutableOwner (4B) and TransferHookAccount (5B), reaching 175 bytes or 2,108,880 lamports—all 100% recovered on your 0%-fee 1st claim.
No! In spl-token-2022, the CloseAccount (0x09) instruction only verifies that token amount equals zero (and withheld fees equal zero) without invoking the external TransferHook Execute CPI, because no token transfer occurs when reclaiming account lamports.
Institutional Pricing Ladder ($0 Free 1st Claim + $19.99 / $49.99 / $99 / $500 Passes)
Free 1st Claim & 24h Trench Pass
Keep 2,039,280 / 2,039,280 lamports (0.00203928 SOL) on your first wallet claim vs Sol Incinerator ~2% and ClaimYourSol 5%. Extra single 11-Layer scan: $0.10. 24h Trench Pass: $1.99.
30-Day Trader Pro
Unlimited Web & Telegram 11-Layer pre-buy audits including Layer-11 Block-0 Jito/Sybil Cluster Defense, beating RugCheck, SolSniffer, and GoPlus.
30-Day Ultra Pro + Sniper Bot API
15,000 API calls/mo ($0.0033/call) + real-time Rug Webhooks + Layer-11 Block-0 Sybil & Token-2022 TLV flags for automated trading bots.
30-Day Quant Desk Pro API
100,000 API calls/mo ($0.00099/call), <120ms Priority SLA + Batch Sybil funding graph endpoints & Streamable HTTP MCP.
Enterprise Unlimited API
Unlimited B2B RPC-backed 11-Layer scoring feeds for wallets, DEX terminals, and launchpads with 100+ RPS throughput and 99.95% SLA.
Autonomous HTTP x402 & MCP
Machine-native Solana USDC & SOL settlement via /api/x402/v2 and /mcp with 14,640h Mainnet telemetry proof.
Earn a Sticky 30% Atomic ?ref= Split (+50% Higher Than 20% Programs)
Paste any valid Solana wallet address to generate your shareable ?ref=<Wallet> link. Every referred pass checkout ($1.99 / $19.99 / $49.99 / $99 / $500) or repeat rent cleanup splits 30% directly to your wallet inside the same unsigned Solana transaction with zero custody, zero withdrawal minimums, and automatic self-referral protection.
Related Solana Security & Rent Forensics Guides
Token-2022 PermanentDelegate Rug Scanner & TLV Audit | 11-Layer Gate
Block Token-2022 PermanentDelegate rugs with 11-Layer Shield. Reclaim 2,039,280 lamports (0.00203928 SOL) at 0% 1st claim + earn a 30% ?ref= split.
Token-2022 Hidden 100% TransferFeeConfig Trap Checker | 11-Layer
Catch 10,000 bps Token-2022 fee traps via our 11-Layer Shield. Reclaim 2,039,280 lamports (0.00203928 SOL) at 0% 1st claim + earn a 30% ?ref= split.
Token-2022 DefaultAccountState Frozen & Soulbound Detector | 11-Layer
Stop Token-2022 DefaultAccountState::Frozen traps via 11-Layer Shield. Reclaim 2,039,280 lamports (0.00203928 SOL) at 0% 1st claim + 30% ?ref= split.
Reclaim Token-2022 Withheld-Fee Empty Accounts | 0% 1st Rent Claim
Unlock stuck Token-2022 withheld-fee ATAs + 11-Layer Shield. Reclaim 2,039,280 lamports (0.00203928 SOL) to 2,157,600 at 0% 1st claim + 30% ?ref= split.
Solflare Wallet Close Empty Accounts at 0% Fee | 11-Layer Rug Shield
Close empty Solflare token accounts at 0% 1st claim: recover 2,039,280 lamports (0.00203928 SOL) per ATA + 11-Layer Shield & 30% ?ref= SOL split.
$500/mo Enterprise Solana Token Security API (100+ RPS Unlimited)
$500/mo Unlimited 11-Layer Shield API (100+ RPS, 99.95% SLA), 2,039,280 lamports (0.00203928 SOL) 0% 1st claim telemetry, and 30% ?ref= split.