Hash-Signed Coin

The first quantum proof memecoin, signed with hashes inside a Token-2022 transfer hook
public key enddigest digits 0 to 63checksum
The signature lattice. Each column is one hash chain of fifteen steps, and each of the 67 columns carries one base 16 digit. Once a contract address is integrated, the lit dot in each column is the digit of the SHA-256 digest of the live value, cut exactly the way the coin cuts a transaction digest before it will move.

"Quantum proof coin" redirects here. For what the signature leaves outside its reach, see What it does not cover.

Hash-Signed Coin is the first memecoin that will not move for an elliptic curve signature alone. Every Solana wallet is an ed25519 key, and on Solana the address is the public key itself, so every wallet is exposed from the moment it exists. A large enough quantum computer running Shor's algorithm[4] turns that public key back into the private key. Hash-Signed Coin puts a second lock on the coin, built only from SHA-256, and enforces it inside a Token-2022 transfer hook[1]. A wallet that has sealed its balance must present a Winternitz one-time signature in the same transaction, or the transfer reverts.

The lock is part of the coin and not a service beside it. The signature is checked by the hook program, the key that signed is retired on the spot, and the next key is committed in its place. The state lives in program-derived accounts on Solana, one small node per sealed wallet and one account for the whole coin. Nothing is indexed off chain and nothing is attested by a server.

The coin also watches the curves it does not trust. Three bounty vaults sit behind public keys that nobody has ever held a private key for, one on each of ed25519, secp256k1 and secp256r1. The only way to open one is to sign with it, and the only way to sign with it is to break the curve. When a vault opens, the coin changes its own rules in the same transaction. No clock is involved at any point.

Hash-Signed Coin
Classification
TypeHash-signed memecoin
ChainSolana mainnet-beta
Token program
Extension
Accounts
CA
Hook program
Coin account
Meta list PDA
Node PDA["node", mint, owner]
Signature
SchemeWinternitz one-time
HashSHA-256
Digit width4 bits, w = 16
Chains67 (64 digest, 3 checksum)
Signature size2,144 bytes
Hashes to verify1,005 at most
Pool filteroff-curve owners skipped
Revertsunsigned sends from sealed wallets
Coin account
Sealed supply
Sealed share
Exposed supply
Program-held supply
Sealed wallets
Signatures verified
Transfers seen
Last signature slot
Break state
Read at slot
Canaries
ed25519
secp256k1
secp256r1
Value
Value
Price
Supply
Links
Mint
Hook
DocsFull specification

One-time keys

A hash function is easy to run forward and infeasible to run backward. Lamport showed in 1979 that this is enough to sign a message[2], and Winternitz, as reported by Merkle[3], showed how to sign several bits with one chain of hashes. No number theory is involved, so Shor's algorithm has nothing to work on. The best known quantum attack on a hash is Grover's search[5], which only halves the exponent.

A wallet draws 67 random 32 byte secrets. Each secret is the start of a chain, and a chain is fifteen applications of the hash:

c0(x)=x,ci(x)=H(t ∥ j ∥ i ∥ c i−1(x))c^{0}(x)=x,\qquad c^{i}(x)=H\big(t\,\|\,j\,\|\,i\,\|\,c^{\,i-1}(x)\big)
(1)

where H is SHA-256, t is a fixed domain tag, j is the chain number and i is the step. The far end of every chain is public. The 67 public ends are hashed together into one 32 byte commitment, and that commitment is all the coin stores:

K=H(p0 ∥ p1 ∥⋯∥ p66),pj=c 15(sj)K=H\big(p_{0}\,\|\,p_{1}\,\|\cdots\|\,p_{66}\big),\qquad p_{j}=c^{\,15}(s_{j})
(2)
sσpsigner hashes d timeshook hashes 15 - d
One chain, drawn for a digit of 9. The signer reveals the value nine steps in. The hook hashes it six more times and must land on the public end.

Digits and checksum

The message to sign is a 256 bit digest. It is cut into 64 digits of four bits each:

m=∑j=063dj 16 63−j,0≤dj≤15m=\sum_{j=0}^{63} d_{j}\,16^{\,63-j},\qquad 0\le d_{j}\le 15
(3)

For digit j the signature holds the value d steps along chain j. Anyone can hash a revealed value further forward, which would turn a signature into one for a message with larger digits. The checksum closes that door. It counts how far every digit is from the top:

C=∑j=063(15−dj),0≤C≤960<163C=\sum_{j=0}^{63}\big(15-d_{j}\big),\qquad 0\le C\le 960<16^{3}
(4)

C is written as three more digits and signed on chains 64 to 66. Raising any message digit lowers the checksum, and lowering a checksum digit would mean running a hash backward. An early Winternitz library for Solana shipped without this step, and one observed signature was enough to forge another. Here the hook recomputes C itself and never reads it from the caller.

digit width wchainssignature bytesmost hashes
41334,256399
16672,1441,005
256341,0888,670

The trade between size and work for a 256 bit digest and 32 byte chain values. Hash-Signed Coin uses w = 16: the signature fits one 4,096 byte transaction with room left for a swap, and verification stays near a thousand hashes at the very most.

Sealing a wallet

A wallet becomes hash-signed by calling seal once with its first commitment. The hook program creates the wallet's node account, stores the commitment, and moves the wallet's balance from the exposed total to the sealed total. From that slot on, the old signature alone moves nothing out of the wallet. Receiving needs no signature, so a sealed wallet buys exactly as before.

Sealing is a choice. An unsealed wallet holds and trades the coin like any other token, and it is counted as exposed for as long as it stays that way.

Sign: the permit path

A transfer hook receives the amount and the accounts of a transfer and nothing else, so a 2,144 byte signature cannot ride inside the transfer itself. It rides in front of it. The transaction carries a sign instruction first and the transfer second. sign walks all 67 chains, checks the result against the stored commitment, and writes a one-use permit into the node. When Token-2022 then calls the hook for the transfer, the hook finds the permit, checks the amount, and burns it. A sealed wallet with no live permit gets an error, and the transfer fails with it.

Wallet transactionv1 format, 4,096 bytessign2,184 bytes of datatransfer_checkedToken-2022Hash-signed hook67 chains, checksumExecuteCPI from Token-2022Node PDA[node, mint, owner]Coin account[coin, mint]write permitburn permittotals
One signed transfer. Both instructions sit in the same transaction, so the permit is written and burned in the same slot and never waits where someone else could use it.

Transaction binding

A signature that only named an amount could be lifted out of a pending transaction and attached to a different one. So the digest that gets signed covers the whole transaction:

m=H(t ∥ mint ∥ owner ∥ i ∥ Ki+1 ∥ H(ix∗))m=H\big(t\,\|\,\mathrm{mint}\,\|\,\mathrm{owner}\,\|\,i\,\|\,K_{i+1}\,\|\,H(\mathrm{ix}^{\ast})\big)
(5)

Here i is the wallet's key index, K with index i + 1 is the commitment to its next key, and ix* is every instruction in the transaction, read by the program from the instructions sysvar, with only the signature bytes blanked. Change the pool, the amount, the slippage limit or the account that receives the proceeds, and the digest changes and the signature is void.

Key ratchet

A Winternitz key may sign once. Signing twice with the same key reveals two points on each chain and lets a forger mix them. The coin makes a second use impossible instead of forbidden: the digest includes the next commitment, and sign replaces the stored commitment before it returns. The key that just signed no longer opens anything.

K0K1K2K3K4K5K6K7
The ratchet. Every signature carries the commitment to the key after it. Spent keys stay behind as a chain anyone can audit, and only the newest one is live.

The off-curve filter

A pool vault is the other side of every buy and every sell. Its owner is a program-derived address, which by construction is not a point on the ed25519 curve. No private key exists for it, so there is nothing for Shor's algorithm to recover. The hook tests each owner key for being a point on the curve. Owners that fail the test never need a permit and are counted as program-held supply, which is neither sealed nor exposed.

Node account

OffFieldType
0discriminator[u8; 8]
8ownerPubkey
40commitment[u8; 32]
72key_indexu64
80permit_hash[u8; 32]
112permit_amountu64
120stateu8
121bumpu8
122reserved[u8; 6]

The node account, one per sealed wallet, 128 bytes. The commitment is the only key material on chain. The permit fields are zero except during a transaction that carries a signature.

Anyone can read these accounts directly. The coin account holds the totals for the whole coin, and the live values in the infobox are decoded from it.

Exposure

Because the hook sees every transfer, the coin can keep an exact account of how much of itself is protected. Two totals are stored and updated by the transfer that changes them, and the rest follow:

E=S−Ssealed−Sprogram,q=SsealedS−SprogramE=S-S_{\mathrm{sealed}}-S_{\mathrm{program}},\qquad q=\frac{S_{\mathrm{sealed}}}{S-S_{\mathrm{program}}}
(6)

S is the supply, E is the exposed supply sitting in wallets that can be emptied by a curve signature, and q is the sealed share of everything held by people. Both are exact, and both are current as of the last transfer.

Curve canaries

Each canary is a vault holding coin behind a public key that was produced by hashing a public string onto the curve. Anyone can repeat the derivation and confirm that no private key was ever generated. To claim a vault, a caller presents a signature under that key over their own address.

curvealso secureschecked with
ed25519Solana walletsEd25519 program
secp256k1Bitcoin, Ethereumrecover syscall
secp256r1passkeys, phonesSecp256r1 program

Break states

intactadjacent breaknative breakk1 or r1ed25519ed25519
stateset byrule
intactdeploymentevery wallet trades
adjacent breaksecp256k1 or secp256r1 claimunsealed wallets cannot receive
native breaked25519 claimunsealed balances frozen, sealing closed

A broken neighbour curve is the warning. From that transaction on, an unsealed wallet can still sell but cannot be sent the coin, so every new holder seals first. A broken ed25519 is the event itself: a request to seal can no longer be told from a forgery, so sealing closes, and every exposed balance is frozen where it sits and leaves the supply. Hash-signed coin and pools keep moving.

Cost of an attack

problemclassicalquantum
ed25519 discrete log2126polynomial (Shor)
SHA-256 preimage22562128 (Grover)
SHA-256 collision2128about 285

Work to break each primitive.[4][5][9] The first row guards an unsealed wallet. The second guards a sealed one.

What it does not cover

The signature protects ownership of the coin. It does not protect Solana: validators, fee payment and every other token still rest on ed25519. It does not protect what the coin is sold for, since the SOL lands in an ordinary wallet. It does not protect a wallet that never sealed. And it cannot recover a lost seed: the hash key is a second secret, and a sealed balance whose seed is gone stays where it is. The program has no upgrade authority, and the mint has no mint, freeze or hook authority, because each of those would be one more curve key above the coin.

References