A Nervos DAO deposit pays out at the end of the 180-epoch cycle in which its withdrawal request lands, with cycles counted from the deposit. Someone who needs their CKB early waits up to about 30 days. iCKB solves this for CKB deposited through iCKB, but an existing deposit cannot move into it.
We want to build a third option in the Cellula wallet: sell the withdrawal. The depositor gets CKB now, and the buyer claims the deposit when it matures. Before we build it, we would like to hear where this breaks.
How it works
Withdrawal phase 1 turns a deposit cell into a withdrawing cell. The DAO script lets that withdrawing cell use any lock (dao.c v0.5.4 L332-L334). Since 2023, nodes require it to have a lock of the same serialized size as the deposit’s, for deposits included at or after block 10,000,000 (RFC 0023, DaoScriptSizeVerifier). phroi found the issue that led to that rule.
So one transaction can:
- spend the seller’s deposit cell and create the withdrawing cell under the buyer’s lock, at the same index;
- spend the buyer’s CKB and pay the seller.
Both sign the same transaction. No new on-chain script is needed.
On testnet, both sides on secp256k1 locks: the buyer paid 995.89 CKB for a 1,000 CKB claim with a full cycle (about 30 days) left, about 5% a year (0xb376a515). The deposit was made 3 blocks earlier. A lock of another size is refused by the node: “The lock script size of deposit cell at index 0 does not match the withdrawing cell at the same index”.
Cellula wallet accounts can do it today with the wallet’s own lock, also on testnet: a full account sold a 300 CKB claim to another full account (0x85cf8e0c), and a starter address to another starter address (0x6bdaf749). The wallet app has no code for this yet.
The buyer’s claim, on a local dev chain with the same DAO binary as mainnet (ckb 0.210.0, 10-block epochs): after maturity the buyer got exactly the same compensation as a normal withdrawal from the same blocks. A claim one epoch early, and the seller trying to spend the cell, were both refused. The testnet claims above mature around 2026-12-04.
Price
At maturity the buyer receives the deposit plus the compensation up to the phase 1 block. The claim earns nothing after phase 1: dao.c takes the rate from the withdrawing cell’s own block. So:
- the yield earned so far goes to the buyer on chain, and the price pays it back to the seller;
- the yield for the days left is given up;
- the discount is what the buyer earns for waiting.
Example: a 10,000 CKB deposit made 10 days ago is worth about 10,006 CKB at maturity, 20 days from now. A buyer who wants 5% a year pays about 9,979 CKB now and earns 27 CKB. Waiting the full cycle would have paid the seller about 10,017 CKB. The wallet would show both numbers.
How much it would be used
We measured mainnet withdrawals over the 158 days to 2026-11-04: 896 phase 1 withdrawals, 838.7M CKB. This leaves out the iCKB pool and a dCKB drain in August, the 205 cells whose lock changed at phase 1. Time from phase 1 to maturity:
| Time to maturity | Withdrawals | CKB |
|---|---|---|
| under 1 day | 276 | 138.5M |
| 1 to 3 days | 164 | 204.0M |
| 3 to 7 days | 163 | 221.8M |
| 7 to 14 days | 93 | 81.3M |
| 14 to 21 days | 69 | 129.4M |
| 21 to 31 days | 131 | 63.8M |
About half (49% of withdrawals, 41% of the CKB) were within 3 days of maturity. About a third were more than a week away. So this is a small feature for people who need their CKB quickly, not a large market.
Credit and earlier objections
tianlitao proposed this in t/8956#7 (English in #8), as an extension of the instant convert service xxuejie described in #1. phroi answered that it is “not really viable” and listed the problems (#11, #15). Our answers:
- Unbounded liquidity, a DoS with a huge deposit. Each quote is for one deposit, and each buyer sets the largest deposit it will take. A deposit nobody buys waits for its cycle, as today.
- “What if the user deposited 4 years ago, is he not entitled to a part of his yield?” He keeps it: the yield earned so far is part of the price.
- Deposits are NFTs, the user must choose one. The wallet shows each deposit with its time left and its price, and the user picks.
- Same index for deposit and withdrawal, at most 64 outputs. One deposit per transaction, built by the wallet.
iCKB, and dCKB before it, already change the lock at phase 1 inside their own protocols. We found no service that buys single claims from users.
Traps and limits
- Who signs last. Any spend of a deposit is a phase 1, so the seller cannot cancel cheaply, and a buyer holding a half-signed transaction could wait while the claim grows. So the buyer signs first and the seller signs last.
- Cycle boundary. A signed transaction stays valid after the boundary (
sinceis only a lower bound). If phase 1 lands after it, the claim moves to the next cycle, about 30 more days. So each quote has a deadline a few epochs before the boundary, and at the deadline the buyer spends, on chain, the input reserved for that quote, which voids it. Replace-by-fee is not enough: on a dev chain it replaced a sale that was pending or just proposed, but once the sale could be committed, the next block committed it anyway. - Quote spam. Each signed quote ties up one of the buyer’s cells, so a buyer limits open quotes per requester.
- Lock sizes. A buyer needs a lock of the seller’s size, and one key can back several. Common sizes: 73 bytes (secp256k1, and multisig or ACP with 20-byte args), 75 (JoyID, Omnilock with 22-byte args, ACP with 22). Cellula wallet accounts are 75 bytes (starter addresses, the size of JoyID) or 85 bytes (full accounts, which sell to another full account). The buyer’s lock must also handle phase 2, which needs an absolute-epoch
since. - What the buyer checks. The DAO type, all-zero deposit data, the output lock and the deposit block. dao.c checks the headers, so the seller cannot fake the claim.
- No resale. A claim changes hands once: a withdrawing cell can only be spent in phase 2, after maturity. If the buyer loses its key, the claim is lost.
- Fees and minimums. The buyer pays the fee. The payment to the seller is a normal cell: at least 61 CKB on secp256k1, a little more on bigger locks.
- A rule that may change. The node’s code calls the lock-size check “a temporary solution till Nervos DAO script can be properly upgraded”. A future DAO script could forbid a new lock at phase 1, and this would stop working.
- Voting. chenyukang’s ckb-treasury-lab#15 notes that withdrawing cells count as voting weight. We added there that a sale moves them, and supported counting deposits only.
Plan
- In the Cellula wallet, on testnet first: for each deposit, “CKB now” next to the value at maturity.
- Open offers: public, in an open format any wallet can read, so any buyer can answer, the iCKB bot included.
- No fee for us. The wallet only builds the transaction both sides sign. We do not buy claims, hold anyone’s CKB or take a side.
No funding is asked here. Does anyone see a flaw, or would you make offers?
