Citadel$CITADEL
Plain text

The program test run

Vault program: test run on LiteSVM 1.6.2 (a local Solana machine; nothing deployed, nothing sent to any cluster) Run: 2026-12-03 · program id 7jYrjCUJHCFMQ6EAFet9ekudxy98mFKNEheFNhKcwEXb · pq_vault.so 59328 bytes, SBPFv3, sha256 b0839d548566807ab916c7fecb6de57d4fb530ddc59ed1fa16ba835a011433af Every vault key made and signed with the site's own shared/pq.mjs (served as /js/pq.js); every transaction built by the site's own SDK. SOL: deposit → partial withdraw → tomb ok deposit 5 SOL to vault[k0] Ey3R9LhH… (a plain transfer, nothing registered) · 217 B · 150 CU ok stage tx 1/2 (init buffer + write) · 1232 B · 12099 CU ok stage tx 2/2 (write) · 726 B · 1290 CU ok withdraw tx: last chunk + verify 510 F calls + pay · 1232 B · 118377 CU (limit 133510) ok recipient got exactly 1.5 SOL ok vault[k0] is empty ok the rest, 3.5 SOL, is in vault[k1] ok tomb[k0] written, names k1 → vault[k1] ok buffer closed ok the payer paid only fees + the tomb's rent: 1071640 lamports (3 × 5000 + 1056640) ok 3 txs, sizes 1232 / 726 / 1232 B one key, one spend ok a late deposit of 1 SOL lands at the tombstoned vault[k0] · 217 B · 150 CU ok the same signed spend replayed → refused · refused Spent (101754 CU) ok a NEW signature by the used key k0 (0.5 SOL → k2) → refused · refused Spent (97243 CU) ok the SDK refuses to build a spend for a used key refusals (vault[k1] holds 3.5 SOL; k1 signs 1 SOL → R2, next k2) ok wrong recipient · refused BadSignature (90558 CU) ok wrong amount · refused BadSignature (93139 CU) ok wrong nextKeyHash · refused BadSignature (88414 CU) ok damaged σ (one bit of σ_5) · refused BadSignature (86047 CU) ok damaged public seed · refused BadSignature (90547 CU) ok k1's signature against another vault (vault[k2]) · refused BadSignature (92804 CU) ok the SOL signature as a token withdraw (an unknown mint) → refused · refused BadSignature (120778 CU) ok the SDK checks σ off chain first: a wrong recipient is never staged ok a valid signature for more than the vault holds · refused OverBalance (112796 CU) ok next = this vault · refused NextIsSelf (96782 CU) ok next = a used key (k0) · refused NextSpent (102557 CU) ok 1,000 lamports to a NEW account (below rent) · refused RecipientRent (115525 CU) ok leaves 1,000 lamports for an empty next vault (below rent) · refused DustRest (118234 CU) ok another wallet writes into the payer's buffer · refused NotAuthority (1236 CU) ok another wallet withdraws with the payer's buffer · refused NotAuthority (3719 CU) ok a write past the end of the buffer · refused BadOffset (1245 CU) ok another wallet closes the payer's buffer · refused NotAuthority (1237 CU) ok after every refusal vault[k1] still holds 3.5 SOL ok then the right spend (1 SOL → R2, next k2) lands · 104311 CU · 450 F calls ok R2 +1 SOL, vault[k2] holds 2.5 SOL forward: what lands later at a tombstoned vault ok another late deposit, 0.7 SOL, lands at vault[k0] (now 1.7 SOL) · 217 B · 150 CU ok forward k0 → vault[k3] (not the one its tomb names) · refused WrongVault (5338 CU) ok forward from vault[k2] (its key never signed: no tomb) · refused NotTomb (2019 CU) ok forward with one of our own buffers posing as a tomb · refused NotTomb (2047 CU) ok ANYONE (another wallet) forwards vault[k0] → vault[k1], the vault its tomb names · 304 B · 8550 CU ok vault[k0] 0, vault[k1] got the 1.7 SOL ok followChain(k0) → k2, the live vault (2 hops) ok forward vault[k1] → vault[k2] · 304 B · 8550 CU ok vault[k2] holds 4.2 SOL send ALL to the fee payer itself, a NEW wallet, with the tomb + buffer addresses pre-funded by a griefer ok a griefer sends lamports to tomb[k2] and to the new payer's buffer address first · 266 B · 300 CU ok stage tx 1 (buffer made over the griefer's lamports) · 1232 B · 13496 CU ok stage tx 2 · 694 B · 1290 CU ok withdraw amount = ALL → the fee payer (recipient = payer: one account twice) · 111199 CU ok payer +4200228840 lamports = 4.2 SOL − 3 fees − tomb rent + the griefer's 2 × 650240 ok vault[k2] empty, tomb[k2] → k3 ok close_buffer: the first payer takes back a buffer it left (a refused attempt) · 206 B · 1412 CU SPL Token: withdraw a token balance the same way ok deposit 1,000 tokens (SPL Token) to vault[k3]'s ATA · 353 B · 15141 CU ok and 0.3 SOL to vault[k3] · 217 B · 150 CU ok stage tx 1/2 (+ recipient ATA + next vault ATA, idempotent) · 1232 B · 34649 CU ok stage tx 2/2 · 1111 B · 1290 CU ok withdraw_token + forward_sol in one tx (495 F calls) · 1232 B · 132803 CU (limit 151406) ok recipient's ATA got exactly 250 tokens ok the rest, 750 tokens, is in vault[k4]'s ATA ok vault[k3]'s token account closed ok vault[k3]'s 0.3 SOL + the closed account's rent → vault[k4] ok tomb[k3] → k4 ok a signature for SOL used to withdraw the token (same amount) → refused · refused BadSignature (94690 CU) ok a late deposit of 5 tokens lands at the tombstoned vault[k3] · 353 B · 15141 CU ok forward the token into someone else's token account · refused BadTokenAccount (7105 CU) ok forward the token to vault[k6] (not the tomb's) · refused WrongVault (23019 CU) ok anyone forwards the late tokens vault[k3] → vault[k4] (+ closes the account) · 478 B · 17476 CU ok vault[k4] holds 755 tokens Token-2022: the same, the old vault's other assets forwarded after ok deposit 500 tokens (Token-2022) to vault[k4] · 353 B · 17638 CU ok stage tx 1/2 · 1232 B · 40248 CU ok stage tx 2/2 · 1111 B · 1290 CU ok withdraw_token (Token-2022) + forward_sol (510 F calls) · 1232 B · 143288 CU (limit 154030) ok recipient 100, vault[k5] the other 400 ok vault[k4]'s SPL Token balance stayed (another asset) ok forward it: vault[k4] → vault[k5] · 478 B · 28063 CU ok vaultHoldings(k5): 305979160 lamports + 755 SPL + 400 Token-2022 Token-2022 with a 1 % transfer fee (fees withheld in the vault's account: it stays open) ok a holder sends 1,000 fee-tokens to vault[k5] (it receives 990, 10 withheld) · 281 B · 3109 CU ok withdraw 400 of them · close=false · 133213 CU ok the SDK left the account open (withheld fees); recipient 396 (400 − 1 %), vault[k6] 584.1 (590 − 1 %) with a priority fee (compute-budget ixs in every tx: the payload split adapts) ok deposit 1 SOL to vault[k6] (it also holds the fee-token rest) · 217 B · 150 CU ok stage tx 1/2 (+ limit + price) · 1232 B · 9399 CU ok stage tx 2/2 (+ limit + price) · 842 B · 1590 CU ok withdraw with a 50,000 µlamport/CU price · 1232 B · 110255 CU (limit 128261) ok recipient +0.25 SOL, vault[k8] holds the other 1055979160 lamports ok the payer paid the priority fee on top: 1079804 lamports compute units: withdraw tx vs F calls (simulated, vault[k7] holds 10 SOL) ok deposit 10 SOL to vault[k7] · 217 B · 150 CU ok every withdraw fits the SDK's compute limit (20 points, F calls 360…660) ok SOL withdraw tx CU ≈ 35637 + 160.7 × F calls (max residual 6379): worst case 990 → 194699 CU ok token withdraw txs fit too: 132803 ≤ 151406, 143288 ≤ 154030, 133213 ≤ 151406 88 passed · 0 failed