Build on QSolana
If you have built on Solana, you already know most of QSolana. This page covers what is the same, the one thing that is different, and what you need to plug in.
The 30-second version
- JSON-RPC API, so @solana/web3.js and other clients can read the chain
- Programs: build with the usual Solana toolchain and deploy
- SPL Token program at its usual address
- 32-byte addresses, 9-decimal native coin
- User accounts are controlled by Falcon-512 keys, not Ed25519
- Solana wallets (Phantom and others) can't sign for QSolana accounts
- User actions are Falcon-signed messages, submitted by a fee relayer
- Your program sees the user's wallet as a normal signer
Network details
How a QSolana account works
A QSolana wallet is an account owned by the wallet program. Its address is derived from the SHA-256 hash of the owner's Falcon-512 public key, and the account stores that public key (897 bytes) plus a counter. To act, the owner signs a short message with Falcon; the wallet program verifies the signature on-chain and then moves QSol or calls another program on the owner's behalf.
address = PDA(["vault", sha256(falcon_public_key)], WALLET_PROGRAM)Because the chain's fee payer must still use Ed25519, a relayer wraps the signed message in a transaction and pays the network fee. The relayer is not trusted with funds: amount, destination, fee and counter are all inside the Falcon-signed message, so any change makes the signature invalid.
Read the chain
Reading works with any Solana client. Balances, transactions, token accounts and program accounts all use the standard RPC methods.
import { Connection, PublicKey } from "@solana/web3.js";
const qsol = new Connection(QSOL_RPC_URL, "confirmed");
const lamports = await qsol.getBalance(new PublicKey(address));
console.log(lamports / 1e9, "QSol");Accept QSol payments or deposits
- 1Give each user a deposit addressCreate a QSolana wallet per user, or one wallet and identify senders by their address.
- 2Watch for incoming transfersPoll getSignaturesForAddress for your address and read each transaction. A transfer is a wallet-program instruction whose first byte is 1, followed by the amount as a little-endian u64.
- 3Wait for finalityTreat a deposit as final once its transaction is finalized.
Send QSol from code
Sign the transfer message with the Falcon key and hand it to a relayer. The message is these fields joined together:
"QSOL-VAULT-V1" | wallet_program (32) | from (32) | to (32)
| amount u64 LE | fee u64 LE | counter u64 LERead the current counter from the wallet account (bytes 2 to 10). Each counter value can be used once, which stops a signed transfer from being replayed. We use the open-source fn-dsa Rust library for Falcon, compiled to WebAssembly for the browser.
Let QSolana wallets use your program
A wallet can call any program through the wallet program's execute instruction. The owner signs over the target program, the exact account list and the instruction data. Your program then receives the user's wallet as a signer, the same as on Solana.
- Your program can check account.owner == WALLET_PROGRAM to confirm the signer is a quantum-safe wallet.
- Paying your program. A wallet is owned by the wallet program, so a System transfer from it won't work. Use “deposit then call”: execute first moves the signed amount of QSol to an account you name, then calls your program, which counts what arrived. The launchpad works this way.
- Tokens. The wallet signs SPL Token instructions as the owner, so transfers from a wallet's token accounts work through execute.
- Size. A Falcon signature is 666 bytes, which leaves room for roughly 8 accounts and a short instruction in one transaction. Keep calls compact.
Launchpad tokens
Tokens created on the launchpad are standard SPL tokens with 6 decimals, a fixed supply of 1 billion, and no mint or freeze authority. Each has a pool account holding its name, symbol, picture link and reserves; list them with getProgramAccounts on the launchpad program filtered to 375-byte accounts.
What isn't ready yet
- A published SDK package. Today the client code lives in this site and the relayer.
- A public relayer address for third-party apps. Until then, run your own relayer: it is a small service with one funded Ed25519 key.
- Wallet-connect style signing from other websites. Planned with the browser extension.
- An independent audit. Don't put real value behind an integration before it.
Questions that this page doesn't answer? The docs cover the non-technical side.