Qelid technical spec
Draft of 3 December 2026. Version 1 of the vault, its factory and the fee config are built and deployed on BNB Chain testnet, and the app for it is at app.qelid.com. Staking, the paymaster and the treasury are still plans. The signature construction needs review by a cryptographer before any audit.
Components
| Component | What it is | When |
|---|---|---|
| Scanner | Web page that checks a wallet’s key exposure | Live |
| QELID token | Flap tax token (their contract, not ours) | Launch |
| Treasury | Multisig that receives the project share of the tax | Launch |
| Vault | ERC-4337 smart account with a post-quantum owner check | On testnet |
| Vault factory | Deploys vaults at predictable addresses | On testnet |
| Fee config | Holds fee rates, caps and tier discounts, behind a timelock | On testnet |
| Staking | Locks QELID and reports a tier | After the vault |
| Paymaster | Lets vault users pay gas in QELID | After staking |
Network: BNB Smart Chain mainnet (chain ID 56), testnet (chain ID 97).
On testnet, as deployed on 3 December 2026:
| Contract | Address |
|---|---|
| Vault factory | 0x74BFf9bbc1a7D75CC15F86Ed336C4a8AF5B4249F |
| Fee config | 0x117Eb9B245787C4D30F7B4107F2BcC46d1c5a74B |
| Timelock that owns the fee config | 0x14D0570d6B32C4Cff12b029C4EfFDCA156FE7E47 |
| Test token, tUSD | 0x7652f572100Cf684aFb59Ee160f063E9Cf2323FB |
Nothing is deployed on mainnet.
Scanner
Input: one address. No wallet connection.
Checks, through a public BNB Chain RPC endpoint:
eth_getCode: if the address has code, it is a contract.eth_getTransactionCount: if greater than zero, the address has signed at least one transaction and its public key is on-chain.
Results:
| Finding | Message |
|---|---|
| Sent transactions > 0 | Public key is exposed on BNB Chain |
| Zero sent, no code | Public key not yet exposed on BNB Chain |
| Has code | A contract; exposure depends on the keys that control it |
Limits to state on the page:
- It checks BNB Chain only. The same key may be exposed on another chain.
- Exposure is not a present danger. No machine today can use an exposed key.
Privacy: the address goes from the visitor’s browser straight to the RPC endpoint. Qelid’s server never receives it, so it has nothing to log.
Later additions: more chains, value at risk, a shareable result card, alerts for stakers.
Vault
Design rules
- One owner check, and it is post-quantum. No ECDSA key has any authority over a vault, including for recovery or upgrades.
- Immutable. No proxy, no admin, no upgrade path. A new version means a new vault that users move to by choice.
- Small. Version 1 does transfers and nothing else, to keep the audit narrow.
Account model
- An ERC-4337 smart account for EntryPoint v0.7 (
0x0000000071727De22E5E9d8BAf0edAc6f37da032), which is deployed on BNB Chain mainnet and testnet. validateUserOpverifies the post-quantum signature. What is signed iskeccak256(userOpHash, nextKeyHash). TheuserOpHashalready binds the vault, the chain ID, the EntryPoint, the nonce, the call and the gas terms, so a signature cannot be replayed elsewhere or altered by whoever relays it.- The signature field is
nextKeyHash(32 bytes) followed by the signature (2,144 bytes). - The key is replaced during validation, before the call runs. Once validation passes, the signature is public, so the key is spent whether or not the call succeeds.
- Gas is paid from the vault’s own BNB until the paymaster exists.
Getting an operation to the chain
A vault has no ordinary key, so it cannot post a transaction itself. Any ordinary wallet can carry a signed operation to the EntryPoint and pay the gas; the vault pays it back in the same transaction. The app calls this the gas wallet. It can be the user’s browser wallet or a throwaway one the app makes.
The gas wallet has no authority. It cannot change an operation’s destination, amount, gas terms or next key, because all of them are signed. A bundler service can do the same job later without any change to the vault.
Version 1 signature: Winternitz one-time keys
| Parameter | Value |
|---|---|
| Hash | keccak256 |
| Digit size | 4 bits (w = 16) |
| Chains | 67 (64 for the message, 3 for the checksum) |
| Signature size | 67 × 32 bytes = 2,144 bytes |
| On-chain key | One 32-byte hash committing to all 67 chain ends |
Key rotation. A one-time key must never sign two different messages. So:
- The vault stores
keyHash, the hash of the current key. - Every operation carries the signature plus
nextKeyHash, andnextKeyHashis part of what is signed. - On success the vault replaces
keyHashwithnextKeyHash. A zeronextKeyHashis refused, since no key could ever match it.
Hash domain separation. Every hash step takes publicSeed, address, value. The public seed is a 32-byte value fixed per vault when it is created. The address is the key’s id, the chain number and the position in the chain. So no two hash steps anywhere in a vault’s keys share an input prefix, and work done attacking one vault or key does not carry to another.
The first draft used the vault’s own address in place of the public seed. That is circular: the vault’s address depends on its first key, and the key would depend on the address.
Key ids. A main key’s id is epoch, index. The index counts operations; the epoch counts completed recoveries and starts the index again from zero. Recovery keys have their own range of ids.
Key derivation. All keys come from one 24-word backup phrase (256 bits, in BIP-39 words). From the phrase and the chain ID the client derives a root secret, and from the root a secret for each chain of each key. The chain ID is mixed in so the same phrase gives unrelated keys on testnet and mainnet. The factory also uses the chain ID as its deployment salt, so one set of keys never lands on the same address on two chains.
Measured cost on BNB Chain testnet, 3 December 2026, over two full runs. Each figure is the gas of the whole transaction that carried the operation. Checking a signature costs more for some messages than others, so the same operation varies from one time to the next:
| Operation | Gas |
|---|---|
| Send BNB | 240,000 to 255,000 |
| Send a token | 274,000 to 282,000 |
| Rotate key only | 183,000 to 208,000 |
| First operation, which also creates the vault | 1,676,000 |
| Start a recovery | 214,000 |
| Finish a recovery | 82,000 |
Checking the signature is about 86,000 of that for a typical message and 166,000 at worst. At the testnet’s gas price of 0.1 gwei, a BNB send cost the vault about 0.000035 BNB. The vault pays the gas wallet slightly more than the gas wallet spends, so that the gas wallet does not run dry.
The one-time-key hazard
Signing two different operations with the same key leaks enough to forge a third. The contract cannot prevent this, because the leak happens the moment the second signature exists, on-chain or not.
Version 1 keeps the single chained key and handles the hazard in three ways:
- A signing record. Before a signature leaves the client, the client writes down which key signed which operation. It will sign that same operation again and refuses any other for that key. If the record cannot be saved, nothing is signed.
- A signed operation can always be sent again unchanged. Gas limits are fixed and generous, not estimated, so a signed operation cannot be stranded by a limit that turned out too low. If the vault cannot pay for gas, nothing changes on-chain; the same bytes go through once it is funded.
- The recovery key, below, for the case where a key is stranded anyway.
A Merkle tree of one-time keys (as XMSS uses) would let a stuck operation be abandoned by moving to the next leaf, at the cost of a larger signature. It remains an option for a later version.
The record lives in one browser. Signing with the same phrase from two devices at once is not protected against.
Operations in version 1
- Send BNB.
- Send a BEP-20 token.
- Rotate to a new key without sending anything.
- Set, replace or remove the recovery key.
- Bring back BNB that was deposited for the vault at the EntryPoint.
No arbitrary contract calls. Staking and unstaking QELID come with the staking contract.
Fees
- Charged on outgoing BNB and listed tokens, on top of the amount sent: 0.05%, with a per-asset cap held in the fee config (for example 50 USDT; the BNB cap is a fixed BNB amount adjusted through the timelock). Deposits and unlisted tokens are free.
- No price oracle in the vault.
- The discount comes from the vault’s staking tier, read from the staking contract once there is one.
- The vault has a hard ceiling of 0.10% written into it. Whatever the fee config answers is cut down to that.
- The fee config cannot block a transfer. If it fails, runs out of gas, answers nonsense or names a collector that refuses payment, the vault charges nothing and sends anyway.
- The fee config is owned by a timelock, so every change is public before it takes effect.
Recovery
Optional, and hash-based only:
- A second one-time key, from a second phrase kept offline. It signs a request that names a new main key.
- The request takes effect after a waiting period fixed when the vault is created. Anyone can then complete it; no key is needed for that step.
- The main key can cancel a waiting request at any time before it takes effect, and install a new recovery key or none.
- The recovery key is spent the moment its request is accepted. The request names the recovery key that follows it, so the same recovery phrase works again next time.
- The main key keeps working while a request waits.
Inheritance and multi-key vaults are tier features built on the same mechanism.
Where keys live
In version 1 on testnet, the backup phrase is kept in the browser’s storage, unencrypted. That is acceptable for test funds only. Encrypting it, and deciding between a browser extension and a mobile app, come before mainnet.
Version 2: ML-DSA
- Adds ML-DSA-44 as a reusable key type, verified by a Solidity verifier contract.
- Published benchmarks put verification above one million gas, which BNB Chain’s gas prices make tolerable. Measure before committing.
- Reuse an existing audited verifier if its licence allows; do not write lattice arithmetic from scratch.
Staking
stake(amount, vault): locks QELID and credits the named vault.requestUnstake(amount)thenwithdraw()after 14 days.tierOf(vault): returns 0–3 from thresholds held in the fee config.- Credits the amount actually received, not the amount sent, so it stays correct if transfers turn out to be taxed.
- No rewards, no emissions.
Paymaster
- An ERC-4337 paymaster that pays gas in BNB and collects QELID from the vault at a 5% spread.
- Price comes from a time-averaged PancakeSwap price, with a per-operation cap, to limit price manipulation.
- Sponsors a monthly allowance of operations for staked tiers, funded from the treasury.
Treasury
- A multisig with published signers and address.
- Receives the project share of the tax in BNB.
- If Flap accepts a contract as recipient, a splitter contract applies the split from the tokenomics automatically. Otherwise the multisig applies it by hand and reports monthly.
What the vault does not protect
- BNB Chain’s consensus, which uses classical signatures.
- Tokens whose own contracts have admin keys.
- The user’s device and seed backup.
Test plan
- Unit tests for signature verification against independently generated test vectors. Done: the contract verifies signatures made by the app’s signer, and the reverse.
- Fuzzing of the verifier with malformed signatures. Done.
- Invariant tests: no path moves funds without a valid signature; fees never exceed the ceiling; a used key is never accepted again. Done.
- A full run through a vault’s life against the real EntryPoint: create, deposit, send, fail, rotate, recover, cancel. Done on a local copy of BNB testnet. The main path (create, send, rotate, recover) was run again on testnet itself with the real waiting period.
- Gas benchmarks on BNB testnet for every operation. Done; figures above.
- A public testnet period with a funded vault as a bounty.
- Independent audit of the vault, factory and fee config before mainnet.
Open questions
- Are plain QELID transfers taxed? This decides whether staking needs a workaround.
- Which stablecoins are fee-bearing at launch?
- Where do client keys live on mainnet: browser extension, mobile app, or both?
- Which bundler service, if any, alongside the gas wallet?
- Does version 1 keep the single chained key, or move to a Merkle tree of keys before the audit?