[DIS] FiberLatch Access - Open-Source Access Control for Fiber Payments

https://dao.ckb.community/landing?method=share&thread=vot-fiberlatch-access-open-source-access-control-for-fiber-payments-74170

## Summary

This proposal requests a grant of **$3,000** to build **FiberLatch Access**, an open-source access-control layer for Fiber payment flows.

The simple idea is this:

> fiber-pay helps apps accept Fiber payments.

> FiberLatch Access helps apps decide what a paid user can access after payment.

The proposed work will deliver:

1. A proposed access receipt format for Fiber payment-gated resources.

2. Clear expiration rules for paid access.

3. Replay-protection rules to help prevent reuse of access receipts.

4. Clear signing and verification rules for access receipts.

5. A lightweight Node.js package developers can install and adapt.

6. A paid-resource example showing how the pattern works.

7. Documentation and a final report explaining how to use and review the work.

FiberLatch Access is based on my existing FiberLatch work, where I already tested a payment-to-access flow on Fiber testnet. This grant is not for rebuilding that old work. It is for turning the useful access-control part into a small open-source developer tool that other builders can understand, install, and adapt.

**Grant Amount Requested:** $3,000

**ETA to Completion:** 6 weeks

**CKB Wallet or Funding Address:** To be added before Voting Stage

-–

## Project Introduction

Fiber payments become more useful when they can unlock real things inside applications.

For example, a platform may want users to pay before accessing paid content, an API, a file, or a private resource.

Accepting payment is only one part of that flow. After payment, the app still needs to know what the user paid for, whether the user should get access, when that access should expire, and whether the same access is being reused.

FiberLatch Access focuses on this access layer.

It is not a replacement for fiber-pay or any Fiber payment tool. It is a small open-source access-control layer that can work with Fiber payment flows.

The goal is to make it easier for builders to connect Fiber payments to actual product access.

-–

## Why This Matters

As Fiber payment tooling improves, developers will need simple patterns for what happens after payment.

Without a reusable access-control pattern, each developer may need to rebuild the same logic from scratch.

FiberLatch Access aims to provide a small and practical starting point for payment-gated access on Fiber.

It can help propose a consistent pattern for a few important parts of the payment-to-access flow:

- receipt format

- expiration rules

- replay protection

- signing rules

- verification rules

The goal is not to build a large platform. The goal is to create a small reusable building block that other Fiber builders can learn from or adapt.

-–

## Team and Roles

**Timothy Orichi / TicoWorld**

Role: Lead developer

I have been building FiberLatch as part of the CKBuilder program.

FiberLatch started as a backend reference implementation for payment-gated access on Fiber. Through the CKBuilder process, it has gone through live testnet proof work, cleanup, feedback, and review follow-up.

This proposal is the smaller grant-scoped direction of that work.

-–

## Current Status

FiberLatch already exists as prior work.

It has demonstrated this flow on Fiber testnet:

1. A user makes a Fiber payment.

2. The payment is verified.

3. The app issues a signed access receipt.

4. The receipt is verified.

5. Access is granted once.

6. Reuse is denied.

Existing work includes:

- backend reference implementation

- Fiber testnet payment verification

- signed access receipt flow

- one-time access logic

- protected resource demo

- test coverage around the access flow

- CKBuilder review and feedback

This grant will not fund the previous backend work again.

The grant will fund a smaller developer-facing access layer that packages the reusable idea in a simpler and more open-source friendly way.

-–

## What This Grant Will Build

The grant will build FiberLatch Access as a lightweight open-source Node.js developer package and example.

It will include:

- a proposed access receipt format

- expiration rules for paid access

- replay-protection rules to help prevent reused receipts

- clear signing and verification rules for access receipts

- a small package for creating and verifying access receipts

- a paid-resource example

- documentation showing how FiberLatch Access can work with Fiber payment flows

The first version will stay small and easy to review.

-–

## How It Complements Fiber Payment Tools

Fiber payment tools help developers accept payments.

FiberLatch Access focuses on access after payment.

The relationship is simple:

> Payment tools handle the payment side.

> FiberLatch Access handles the access side.

For example, an app could use Fiber payment tooling to confirm that a user has paid, then use FiberLatch Access to issue and verify access to a paid file, API, content page, or private resource.

This keeps FiberLatch Access focused on access control instead of becoming another payment SDK.

-–

## Benefits for CKB and Fiber

FiberLatch Access can help make Fiber payments more practical for real apps.

It can:

- help developers connect Fiber payments to real product access

- provide a reusable access-control pattern for payment-gated apps

- help standardise access receipts for paid resources

- complement existing Fiber payment tooling instead of competing with it

- give builders a small open-source example they can learn from

- make it easier to build paid content, paid API, and paid-resource use cases on Fiber

This is a small proposal, but it supports a useful developer need around Fiber payments.

-–

## Deliverables

The grant will deliver:

### 1. FiberLatch Access scope and design

A short design document explaining what FiberLatch Access does, what it does not do, and how it can work with Fiber payment flows.

### 2. Proposed access receipt format

A reusable receipt format for representing paid access to a resource after a Fiber payment.

### 3. Expiration and replay-protection rules

Clear rules for when access receipts expire and how reuse should be denied.

### 4. Signing and verification rules

A simple standard for signing and verifying access receipts.

### 5. Lightweight access receipt package

A small open-source Node.js package for creating and verifying access receipts.

### 6. Paid-resource example

A simple example showing how a Fiber payment can lead to access being granted to a protected resource, and how reuse can be denied.

### 7. Documentation and final report

Clear setup docs, usage guide, limitations, and a final report showing what was built and how to test it.

-–

## Timeline

The expected completion time is **6 weeks**.

- **Weeks 1-2:** Finalize scope, package design, receipt format, expiration rules, and replay-protection rules.

- **Weeks 3-4:** Build the access receipt package and paid-resource example.

- **Weeks 5-6:** Write documentation, test the package, clean up, and submit the final report.

-–

## Budget

**Total requested:** $3,000

Breakdown:

- Development: $2,400

- Documentation and example work: $400

- Testing, cleanup, and final report: $200

**Hosting cost:** $0

FiberLatch Access is not a hosted service. It is code, documentation, and an example that developers can run in their own projects.

-–

## Out of Scope

This proposal does not include:

- hosted service

- payment SDK

- dashboard

- CLI

- React SDK

- checkout product

- payment gateway

- production readiness

- mainnet readiness

- security audit

- long-term maintenance

These can be considered later only if there is real demand.

-–

## Risks and Mitigation

### Risk: The project may be confused with a payment SDK.

Mitigation: FiberLatch Access will be clearly framed as an access-control layer, not a payment SDK.

### Risk: The scope may grow too large.

Mitigation: The grant is limited to one small package, one example, documentation, and a final report.

### Risk: Developers may misunderstand what FiberLatch Access controls.

Mitigation: The documentation will explain that the host app still owns its users, database, payment flow, and final access enforcement.

### Risk: The first version may not cover every access-control use case.

Mitigation: The first version will focus on a simple paid-resource pattern. More advanced use cases can be explored later if developers find it useful.

-–

## Closing

Fiber payments become more useful when they can unlock real access inside applications.

FiberLatch Access is a small open-source access-control layer for that next step.

The aim is to help developers connect Fiber payments to paid content, APIs, files, tools, or other resources without copying the full FiberLatch backend.

I would appreciate feedback from the community on the scope, naming, budget, and whether this is useful for Fiber application developers.

-–

## Supporting Links

FiberLatch repo:

CKBuilder FiberLatch issue:

fiber-pay:

Live paid Fiber proof tag:

35 Likes

If you are a DAO member please vote for me

https://dao.ckb.community/landing?method=share&thread=vot-fiberlatch-access-open-source-access-control-for-fiber-payments-74170

FiberLatch Access β€” Weeks 1–2 Progress Update

Hi everyone,

Here is the first progress update for FiberLatch Access since the proposal was approved.

The work for Weeks 1–2 focused on defining how the reusable access package should work before implementation begins. That phase is now complete.

So far, I have completed:

  • The project scope and boundaries
  • The access receipt format
  • Expiration and replay-protection rules
  • Signing and verification rules
  • The design for the reusable Node.js package
  • A public ledger for tracking the remaining work

The main goal of this phase was to make sure the package stays small, secure and useful to developers.

The package will allow a host application to issue, verify and redeem access receipts after a trusted Fiber payment. Normal receipt redemption will not require a Fiber RPC call.

The host application will still control payment verification, storage, revocation and the final decision to grant access to the protected resource.

The package is being designed for Node.js developers and will support both ESM and supported CommonJS projects.

All the work is available publicly here:

Repository branch:

Package design:

Receipt format:

Expiration and replay rules:

Signing and verification rules:

Progress ledger:

The existing backend foundation still passes all 57 tests across 8 test files, and the TypeScript build is passing.

To be clear, the reusable package itself has not been implemented yet. The completed work so far is the specification and package-design phase.

The next step is to begin the Weeks 3–4 implementation work:

  • Create the isolated packages/access package
  • Prove that the built package works for ESM and CommonJS projects
  • Implement receipt claim validation
  • Implement signing and verification
  • Implement binding and replay-safe redemption
  • Begin the paid-resource example

I will continue sharing updates here as implementation progresses.

2 Likes

FiberLatch Access β€” Weeks 3–4 Progress Update

Weeks 3–4 implementation is now complete.

This phase focused on the two main implementation deliverables: the reusable @fiberlatch/access Node.js package and the paid-resource example.

The package now handles access-claim construction, Ed25519 receipt signing and verification, host binding checks, and redemption through a host-owned atomic store.

The paid-resource example demonstrates the intended integration boundary: once the host has established a trusted payment result, it can issue an access receipt, allow the first valid access, and deny reuse.

Current verification includes:

  • 235 package tests
  • 12 paid-resource example tests
  • packed ESM, CommonJS, and TypeScript consumer checks
  • passing Node 22 and Node 24 CI

The package is currently private and unpublished. The current distribution proof uses locally packed package artifacts rather than npm registry publication.

One thing that came out of the Week 4 review is that the core package works, but the install/onboarding path for an external developer can be clearer.

So Weeks 5–6 will focus on external-developer usability, clean-room installation testing, documentation tightening, cleanup, and final verification. I’m keeping that phase focused rather than expanding the core API or adding unrelated features.

Repository:

Access package:

Paid-resource example:

I’ll post the final delivery report after the Weeks 5–6 usability and verification phase.

3 Likes

FiberLatch Access β€” Weeks 5–6 / Final Completion Report

Hi everyone,

This is the final update for the six-week FiberLatch Access grant.

The goal of the grant was to take the reusable access-control part of the earlier FiberLatch work and turn it into something another Node.js developer could install, understand, test, and use without depending on the full FiberLatch backend.

That work is now complete.

What was delivered

The approved grant scope covered:

  • FiberLatch Access scope and design β€” Complete

  • Access receipt format β€” Complete

  • Expiration and replay-protection rules β€” Complete

  • Signing and verification rules β€” Complete

  • Lightweight reusable Node.js package β€” Complete

  • Paid-resource example β€” Complete

  • Documentation, testing, cleanup, and final report β€” Complete

The reusable package is now publicly available on npm:

@fiberlatch/[email protected]

npm install @fiberlatch/access

FiberLatch Access lets an application take a payment or business decision it already trusts and issue a signed access receipt for a specific user, resource, policy, and intent.

When that receipt is presented later, the application can verify it, check it against trusted request context, and record its use through application-owned atomic storage.

Weeks 5–6

The main implementation was already in place after Weeks 3–4, so the final two weeks focused on making sure the package worked properly outside the FiberLatch repository.

That included:

  • publishing @fiberlatch/access publicly on npm

  • improving the adopter-facing package documentation

  • validating ESM, CommonJS, and TypeScript consumers

  • testing the paid-resource example against the packaged distribution

  • reconciling and cleaning up the technical documentation

  • running the final Node 22 and Node 24 CI

  • publishing the final 0.1.1 polish release

  • installing 0.1.1 directly from the public npm registry in a completely separate consumer and verifying the actual published package

The final registry verification did not use the FiberLatch workspace or a local tarball.

It tested the same package another developer gets from npm.

Final verification

The completed delivery was verified with:

  • 235 access-package tests

  • 12 paid-resource example tests

  • 57 historical backend regression tests

  • Node 22 and Node 24 CI

  • package build and type validation

  • ESM imports

  • CommonJS usage

  • TypeScript declarations

  • access receipt claim construction

  • Ed25519 signing and verification

  • trusted binding checks

  • successful first redemption

  • repeat use of a single-redemption receipt denied as receipt_exhausted

Paid-resource example

The repository includes a runnable paid-resource example showing the intended integration boundary.

The example starts from a server-side payment decision that the host application already trusts, issues an access receipt, allows the first protected-resource request, and denies reuse of the same receipt.

The payment in this example is intentionally demo data.

The earlier FiberLatch work had already proven the live Fiber testnet payment-to-access path before this grant. This grant focused on extracting that reusable access layer rather than rebuilding or claiming the earlier backend work again.

Responsibility boundary

One important boundary remains:

FiberLatch Access does not determine whether a payment happened.

The host application is responsible for establishing payment or business trust before issuing a receipt.

The host also owns:

  • trusted user and resource context

  • signing and verification key configuration

  • persistent and atomic redemption state

  • revocation

  • the final decision to serve or deny a protected resource

payment_ref can reference the application’s payment record, but it is not payment proof by itself.

The package also does not claim to provide a payment SDK, hosted service, production database adapter, browser SDK, production/mainnet readiness, or a formal security audit.

Keeping the package focused on the access boundary was part of the original scope.

Final links

The final package release source is:

cac78216a803b5e287fa5c92ad0270226caf35e1

The final grant documentation closeout is:

ce60df74ae38f7d0ec8a1620b3cd007e4abb25ce

That completes the technical, package, example, testing, and documentation scope from the FiberLatch Access proposal.

Thanks to everyone who reviewed the proposal, gave feedback, and followed the progress over the six weeks.

Submitting this as the final completion report for review.

6 Likes

Final Payout

3,000/0.00109 = 2,752,294 CKB

https://explorer.nervos.org/transaction/0x339b64f3b53ad611e290ceac724b98633f673ac3693a30bc54b69f7afbff7990

1 Like