Scryve Reads: A DEMO on Pay-As-You-Read with Fiber


We’re sharing Scryve Reads, a live demo testnet experiment that demonstrates what happens when a payment protocol actually clears money in real time.

What It Does

Scryve Reads is a pay-per-section reader. Open a document, read for free until you hit a paywall, then scroll to the end of your current section. An invisible sentinel catches that scroll, auto-triggers a payment, and the next section unlocks. No signup beyond a JoyID passkey. Real money moves on every read.

The flow is simple:

  1. You scroll to the end of a section.
  2. Your browser (running a Fiber WASM node) sends an HTLC payment to the operator.
  3. The server waits ~6 seconds for that HTLC to propagate, then checks the operator’s invoice status.
  4. Content unlocks. The author’s balance ticks up.
  5. Later, the author claims their earnings via a real CKB on-chain transfer to their JoyID address.

No batch settling. No refunds on unread content. No subscription cancellation UX. You read, you pay, it’s done in seconds.

The Wallet

Every reader gets a real Fiber payment channel running in their browser- a full fnn WASM node with its own keypair, derived deterministically from their JoyID identity. The node connects directly to the operator, opens a channel with actual on-chain funding, and can send/receive HTLCs.

Balance persists across page reloads via encrypted IndexedDB snapshots synced to the server. Same JoyID on a second browser? You get a fresh channel (cross-browser migration is intentionally disabled - two browsers with the same libp2p peer ID can’t both maintain an operator channel). The UI tells you to open a new one.

If your channel runs low mid-read, the wallet sheet pops with the channel list right there - close one, open another, keep reading.

Payment Gate (L402 + Macaroons)

The server uses HTTP 402 + macaroons to gate access:

  • First request (no auth) → server returns 402 with a Fiber hold-invoice + a macaroon.
  • Client pays the invoice via HTLC, then retries with the macaroon in the Authorization header.
  • Server verifies the macaroon (checks caveats match the resource), waits for the HTLC to settle on the operator side (~6s), then returns the content.

The preimage lives server-side in SQLite. If the HTLC arrives and settles, the preimage is revealed and the author gets credited. If it times out or fails, it’s refunded and no ledger entry is written.

Author Earnings

Writers publish chapters with a TipTap markdown editor. Every chunk has a configurable price in cents. When a reader pays to unlock it, a pending balance row lands in the ledger:

Code

author_joyid_address | pending_cents | payment_hash

Authors can see their pending earnings at /author?joyidAddress=... and click “Claim” to sweep the balance as a real CKB on-chain transfer to their JoyID wallet.

What You’ll See

Five curated essays ship pre-loaded:

Essay Topic
Pay by the Paragraph HTTP 402, L402, how this app works
Channels of Trust Fiber payment channels and HTLCs
Cells, Not Coins The CKB cell model
The Nervos DAO Storage rent and refunds
Browsers as Nodes What WASM Fiber nodes can and can’t do

You can publish your own chapters, edit them, delete them, watch readers unlock them, and claim your balance.

Built On

This is built on @RetricSu’s fiber-pay SDK. The payment channel implementation, invoice minting, WASM node compilation, hold-invoice mechanics, and L402 harness are his work. We built:

  • Wallet lifecycle and state management with 2PC durability
  • Reading UX that gates on actual scroll progress
  • Cascade-charge prevention and auto-debit logic
  • L402 gate with server-side preimage caching
  • Author ledger with pending/settled tracking
  • On-chain claim settlement flow
  • Encrypted wallet backup and cross-device sync
  • JoyID identity + wrap-key crypto
  • All the retry loops, error handling, and recovery paths

Try It

As a reader:

  1. Visit https://reads.scryvehq.com/
  2. Click “Sign in with JoyID” (set up a passkey if first time)
  3. In the wallet sheet, click “Open a channel”
  4. Set amount: 500 CKB (or less for testing)
  5. Wait ~1–3 minutes for on-chain funding confirmation
  6. Once the channel shows “Ready,” open a demo essay
  7. Scroll through the free section, then scroll past the end
  8. The next section auto-unlocks after payment settles (~2-10 seconds)
  9. To claim earnings (if you published), go to your author dashboard and click “Claim”

As an author:

  1. Sign in with JoyID
  2. Go to /publish
  3. Write in markdown, set price per chunk
  4. Publish
  5. Readers can now unlock your content
  6. Earnings appear in your pending balance as they unlock
  7. Click “Claim” to transfer to your JoyID wallet

Status

Testnet MVP. Verified against fnn v0.8.1 on CKB testnet.

Why It Matters

Most “micropayment” demos show fake payments or batch settle once a day. Scryve Reads uses actual Fiber HTLCs. Every read is a real signed commitment in the operator’s channel graph. Authors receive real CKB on-chain. Settlement takes seconds, not hours.

That constraint changes everything. It’s why we gate payments on actual reading progress (not on page load), why we auto-debit only after scroll, why we abort cascade charging with idempotency keys, and why the UX feels like friction-free commerce instead of a paywall.

If you’re building on Fiber or curious about L402 paywalls, L1 claim settlement, or what a WASM payment node in the browser can actually do, this is worth exploring.



Got questions? Find us on the Nervos community channels.
– Scryve Team

5 Likes

Cool, I like how the UI feels. It’s really clean and neat. For the UX, I had trouble setting up the payments, which is to open channels I supposed? For some reasons, the button didn’t work for me.

Another thing is that JoyID is not always the best and ideal choice for users. Since fiber already supports external wallet funding, once SDK like fiber-pay support such a feature it will be even better to support all kinds of wallets through CCC connector for funding channel in Fiber so that scryve reads doesn’t have to tie to JoyId.

6 Likes

I am getting this problem

2 Likes

Hi :slight_smile: The WASM node hadn’t finished bolt-style Init handshake with the operator before a 15s retry. I bumped it to 45s. We tried on our side and its working, but its not flawless.


For the time being, its a cool experiment but not a product yet, a lot of work to be done on it.

4 Likes