Spark Program | fiber-checkout — A "Stripe-Style" React Payment Library for Fiber Network

Project Name fiber-checkout — A React component library and hooks package that lets any web developer add Fiber Network payments to their app in minutes. Drop in a component, and your site can instantly accept payments in CKB, RUSD, or SEAL via Fiber — no raw JSON-RPC, no manual hex encoding, no Rust knowledge required.

Team Salman — Blockchain developer specializing in developer tooling, security and payment integrations. GitHub: salmansarwarr Discord: salmansarwarr32


Problem & Solution

The Problem

Fiber Network is live on mainnet. It supports instant, near-zero-fee payments in CKB, RUSD (Stable++), and SEAL. The Nervos team just published @nervosnetwork/fiber-js — a JavaScript wrapper over Fiber’s WASM — five days ago. The protocol works. The JavaScript bridge works.

But there is still no way for a web developer to add a “Pay with Fiber” button to their app.

To accept a Fiber payment today, a developer must:

  • Manually call the new_invoice JSON-RPC method with raw hex-encoded u128 amounts and Option UDT type scripts

  • Hand-render a payment request string into a QR code themselves

  • Poll get_payment on a timer, parse the response, and manage success/failure/expiry states manually

  • Do all of this with zero type safety, zero UI components, and zero examples

This is not a documentation problem. It is a missing tool. Fiber is fast, cheap, and live — but right now it is only accessible to developers who are already deep in the CKB stack.

The Solution

fiber-checkout — a React component library built on top of @nervosnetwork/fiber-js (v0.7.x) that handles the entire payment flow in a single component. Fiber supports CKB, RUSD, SEAL, and any RGB++ UDT token natively — a checkout component here is not a Lightning clone, it’s a payment tool that only exists because of CKB’s unique asset architecture.

import { FiberCheckout } from 'fiber-checkout';

<FiberCheckout
  amount={5}
  asset="RUSD"
  nodeUrl="..."
  // onSuccess and onExpired accept any callback
  // e.g. fulfilling an order on payment or showing a retry button on expiry
  onSuccess={handleSuccess}
  onExpired={handleExpired}
/>

Under the hood, fiber-checkout handles:

  • Calling new_invoice with correctly encoded amounts and UDT type scripts

  • Rendering the payment request as a scannable QR code

  • Polling get_payment every 2 seconds until settled, expired, or failed

  • Displaying real-time status: Waiting, Processing, Paid, or Expired

  • Surfacing human-readable errors when the node is unreachable

For developers who want lower-level control without the UI, the library also exports two standalone hooks:

const { invoice, paymentHash, expiresAt } = useFiberInvoice({
  amountCkb: 5,
  asset: 'RUSD',
  expirySeconds: 3600,
  nodeUrl: '...'
});

const { status, feePaid } = useFiberPayment({
  paymentHash,
  nodeUrl: '...'
});
// status: pending, processing, success, failed, or expired

Technical Approach

  • @nervosnetwork/fiber-js v0.7.x — official Fiber JavaScript WASM wrapper (explicitly targeted; breaking change patches will be applied within the 4-week window if needed)

  • React 18+ with TypeScript strict mode

  • Zero styling dependencies — ships with minimal unstyled base components plus optional CSS classes, so it fits any design system

  • Deliberately narrow scope — we wrap only new_invoice and get_payment. Channel management and node administration are infrastructure concerns, not checkout concerns.

npm package structure:

fiber-checkout
  FiberCheckout     (React component, full UI flow)
  useFiberInvoice   (Hook, invoice generation only)
  useFiberPayment   (Hook, payment status polling only)
  FiberError        (Typed error class)

Ships as: CommonJS + ESM dual build, React 18+ peer dependency, MIT license, published to npm as fiber-checkout.


Deliverables

  • npm package — published, MIT licensed, works against Fiber testnet out of the box

  • GitHub repository — Full TypeScript source, JSDoc on every export, README with testnet quickstart (zero to first accepted payment in under 15 minutes)

  • Live testnet demo page — A hosted webpage accepting real Fiber testnet payments, with transactions visible on the Fiber testnet explorer

  • Companion guide — End-to-end walkthrough covering Fiber node setup through to first accepted payment in a Next.js app

  • Demo video — Screen recording: npm install, component rendered, real testnet payment received in under 10 minutes

  • Completion report — Public post on Nervos Talk with transparent fund usage breakdown and Fiber version compatibility notes


Funding Request — $1,200 USD equivalent in CKB

Week 1 — $250 | useFiberInvoice hook + testnet verification new_invoice with UDT type scripts requires careful handling — RUSD and SEAL have different script hashes that need testnet verification

Week 2 — $550 | useFiberPayment hook + FiberCheckout component Core of the project — all UI states, polling logic, error handling, and full TypeScript types

Week 3 — $250 | Cross-browser QA + mobile testing + live demo page Real testnet payments required for demo; mobile responsive layout; Safari WASM compatibility check

Week 4 — $150 | npm publish + companion guide + demo video + completion report Documentation is a first-class deliverable


Timeline

  • Week 1 — useFiberInvoice working on testnet with CKB + RUSD, repo public

  • Week 2 — FiberCheckout component + useFiberPayment hook complete

  • Week 3 — Cross-browser QA done, live testnet demo page deployed

  • Week 4 — npm published, guide posted on Nervos Talk, demo video live, completion report submitted

Estimated completion: 4 weeks from approval.


CKB Ecosystem Relevance

Nervos shut down Godwoken and Force Bridge to focus resources on Fiber Network. That is not a roadmap promise — it is a demonstrated strategic commitment. But a payment network with no checkout tooling is a payment network that only protocol developers can use.

fiber-checkout is the missing link between Fiber’s technical capabilities and the moment a developer adds a “Pay with Fiber” button to a real product. Every commerce app, tipping tool, subscription service, or peer-to-peer marketplace built on Fiber in the next 12 months will likely start with this component or the patterns it establishes.

6 Likes

项目名称:fiber-checkout

fiber-checkout 是一个 React 组件库和 Hook 软件包。它能让任何 Web 开发者在几分钟内为自己的应用添加 Fiber Network 支付功能。只需拖入一个组件,你的网站就能立即接受 CKB、RUSD 或 SEAL 的支付——无需处理原始 JSON-RPC,无需手动进行十六进制编码,也不需要掌握 Rust 知识。

Salman 团队 —— 专注于开发工具、安全和支付集成的区块链开发者。GitHub: salmansarwarr | Discord: salmansarwarr32


问题与解决方案

问题所在

Fiber Network 已在主网上线,支持 CKB、RUSD (Stable++) 和 SEAL 的即时、近乎零手续费支付。Nervos 团队在五天前刚刚发布了 @nervosnetwork/fiber-js(Fiber WASM 的 JavaScript 封装)。协议可行,JavaScript 桥接也已就绪。

但是,目前 Web 开发者仍然没有办法在应用中添加"使用 Fiber 支付"按钮。

要在今天接收一笔 Fiber 支付,开发者必须:

  • 手动调用 new_invoice JSON-RPC 方法,并处理原始十六进制编码的 u128 金额和 Option UDT 类型脚本

  • 自行将支付请求字符串渲染成二维码

  • 开启定时器轮询 get_payment,解析响应,并手动管理成功、失败或过期的状态

  • 在零类型安全、零 UI 组件、零示例的情况下完成以上所有操作

这不只是文档问题,而是工具缺失的问题。Fiber 极快、便宜且已上线——但目前只有深耕 CKB 技术栈的开发者才能触达它。

解决方案

fiber-checkout —— 一个基于 @nervosnetwork/fiber-js (v0.7.x) 构建的 React 组件库,仅需一个组件即可处理整个支付流程。Fiber 原生支持 CKB、RUSD、SEAL 和任何 RGB++ UDT 代币。这里的结账组件不是 Lightning 的克隆版,而是基于 CKB 独特资产架构而存在的支付工具。

import { FiberCheckout } from 'fiber-checkout';

<FiberCheckout
  amount={5}
  asset="RUSD"
  nodeUrl="..."
/>

onSuccess 和 onExpired 接受任何回调函数 — 例如支付成功时完成订单,或过期时显示重试按钮。

在底层,fiber-checkout 处理了:

  • 调用 new_invoice 并确保金额编码和 UDT 类型脚本正确

  • 将支付请求渲染为可扫描的二维码

  • 每 2 秒轮询一次 get_payment,直到结算、过期或失败

  • 实时显示状态:等待中、处理中、已支付或已过期

  • 当节点无法连接时,展示易于理解的错误信息

对于需要低级控制(不需要 UI)的开发者,该库还导出了两个独立的 Hook:useFiberInvoice 和 useFiberPayment。


技术方案

  • @nervosnetwork/fiber-js v0.7.x:官方 Fiber JS WASM 封装

  • React 18+ 与 TypeScript 严格模式

  • 零样式依赖:提供极简的无样式基础组件及可选的 CSS 类,适配任何设计系统

  • 专注核心范围:仅封装 new_invoice 和 get_payment。通道管理和节点管理属于基础设施范畴,而非结账逻辑


交付物

  • npm 软件包:已发布,采用 MIT 协议,开箱即支持 Fiber 测试网

  • GitHub 仓库:全 TypeScript 源码,包含 JSDoc 注释和 README 快速入门指南

  • 测试网在线演示页面:一个托管的网页,可接收真实的 Fiber 测试网支付

  • 配套指南:从 Fiber 节点设置到在 Next.js 应用中完成首笔支付的全流程教程

  • 演示视频:展示从安装到接收支付的全过程(10 分钟内)

  • 结项报告:在 Nervos Talk 发布公开贴,包含透明的资金使用明细和 Fiber 版本兼容性说明


资金申请 —— 1,200 美元(等值 CKB)

第 1 周 — 250 美元 | useFiberInvoice Hook + 测试网验证 new_invoice 与 UDT 类型脚本需要仔细处理 — RUSD 和 SEAL 具有不同的脚本哈希,需要测试网验证

第 2 周 — 550 美元 | useFiberPayment Hook + FiberCheckout 组件 项目核心 — 所有 UI 状态、轮询逻辑、错误处理和完整 TypeScript 类型

第 3 周 — 250 美元 | 跨浏览器质量保证 + 移动端测试 + 测试网演示页面 演示需要真实测试网支付;移动端响应式布局;Safari WASM 兼容性检查

第 4 周 — 150 美元 | npm 发布 + 配套指南 + 演示视频 + 结项报告 文档是一等交付物


时间线

  • 第 1 周 — useFiberInvoice 在测试网支持 CKB + RUSD,仓库公开

  • 第 2 周 — FiberCheckout 组件 + useFiberPayment Hook 完成

  • 第 3 周 — 跨浏览器 QA 完成,测试网演示页面部署

  • 第 4 周 — npm 发布,指南发布于 Nervos Talk,演示视频上线,结项报告提交

预计完成时间:批准后 4 周。


CKB 生态相关性

Nervos 停止了 Godwoken 和 Force Bridge,转而将资源集中在 Fiber Network 上。这不仅是路线图的承诺,更是战略性的投入。但是,一个没有结账工具的支付网络,注定只能被协议开发者使用。

fiber-checkout 是连接 Fiber 技术能力与开发者在产品中添加"支付"按钮之间的缺失环节。未来 12 个月内,任何在 Fiber 上构建的电商应用、打赏工具或订阅服务,都极有可能从这个组件或其建立的模式开始。

4 Likes

Hi @SalmanDev,

Thanks for submitting the fiber-checkout proposal! Fiber still lacks frontend integration tooling, and this is exactly the kind of gap Spark is designed to fill.

That said, before we bring it to the committee meeting, there are a few things we’d love you to clarify or supplement:

1. Funding amount and project classification

Quick note on how Spark works: pure technical projects are capped at $1,000, while comprehensive projects (those that include user testing, community engagement, etc.) can go up to $2,000. As currently scoped, fiber-checkout reads as a pure technical project, so the $1,200 ask sits above the cap. You’re welcome to either trim the budget to $1,000 with an adjusted weekly breakdown, or make a case for why this should be classified as a comprehensive project.

2. Team background

We’d love to learn more about you! Right now the team section is quite brief. Could you share some links to past projects, published packages, or open-source contributions? This helps our technical reviewers get a concrete sense of your experience.

3. Verification scheme (“How to Verify”)

Starting this year, we hope all applicants to describe a low-cost, reproducible way for the committee and community to verify deliverables. For a project like this, that might look like a one-command testnet test script, automated test coverage targets, or a step-by-step checklist. Adding this section would strengthen the proposal significantly.

4. Post-grant maintenance plan

Since fiber-js was just released days ago and its API may still evolve, it would be helpful to know your plan for maintaining fiber-checkout after the grant period. Other developers will depend on this package via npm, so even a brief note on how you’d handle breaking changes in upstream dependencies would go a long way.

5. Deployment architecture and security considerations

The proposal implies frontend apps would call the Fiber node’s JSON-RPC directly from the browser. Could you walk us through the expected deployment setup? Specifically: does this require exposing the node’s RPC endpoint publicly, and if so, what are the security implications? Would developers need a middleware layer?

Looking forward to seeing the updated version.

Salman 你好!

感谢提交 fiber-checkout 提案!时机很好,Fiber 前端集成工具仍然缺位,这正是星火计划想要填补的空白。

在提交委员会评审之前,有几点想请你补充说明:

1. 资金金额与项目分类

简单介绍一下星火的机制:纯技术项目资助上限为 $1,000,综合类项目(包含用户测试、社区运营等要素)上限为 $2,000。fiber-checkout 目前看起来属于纯技术项目,$1,200 的申请超出了上限。你可以将预算调整到 $1,000 并修改每周明细,也可以说明为什么本项目应归入综合类。

2. 团队背景

我们想多了解一下你!目前团队介绍比较简短,能否分享一些过往项目链接、已发布的 npm 包或开源贡献?这些能帮助技术评审员更好地评估你的经验。

3. 验证方案(“如何验证”)

从今年起,我们希望所有申请人描述一种低成本、可复现的交付物验证方式。对于这类项目,可以是一键测试网测试脚本、自动化测试覆盖率指标或逐步验证清单。补充这部分会让提案更有说服力。

4. 结项后的维护计划

fiber-js 才刚发布几天,API 可能还会变化。考虑到其他开发者会通过 npm 依赖这个包,能否简要说明 grant 结束后的维护计划?比如上游依赖出现破坏性变更时,你打算怎么处理?

5. 部署架构与安全性

提案中的设计意味着前端应用会从浏览器直接调用 Fiber 节点的 JSON-RPC 端点。能否说明一下预期的部署架构?具体来说:是否需要将节点 RPC 暴露在公网?如果是,安全方面有什么考量?开发者是否需要引入中间层?

期待看到更新版本.

3 Likes

Thank you for the feedback.

1. Funding amount Accepted — I’m trimming to $1,000 as a pure technical project. Revised breakdown: $200 API discovery + useFiberInvoice hook, $500 useFiberPayment hook + <FiberCheckout /> component + Next.js proxy, $200 cross-browser QA + mobile testing + live demo page, $100 companion guide + demo video + completion report.

2. Team background I’m a full-stack blockchain developer with 3+ years of experience and 40+ production Web3 projects delivered. My stack covers Solidity, Rust/Anchor, React, Next.js, and TypeScript.

Relevant live projects:

Full GitHub: github.com/salmansarwarr

These are production applications with full backend, frontend, and deployment. The TypeScript and React experience maps directly to fiber-checkout, and the cross-chain background means the two-chain nature of Fiber’s architecture is familiar territory rather than a learning curve.

3. Verification scheme Here’s the reproducible checklist:

  • npm install fiber-checkout — confirms clean install and TypeScript types resolve

  • One-command testnet test: npm run test:testnet — runs 3 integration tests against Fiber testnet (invoice generation, status polling, payment completion)

  • Live demo page URL published in completion report — committee can scan QR code and verify a real testnet payment end-to-end

  • npm run coverage — confirms 80%+ unit test coverage on all exported hooks

  • npm run typecheck — zero errors in TypeScript strict mode

4. Post-grant maintenance plan I commit to the following after grant completion:

  • Free breaking change patches for a minimum of 6 months post-delivery

  • Each npm release will pin a specific @nervosnetwork/fiber-js version range with compatibility documented in the CHANGELOG

  • If a major Fiber upgrade breaks the library beyond a simple patch, I’ll open a public GitHub issue documenting the breakage and migration path so dependent developers are never left without guidance

5. Deployment architecture and security I do not recommend calling the Fiber node RPC directly from the browser in production, as it requires exposing the node port publicly. The library supports two explicit deployment patterns:

Production (recommended): A lightweight server-side proxy (Next.js API route) that wraps only new_invoice and get_payment. The node RPC stays private. A copy-paste reference implementation will ship with the companion guide.

Development only: Direct browser→RPC is supported for local development and testnet demos, but requires an explicit dangerouslyAllowDirectRpc prop and displays a console warning if NODE_ENV !== 'production' — so it can’t be accidentally shipped to production.

Switching between the two requires only changing the nodeUrl prop — no component code changes needed.

5 Likes

Hi @SalmanDev

Thank you for the rapid revisions and supplementary explanations to the fiber-checkout proposal! Your detailed responses regarding team background, validation plans, project completion and maintenance, and deployment architecture and security — along with adjusting the budget to 1000 USD — gave us a clearer understanding of the project and showed your enthusiasm. The gap in Fiber front-end payment tooling is indeed something the ecosystem urgently needs, and we greatly appreciate your experience as a full-stack blockchain developer and your precise command of @nervosnetwork/fiber-js.

The fiber-checkout project is a “dependency library” or “component library”—a developer-facing tool rather than something end users can use directly. If other developers later build on this package (for e-commerce, tipping, subscriptions, etc.), they will heavily depend on the project’s long-term maintenance. This differs somewhat from the Spark Program’s focus on completing an MVP and initial validation within 1–2 months.

We have decided to place the proposal in Pending status for now. This is not a rejection, but an invitation for you to further refine the proposal so it more closely aligns with the Spark Program’s goals of low barrier to entry, fast pace, and small but realistic prototype validation.

To that end, we suggest you add the following two key pieces of information (please add or expand the corresponding sections in the revised proposal):

  1. Long-term maintenance plan after 6 months
    You have already committed to provide free patches and handle breaking changes for 6 months after the grant ends, which is great. Please further clarify the arrangements for after those 6 months — this will allow the committee and the community to assess the project’s sustainability.For example:
  • Apply to the Community Fund DAO for a follow-up proposal.
  1. Clearer details of the deliverables
    The “validation plan” section is already very specific (npm install, one-click testnet testing, coverage, live demo, etc.), but the concrete deliverables remain high-level. Please provide a detailed description of the exact status of each deliverable based on the current list. For example(it’s enough to explain the reasonableness and necessity of the deliverables):
  • npm package (supported React version range, exported API list, TypeScript type coverage, etc.)
  • Testnet live demo page (core interaction flows, hosting platform, long-term availability considerations, etc.)

These details will help the committee more accurately assess the project’s completeness and its practical value to the CKB ecosystem.

Please reply to the revised proposal under the same Nervos Talk thread (we recommend providing updated versions in both Chinese and English). Once the materials are complete, we will revisit the proposal at the next review meeting (as soon as within 1 week) and provide a final decision. We look forward to your further refinements! Thank you for your continued dedication and patience toward the CKB ecosystem!

Best,
xingtian
On behalf of the Spark Program Committee


Hi @SalmanDev

感谢您对 fiber-checkout 提案的快速修订和补充说明!您在团队背景、验证方案、结项维护计划以及部署架构与安全性方面的详细回应和将预算调整至1000 USDI,让我们对项目有了更清晰的认识并看到了您的热忱。Fiber 前端支付工具的空白确实是生态亟需填补的点,我们非常欣赏您作为全栈区块链开发者的经验以及对 @nervosnetwork/fiber-js 的精准把控。

fiber-checkout 项目是“依赖库”或“组件库”,是面向开发者的工具,而非一般用户直接拿来可用的工具。如果后续其他开发者基于此包进行二次开发(如电商、打赏、订阅等应用),将高度依赖该项目的长期维护能力。这与星火计划聚焦“1-2 个月内完成 MVP + 初始验证”的定位存在一定差距。

我们决定将提案暂时置于 Pending 状态。这不是拒绝,而是邀请您进一步优化提案,以便更精准地契合星火计划“低门槛、快节奏、小而真实原型验证”的宗旨。

为此,我们建议您补充以下两点关键信息(请在修订版提案中新增或扩展对应章节):

  1. 6个月之后的长期维护计划
    目前您已承诺 grant 结束后 6 个月免费打补丁并处理 breaking change,这非常好。请进一步说明 6个月之后 的安排,这能让委员会和社区看到项目的可持续性。比如:

    • 到 Community fund dao 申请进一步的提案。
  2. 交付物的更清晰详情
    “验证方案”部分已非常具体(npm install、一键 testnet 测试、coverage、live demo 等),但具体交付内容仍显概括。请在当前的交付物列表的基础上详细说明交付物的具体状况。 比如(能说明交付物的合理性和必要性即可):

    • npm 软件包(React 版本范围、导出的 API 列表、TypeScript 类型覆盖等)
    • 测试网在线演示页面(核心交互流程、托管平台、长期可用性考虑等)

这些细节将帮助委员会更准确评估项目的完整性和对 CKB 生态的实际价值。

请您在 Nervos Talk 同一主题帖下回复修订版提案(建议同时提供中英文更新)。一旦补充完整,我们将在下次评审会议(最快 1 周内)重新讨论并给出最终决定。期待您的进一步完善!感谢您对 CKB 生态的持续投入与耐心!

祝好,
行天
代表星火计划委员会
cc: @zz_tovarishch , @Hanssen , @yixiu.ckbfans.bit

2 Likes

Thank you for the detailed feedback. I appreciate the committee’s time and the clear guidance on what’s needed.

Addressing both points directly:


1. Long-term maintenance plan after 6 months

For the first 6 months post-delivery, I commit to free breaking change patches, version-pinned releases, and public documentation of any upstream incompatibilities as previously stated.

After 6 months, the sustainability plan is as follows:

  • Community Fund DAO follow-up proposal: If fiber-checkout has demonstrated real adoption I will apply to the Community Fund DAO for a follow-up maintenance and v2 development grant. The Spark completion report will serve as the proof-of-work for that application. The committee’s own documentation notes that outstanding Spark projects receive assistance preparing Community Fund DAO proposals, and I intend to use that pathway.

  • Open maintainership: The repository is MIT licensed and publicly forkable from day one.

  • Minimal maintenance surface by design: The library intentionally wraps two RPC methods — new_invoice and get_payment. This narrow scope means the ongoing maintenance burden is proportionate.


2. Detailed deliverables

npm package (fiber-checkout)

  • Supported React version: React 18+ (peer dependency)

  • Build output: Dual CommonJS + ESM build, enabling use in both Node.js backends and browser bundlers (Vite, Webpack, Next.js)

  • Exported API:

    • — React component accepting amount, asset (“CKB” | “RUSD” | “SEAL”), nodeUrl, onSuccess, onExpired, onError, and dangerouslyAllowDirectRpc props

    • useFiberInvoice(options) — hook returning { invoice, paymentHash, expiresAt, isLoading, error }

    • useFiberPayment(options) — hook returning { status, feePaid, isLoading, error }

    • FiberError — typed error class with code and message fields matching Fiber RPC failure modes

  • TypeScript coverage: 100% — every exported function, component, hook, and type is fully typed with JSDoc on every public symbol

  • Bundle size target: Under 50kb gzipped, excluding peer dependencies

  • Versioning: Semantic versioning with @nervosnetwork/fiber-js v0.7.x pinned as a peer dependency; compatibility range documented in both package.json and CHANGELOG

Testnet demo page

  • Full flow: select asset → generate invoice → QR renders → wallet scans → status updates in real time → success/expiry states

  • Hosted on Vercel, auto-deploys from GitHub main — stays live as long as the repo exists, no manual redeployment needed

GitHub repository

  • MIT license, full TypeScript source, 80%+ unit test coverage, integration tests against live Fiber testnet, README quickstart under 15 minutes

Companion guide (Nervos Talk)

  • Next.js integration walkthrough covering both deployment patterns, with real testnet transaction links

Demo video

  • Under 10 minutes: install → component rendered → real testnet payment confirmed

Happy to clarify anything


感谢委员会的详细反馈,感谢各位的时间和明确的指引。

以下针对两点直接回复:


1. 六个月后的长期维护计划

交付后前六个月,我承诺提供免费的破坏性变更补丁、版本固定发布,以及对任何上游不兼容问题的公开说明(如之前所述)。

六个月后的可持续性计划如下:

  • 社区基金 DAO 后续提案:fiber-checkout 展现出真实的社区采用(npm 下载量、依赖项目、GitHub 活跃度),我将向社区基金 DAO 申请后续维护与 v2 开发资助。Spark 结项报告将作为该申请的工作证明。Spark 计划文档中明确提到优秀项目将获得准备社区基金 DAO 提案的协助,我计划使用这一路径。

  • 开放维护权: 仓库从第一天起采用 MIT 许可证,任何人均可 fork。

  • 设计上的最小维护面: 组件库有意只封装两个 RPC 方法——new_invoiceget_payment。这一窄范围意味着持续维护负担是合理且可控的。


2. 详细交付成果说明

npm 包(fiber-checkout

  • 支持的 React 版本:React 18+(对等依赖)

  • 构建输出:CommonJS + ESM 双构建,支持 Node.js 后端与浏览器打包工具(Vite、Webpack、Next.js)

  • 导出 API:

    • <FiberCheckout /> — React 组件,接受 amountasset"CKB" | "RUSD" | "SEAL")、nodeUrlonSuccessonExpiredonErrordangerouslyAllowDirectRpc props

    • useFiberInvoice(options) — Hook,返回 { invoice, paymentHash, expiresAt, isLoading, error }

    • useFiberPayment(options) — Hook,返回 { status, feePaid, isLoading, error }

    • FiberError — 类型化错误类,codemessage 字段与 Fiber RPC 失败模式对应

  • TypeScript 覆盖率:100%——每个导出的函数、组件、Hook 和类型均完整类型化,所有公开符号均有 JSDoc 注释

  • 包体积目标:gzip 压缩后 50kb 以内(不含对等依赖)

  • 版本管理:语义化版本,@nervosnetwork/fiber-js v0.7.x 作为对等依赖固定,兼容范围在 package.json 和 CHANGELOG 中均有记录

测试网实时演示页面

  • 完整流程:选择资产 → 生成发票 → 二维码渲染 → 钱包扫码 → 状态实时更新 → 成功/过期状态展示

  • 托管于 Vercel,从 GitHub main 分支自动部署——只要仓库存在即保持在线,无需手动重新部署

GitHub 仓库

  • MIT 许可证,完整 TypeScript 源码,80%+ 单元测试覆盖率,针对 Fiber 测试网的集成测试,README 快速入门 15 分钟以内完成

配套教程(Nervos Talk)

  • 涵盖两种部署模式的 Next.js 集成演示,附真实测试网交易链接

演示视频

  • 10 分钟以内:安装 → 组件渲染 → 真实测试网支付确认

如在下次审核会议前有任何需要进一步说明的地方,欢迎随时提出。

3 Likes

@xingtianchunyan hello any question?

Hi @SalmanDev , Hello, there are no issues with the Fiber checkout project. Thank you for your active and continued attention; please remain patient. The committee is about to complete the necessary procedures, and I will post a notice under this thread as soon as possible.

1 Like

Hi @SalmanDev,

We are pleased to inform you that the Spark Program Committee has approved the fiber-checkout project with a grant of $1,000 USD ( 100% in CKB, current exchange rate approximately 0.001505 CKB/USD, about 664,452 CKB).

The committee highly recognizes that this project precisely fills a critical gap in the Fiber ecosystem: although @nervosnetwork/fiber-js has been released, web developers still lack easy-to-use React components and hooks to quickly integrate Fiber payments (CKB, RUSD, SEAL, etc.). fiber-checkout lowers the integration barrier by wrapping new_invoice and get_payment, providing QR code rendering, status polling, error handling, and TypeScript type safety, enabling more applications (such as e-commerce, tipping, subscriptions) to quickly adopt Fiber payments.

We particularly appreciate several improvements in your revised submission:

  • Verification procedure is reproducible (npm install, one-click testnet testing, 80%+ coverage, live demo QR payment verification);
  • Deployment security design is specified (recommend Next.js proxy pattern + explicit danger warnings during development);
  • Maintenance commitments and deliverables list (npm package, repository, demo page, guide, video, final report) are fairly complete.

Next steps:

  1. Funds and Wallet Address

Total grant: $1,000 USD (100% paid in CKB). The first installment (20%, 132,890 CKB) will be disbursed as soon as possible.

Please provide the recipient CKB wallet address. The remaining 80% will follow a flexible model: it can be requested as needed during weekly syncs or claimed at project completion.

  1. Weekly Sync

We want to establish a regular weekly sync. There are two options:

  • Text updates in this thread, posting progress at a fixed time each week, with the committee replying with feedback and support.
  • A short video call (Discord or another tool). Please let us know your preference and the times that work for you (for example, what time of day each week, weekdays or weekends).
  1. Proposal Locking

After the proposal is approved, we will lock the current version of the proposal post as the reference baseline for subsequent delivery acceptance. This is the standard process for all Spark-approved projects. If minor adjustments are needed during development (such as feature priorities or implementation details), they can be discussed during weekly syncs; if major changes are involved, they must be explained in advance and confirmed by the committee.

Best regards, and we look forward to fiber-checkout going live soon and bringing more real-world use to the Fiber ecosystem!

Thank you for your continued contributions and patience with the CKB ecosystem!

Best regards,
Xingtian
On behalf of the Spark Program Committee


Hi @SalmanDev

很高兴通知你,Spark Program Committee 已 批准 fiber-checkout 项目,资助金额为 $1,000 USD(100% 以 CKB 支付,当前汇率约 0.001505 CKB/USD,约 664,452 CKB)

委员会高度认可该项目精准填补了 Fiber 生态中的关键空白:尽管 @nervosnetwork/fiber-js 已发布,但 Web 开发者仍缺乏易用的 React 组件与 Hook 来快速集成 Fiber 支付(CKB、RUSD、SEAL 等)。fiber-checkout 通过封装 new_invoice 与 get_payment、提供 QR 码渲染、状态轮询、错误处理及 TypeScript 类型安全,直接降低了接入门槛,让更多应用(如电商、打赏、订阅)能快速接入 Fiber 支付。

我们特别欣赏您在修订版中的多项改进:

  • 验证方案可复现(npm install、一键 testnet 测试、80%+ 覆盖率、live demo QR 支付验证);
  • 部署安全设计明确(推荐 Next.js 代理模式 + 开发时显式危险警告);
  • 维护承诺与交付物列表(npm 包、仓库、演示页面、指南、视频、结项报告)已较为完整。

接下来的步骤:

1. 资金与钱包地址

资助总额 $1,000 USD(100% 以 CKB 支付),首笔(20%,132,890 CKB)将尽快发放。

请提供接收资金的 CKB 钱包地址。剩余 80% 采用灵活模式:可在每周同步时按需申请,也可在结项时领取。

2. 每周同步

我们希望建立固定的周同步机制,有两种方式:

  • 在本帖进行文字同步,每周固定时间更新进展,委员会回复反馈与支持。
  • 简短的视频通话(Discord 或其他工具)。 请告知你的偏好和方便的时间(例如每周几点,周中或周末)。

3. 提案内容锁定

提案获批后,我们会将当前版本的提案帖锁定,作为后续交付验收的参照基准。这是所有 Spark 获批项目的常规流程。如果开发过程中需要微调(如功能优先级、实现细节),可以在每周同步时沟通;若涉及重大调整,则需提前说明并经委员会确认。

祝好,期待 fiber-checkout 尽快上线并为 Fiber 生态带来更多实际应用!

感谢您对 CKB 生态的持续贡献与耐心!

祝好,
行天
代表星火计划委员会

cc: @zz_tovarishch , @yixiu.ckbfans.bit , @Hanssen

3 Likes

Thank you to the committee for the approval and the detailed feedback throughout this process.

1. Wallet address

ckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqtqfa0uv43d5m67gkn4d0wkp69k8e8axeqzwzmkx

2. Weekly sync

Text updates in this thread work well for me. I’ll post a progress update every Monday covering: what was completed that week, what’s planned for the next, and any blockers.

3. Next steps

I’ll begin development immediately upon receipt of the first installment. The Week 1 milestone: useFiberInvoice hook working against Fiber testnet, repository public will be the subject of the first weekly update.

Looking forward to shipping something the for CKB.

2 Likes

Hi @SalmanDev , all noted. Monday text-based sync on this thread works well, and March 30 for the first update is fine.

The first installment (132,890 CKB,20%) has been disbursed:

https://explorer.nervos.org/en/transaction/0x8190711c80f318fa9316b0cc8cc883b75f2c433a3b6d2145f30c814d880e7b54

Please confirm once received. Looking forward to the first progress update on March 30.

Hi @SalmanDev ,收到,每周一在本帖文字同步没问题,3月30日首次更新也完全 OK。

首笔启动资金(132,890 CKB,20%)已发放:

https://explorer.nervos.org/en/transaction/0x8190711c80f318fa9316b0cc8cc883b75f2c433a3b6d2145f30c814d880e7b54

请确认到账。期待 3月30日的首次进展更新。

Best,
XingTian
On behalf of the Spark Program Committee

3 Likes

Thank you, payment confirmed.

Development starts today. First update will be posted here on Monday March 30 covering Week 1 progress: repository live, @nervosnetwork/fiber-js v0.7.x wired up, and useFiberInvoice hook tested against Fiber testnet.

4 Likes