Twine
Non-custodial P2P for Nervos CKB on Nostr and Fiber.
Twine is a non-custodial peer-to-peer (P2P) desk for buying and selling CKB with local fiat. Orders, encrypted chat, and trade actions run over Nostr.
Twine never holds the fiat, and it never holds a key that can spend the locked CKB.
If a trade fails or times out, Fiber's timelock returns the CKB to the seller's channel. If a buyer cannot receive yet, Twine opens a channel to them at payout.
The trade
How a trade works
Sellers list CKB. A buyer picks one listing and takes some or all of it, inside the minimum and maximum. One trade is open on a listing at a time.
If you are selling
Post how much CKB you will sell, the price, a minimum and maximum, and how you want to be paid. When someone takes it, lock the coins from your Fiber wallet, send your account in the chat, and release when the transfer arrives.
If you are buying
Choose a listing and an amount inside its limits. Paste a Fiber invoice for the wallet that should receive the CKB. Pay the seller yourself, put the receipt in the chat, and mark it sent. Their release pays that invoice.
- 1
Post
A seller lists CKB: a price, how much is for sale, and a minimum and maximum. Account details are not part of the listing.
- 2
Take
A buyer names a fiat amount, their Fiber node, and the invoice that should receive the CKB. The secret behind that invoice stays on the buyer's node.
- 3
Lock
Twine gives the seller a hold invoice for that same secret. The seller pays it from their own Fiber wallet. Twine does not have their key.
- 4
Pay
The seller writes the account details and sends them. The buyer sees that text, sends the money outside Twine, uploads a receipt, and marks it sent.
- 5
Release
The seller checks that the money arrived and releases. Twine pays the buyer's invoice. The buyer receives the CKB.
How you pay
The seller writes the account details on the trade and sends them. The buyer sees that text and pays it outside Twine. The listing does not name a bank.
The coins
Who holds the money
Twine coordinates the order book and a dispute. It never holds the fiat, and it never holds a key that can spend the locked CKB. If a trade fails or times out, Fiber's timelock returns the CKB to the seller's channel.
The buyer creates a secret on their own Fiber node, and an invoice locked to it. Twine copies that lock onto the seller's hold and stores no secret. Paying the buyer's invoice is what reveals it, and that same secret settles the hold. Twine can finish the lock only by paying the buyer first.
One hour to lock. Thirty-six hours on the hold.
- The seller has 1 hour to lock the coins. After that, the listing is free again.
- Once the coins are locked, the buyer can pay and mark it sent until 30 minutes before the hold ends.
- The hold lasts 36 hours. A release has to start at least 30 minutes before it ends. A dispute does not pause it.
- Your key
- The app stores a Nostr key. That key is the account. There is no username. The app stores no Fiber key and pays no invoice.
- The chat
- Encrypted between the two traders. The coordinator cannot read it. The seller's account details and the buyer's receipt live there.
- Cancel
- Either person can cancel while the hold is still unpaid. After the seller locks, cancel is refused. The coins wait for release or for the timelock.
- A failed payout
- If the CKB cannot reach the buyer, the hold stays locked. The buyer brings the wallet online and pastes the same invoice again. An invoice that expires first cannot be replaced, and the hold returns the CKB to the seller.
- A dispute
- Either person can open one while the coins are locked, when that desk has a solver. The app seals this trade's chat to the solver, so the solver can read it and the desk cannot. The seller can still release. The solver can pay the buyer, or let the hold expire and return the CKB to the seller.
- Fees
- This software charges no trading fee, keeps no rating, and takes no bond.
Before a trade
What you need
The app is the desk. The wallet is separate. A trade needs both.
- 1
The app
macOS, Windows, Linux, or Android. Create a key on first launch, or import an nsec, and save the secret. Twine does not keep another copy. A new install offers one public desk. You can point it at another.
- 2
A channel, if you are selling
Connect Fiber Studio to the desk's hub, then open a channel and fund it with at least 1,000 CKB so you can pay the hold. Keep about 109 CKB more for the channel reserve and fees. Wait until the channel is ready.
- 3
An online node, if you are buying
Stay connected to the hub with 99 CKB on-chain, and leave auto-accept on. If you cannot receive yet, Twine opens a channel toward you when the seller releases.
The wallet most people use is Fiber Studio. In the app, Account shows the desk's Fiber pubkey and address. Connect outward to that hub. A laptop does not need a public IP.
Questions
Before you download
Who am I paying?
Another person who listed CKB. You agree the price on their post, then send naira or dollars to the account they share in the trade chat.
Can Twine spend the locked CKB?
It can finish the hold only by paying the buyer's invoice first. That payment reveals the secret. Twine does not know the secret before then, and it does not hold a key that can spend the coins.
What if I pay and they don't release?
Leave the receipt in the chat and open a dispute while the coins are still locked, if that desk has a solver. The seller can still release. The solver can pay you or let the hold expire. The 36-hour lock does not pause.
What if I lock coins and they never pay?
You do not release. The hold returns your CKB when it ends.
What moves inside Twine?
The listing, the steps, and the chat. The money moves however the seller asked to be paid. The CKB moves on Fiber, between wallets you and the other person control.