Preprint · v0.1 (pre-audit) · October 2026
LAMPORT: A Self-Protecting Token on Solana
The LAMPORT contributors · lamport.computer
Abstract
A Solana account is controlled by a single ed25519 key: whoever holds it, whether through phishing, malware, a leaked seed phrase or a future cryptanalytic break, can move everything in it. We present $LAMPORT, a Token-2022 token whose transfer hook refuses any transfer from an armed account unless the same transaction carries proof from a second, hash-based key. The everyday proof is a link of a Lamport hash chain, revealed through a commit–reveal step that defeats front-running; rare administrative actions use a stateful hash-based signature (WOTS/XMSS). Holders opt in, pools and unarmed holders are unaffected, and a seven-day recovery that the second key can veto handles lost keys. We describe the protocol, its accounts and instructions, a security argument, and its honest limits.
1Introduction
Every signature scheme in production use on Solana today rests on the hardness of the elliptic-curve discrete logarithm problem. That assumption is challenged from three directions at once: everyday key theft (phished seed phrases, malicious approvals, wallet drainers), the possibility of a new classical algorithm, and Shor’s algorithm on a large quantum computer [5]. In every case the outcome is the same: an adversary holds a valid signing key and the chain cannot tell them from the owner.
Hash functions offer a different footing. In 1979 Lamport showed how to build digital signatures from any one-way function [1]; in 1981 he proposed authenticating with a chain of hashed passwords, each used once [7]. Both need nothing but preimage resistance, which quantum computers weaken only quadratically [6]. Their limitation is statefulness: each key may be used once, or a fixed number of times.
Token-2022’s TransferHook extension lets a mint name a program that Solana invokes on every transfer of the token, including transfers initiated by delegates and DEX programs, and whose failure aborts the whole transaction [9]. We use that hook to enforce a second factor at the token level: once a holder arms their token account, the hook rejects any outgoing transfer that is not accompanied, in the same transaction, by a fresh link of the holder’s hash chain. A stolen wallet key, of any provenance, is no longer sufficient.
Our contributions are:
- a commit–reveal protocol that turns a Lamport hash chain into a per-transfer, front-running-resistant proof that the hook can check with one hash (§4);
- a stateful XMSS-style Master Key for rare actions, staged across transactions to fit Solana’s limits (§5);
- a time-locked recovery that the second key can veto (§6); and
- a security argument and an explicit list of limitations (§7–§8).
2Threat model
Adversary. The adversary knows the owner’s ed25519 secret key and can therefore sign any transaction the owner could. sees all on-chain state and all transactions as they are broadcast, and can submit its own transactions with arbitrary priority fees. does not know the Quick Key secret or the Master Key seed, which are generated independently of the wallet seed and stored apart from it.
Assumptions. is SHA-256, modelled as preimage- and second-preimage-resistant; against quantum adversaries we assume the generic Grover bound, work for a preimage. Solana’s consensus and the Token-2022 program behave as specified. The owner’s reveal transaction is included within slots of being broadcast (see §8 for what happens if it is censored for longer).
Goals. (G1) Unstealability: cannot reduce the balance of an armed token account by any transfer. (G2) Liveness: the owner can always transfer. (G3) Recoverability: an owner who loses the second key can disarm with the wallet key alone, after a delay during which the second key can veto.
Out of scope. Burns (which do not invoke transfer hooks), assets other than $LAMPORT, compromise of the device while it holds both keys in the clear, and implementation bugs (addressed by audit and immutability).
3Design
$LAMPORT is a Token-2022 mint with the TransferHook (program lamport_hook), MetadataPointer and TokenMetadata extensions, six decimals and a fixed supply. After launch, the mint authority, freeze authority and transfer-hook authority are set to none, there is no permanent delegate and no transfer fee, and both programs are made immutable after audit, so no single key, including the authors’, can change the rules.
wallet key + Quick Key
commit · reveal · master
Session · SigBuffer
transfer_checked
Execute
+ Instructions sysvar
lamport_auth holds per-account state and verifies proofs; lamport_hook is called by Token-2022 on every transfer and reads that state.| Account | Seeds | Fields |
|---|---|---|
Armor | ["armor", token_account] | owner, token_account, quick_anchor (32 B), quick_links_remaining, master_root (32 B), master_next_leaf, recovery_delay_slots, recovery_unlock_slot? |
Commit | ["commit", armor, commitment] | slot |
Session | ["session", token_account] | slot, remaining, link |
SigBuffer | ["sig", armor, digest, payer] | staged Master Key signature bytes |
The hook’s ExtraAccountMetaList resolves, for every transfer, the source account’s Armor PDA, its Session PDA (writable) and the Instructions sysvar. Its decision procedure is:
Algorithm 1 · lamport_hook::Execute(source, amount)
- if owner(source) is off-curve (a PDA: pool, vault) → allow
- if Armor(source) does not exist → allow (unarmed)
- require Session.slot = current slot
- require Session.remaining ≥ amount
- require an earlier instruction in this transaction is lamport_auth::reveal for source
- Session.remaining ← Session.remaining − amount; allow
- otherwise fail with LamportArmed
Delegated transfers carry no special privilege: the hook judges the source account, so a delegate (or a drainer holding an approval) faces the same requirement as the owner. Arming requires the token account to carry the ImmutableOwner extension, so a stolen key cannot reassign the account’s owner to escape the Armor.
4The Quick Key protocol
4.1Setup
The client draws a 32-byte secret from the system CSPRNG, independent of the wallet seed, and computes the chain
arm(quick_anchor = a, quick_len = n, master_root, recovery_delay), signed by the owner, stores in the Armor account. Links are recomputed on demand from , which is kept encrypted under a passphrase (scrypt or Argon2id, then AES-256-GCM) in the browser and in a downloadable backup.
4.2Announce, then reveal
To transfer units with the next link (where the current anchor is ), the client first posts a commitment binding the link to the exact transfer:
where is a random nonce and an expiry slot. commit(c) may be paid by anyone and records the current slot. Once the commitment is at least slots old, a single transaction carries reveal(ℓ, v, nonce, s_exp) followed by the Token-2022 transfer. reveal checks
and then updates state atomically:
The hook (Algorithm 1) then accepts the transfer only in the same slot, only up to , and only if the reveal precedes it in the same transaction. The commit’s rent is refunded when it is closed.
token_2022::transfer_checked(v) → lamport_hook::Execute ✓
Why the announcement? A revealed link is public the moment the reveal transaction is broadcast. Without the commitment, an adversary holding the wallet key could copy into its own transaction and race the owner. With it, any commitment the adversary creates for is necessarily younger than slots when the owner’s reveal lands, and the owner’s reveal advances the anchor past in the same transaction, so is never accepted twice (Lemma 1).
5The Master Key
Rare actions (disarming, rotating the Quick Key, cancelling recovery, changing the recovery delay) require a signature from a stateful hash-based scheme in the XMSS family [3]: Winternitz one-time signatures (WOTS) with over SHA-256 with tweakable-hash domain separation, aggregated by a Merkle tree of height , giving one-time keys under one public root . The signed digest binds the program, the account, the action and its parameters:
With bytes and , a WOTS signature has chain values (2,144 bytes); with the height-10 authentication path it exceeds one transaction, so it is staged into a SigBuffer with stage_master_sig(offset, chunk) and verified by master_action(action, leaf_index, auth_path), which recomputes the WOTS public key, the leaf and the path to . The program enforces a strictly increasing leaf index,
so a one-time key is never accepted twice, even if the client’s own usage ledger is lost.
6Recovery
An owner who loses the second key calls request_recovery() with the wallet key alone, setting with default slots (about seven days). Until then, either second key can cancel: cancel_recovery_quick with a valid Quick Key reveal, or the CancelRecovery Master action. After the unlock slot, finalize_recovery() disarms the account.
7Security analysis
Theorem 1 (Unstealable). Under the threat model of §2, no transfer that reduces the balance of an armed token account passes the hook unless the transaction contains a preimage of that account’s current anchor.
Proof sketch. Algorithm 1 allows a transfer from an armed account only if a reveal for that account succeeded earlier in the same transaction, which by (3) requires a preimage of the current anchor under . By preimage resistance, cannot compute one from ; by Lemma 1 it cannot use one the owner reveals; by Lemma 2 it cannot reuse an old one. ∎
Lemma 1 (Front-running). A link revealed by the owner cannot be used by : learns only when the owner’s reveal is broadcast, so any commitment it makes to is younger than when the owner’s reveal (included within slots, by assumption) advances the anchor to , after which .
Lemma 2 (No replay). A session authorises at most units, in one slot, in the transaction that created it; the anchor advances on every reveal, so a link is accepted at most once.
Lemma 3 (No back doors). Delegated transfers, swaps and drains are judged by the source account (Algorithm 1); owner reassignment is impossible (ImmutableOwner); Master Key leaves are single-use by (6).
Quantum adversaries. A quantum computer that breaks ed25519 yields exactly the adversary of §2: a party holding the wallet key. Theorem 1 then applies unchanged. The remaining primitive, SHA-256, retains roughly 128-bit preimage security against Grover’s algorithm [6].
Composability. Pools and program vaults are off-curve and pass step 1 of Algorithm 1, so buying $LAMPORT, providing liquidity and receiving tokens work everywhere. Selling from an armed account requires the venue integration (or the $LAMPORT app) to place the reveal before the swap instructions, which aggregator “swap-instructions” APIs permit.1
8Limitations
- Unarmed holders are as exposed as with any token. Protection is opt-in, by design.
- Burns. Token-2022 burns do not invoke transfer hooks, so an adversary with the wallet key can burn armed tokens. It can never take them; a burn only reduces supply.
- One extra step. An armed transfer is two transactions about 1.6 s apart, with one extra fee (the commit’s rent is refunded).
- Scope. Only $LAMPORT is protected. SOL and other tokens in the same wallet are not (see §9).
- Censorship race. If the owner’s reveal is broadcast but withheld from inclusion for at least slots, an adversary who also holds the wallet key could commit to the exposed link, wait, and race the owner. Clients mitigate by submitting through several independent paths and retrying immediately; binding commits to a key derived from would remove the race and is planned.
- Both factors lost. If the wallet key is stolen and both second keys are lost, the adversary can request recovery and the owner cannot veto it. Recovery also assumes the owner notices a request within the delay; the app surfaces pending requests prominently.
- Endpoint compromise. Malware on a device that holds the wallet key and the decrypted Quick Key at the same moment defeats the separation. Hardware-held second keys are future work.
- Implementation risk. Both programs will be audited before mainnet and then made immutable; until then this document describes intended behaviour.
9Future work
The Lamport Hook standard: any new mint can name the same hook at launch, and a single arming setup can protect every Lamport-hooked token a holder owns. Armored wrappers: deposit SOL, USDC or any SPL token and receive a 1:1 hook-protected wrapper (qSOL, qUSDC), with the underlying held by a program account that has no private key. Platform economics: fees from hooked launches and wrappers fund $LAMPORT buybacks.
References
- [1]L. Lamport. Constructing digital signatures from a one way function. Technical Report CSL-98, SRI International, October 1979.
- [2]R. C. Merkle. A certified digital signature. In Advances in Cryptology: CRYPTO ’89, LNCS 435, Springer, 1990.
- [3]A. Hülsing, D. Butin, S. Gazdag, J. Rijneveld, A. Mohaisen. XMSS: eXtended Merkle Signature Scheme. RFC 8391, IRTF, 2018.
- [4]NIST. FIPS 205: Stateless Hash-Based Digital Signature Standard (SLH-DSA). 2024.
- [5]P. W. Shor. Algorithms for quantum computation: discrete logarithms and factoring. In Proc. 35th FOCS, IEEE, 1994.
- [6]L. K. Grover. A fast quantum mechanical algorithm for database search. In Proc. 28th STOC, ACM, 1996.
- [7]L. Lamport. Password authentication with insecure communication. Communications of the ACM 24(11), 1981.
- [8]N. Haller. The S/KEY One-Time Password System. RFC 1760, IETF, 1995.
- [9]Solana Program Library. Token-2022 and the Transfer Hook Interface. Solana Labs / Anza documentation.
- [10]D. J. Bernstein, N. Duif, T. Lange, P. Schwabe, B.-Y. Yang. High-speed high-security signatures. Journal of Cryptographic Engineering 2(2), 2012.
- 1.Liquidity venues must support transfer-hook mints; at the time of writing, Orca Whirlpools does so through token badges, and a minimal constant-product pool with full hook support is planned as a fallback. ↩
$LAMPORT is not affiliated with or endorsed by Leslie Lamport.