[DIS] Kirea Finance: Native RWA Lending Infrastructure for CKB |【DIS】Kirea Finance:面向 CKB 的原生 RWA 借贷基础设施

Please vote: https://dao.ckb.community/thread/vot-kirea-finance-native-rwa-lending-infrastructure-for-ckb-80639

Summary

Kirea Finance is open-source infrastructure for compliant, native real-world asset (RWA) claims on CKB: a unique-asset pattern, an issuer-revocable KYC attestation cell, and a fixed-term lending contract that uses both. The full flow is implemented and verified end to end on the CKB testnet, with no bridge or custodian required. By open-sourcing these reusable primitives for RWA collateral, issuer-controlled KYC, and fixed-term lending, this work expands the native DeFi capabilities available to CKB projects without relying on bridges or custodians.

This proposal requests $7,250 to harden that infrastructure so other CKB projects can build on it: strengthening the lending contract’s security by enforcing loan rules on every collateral spend and verifying net disbursement and repayment, integrating a live KYC provider, and handling repayment edge cases.

Grant Amount Requested: $7,250
ETA to Completion: 10 weeks from approval
CKB Wallet: ckb1qyqvaj4pmuw9vxurdlg8lx3sv7ywmcge33vsvrvu39
Repository: GitHub - salmansarwarr/Kirea-finance: RWA and lending prototype on CKB with no bridge, no custodian · GitHub


Problem

Tokenizing real-world assets is becoming a major cornerstone for the blockchain industry, yet CKB currently lacks an established pattern for lending against real-world asset claims in a compliant way. While CKB possesses robust DeFi infrastructure, the ecosystem remains constrained by limited access to real-world asset ownership and yields.

An earlier, larger attempt at RWA on CKB aimed to build a full platform, combining a custom identity system, reputation engine, and complete dynamic lending engine in one pass. That scope proved too broad for the team to complete alongside other priorities.

This proposal deliberately takes a narrower slice to solve the core problem: one real asset type (invoice), an established KYC vendor integration (Sumsub), and one simple fixed-term loan mechanic rather than a dynamic collateral-ratio engine. The aim is to harden and generalize the underlying pattern for easily onboarding future assets, not to replicate the full scope of that earlier attempt.


What’s Already Implemented

  • Native Asset Claims: RWA claims are issued natively on CKB as unique cells using the Type-ID pattern (no bridge required).
  • On-Chain Attestation: An issuer-revocable KYC attestation cell gates access to the lending flow. Using mocked verification, to prove the on-chain mechanics independently of any specific KYC provider.
  • Loan Cycle: The full fixed-term lifecycle (deposit, borrow, repay, release) is implemented and tested on CKB testnet.

Technical Architecture

Pipeline

RWA Asset → KYC Attestation → Deposit → Borrow → Repay → Release

Components

Component Location Description
RWA Asset asset/ On-chain representation of a single real-world claim (invoice), implemented as a unique Cell (Type-ID pattern), not a fungible token. Identity is derived from a hash of a consumed input cell’s outpoint at creation time, which guarantees the claim can be issued exactly once and never duplicated. After issuance, the Type Script allows simple transfers (one input, one output) without re-checking uniqueness; authorization is handled by the Lock Script.
KYC Attestation kyc-attestation/ A Cell recording a verification result (subject’s lock hash, status, issued timestamp), written under the issuer’s own Lock Script so only the issuer can revoke it. No custom Type Script is needed for this component: standard Lock Script control is sufficient, since the issuer alone creates and can invalidate the attestation. Verification itself is mocked in the current stage and will be replaced by a live Sumsub integration under this grant.
Lending lending/ A fixed-term deposit/borrow/repay/release state machine. This is the one component with on-chain enforcement logic beyond standard Cell/Lock behavior: the deposit step checks that both the correct RWA asset Cell and a valid, matching, non-revoked KYC attestation Cell are present among the transaction’s inputs before allowing a loan to proceed.

Trust model for this phase

  • On-chain ownership: The RWA claim is represented by a unique CKB Cell controlled by an owner’s Lock Script. The holder can therefore own and transfer the on-chain representation of the claim using native CKB transactions.
  • The RWA asset Cell alone does not imply custody or legal backing of the underlying real-world claim.
  • The lending flow has no price oracle or liquidation logic. Loan terms are fixed at deposit time, which removes the need for live pricing or collateral-ratio monitoring.

Design rationale

Unique Cell instead of a fungible token. The RWA claim (an invoice) is a single, one-of-a-kind item, not a divisible quantity. An earlier version of this project modeled it as a fixed-supply fungible token, which was the wrong fit: there is no meaningful “amount” of one invoice. The Type-ID pattern (uniqueness derived from a consumed input cell’s outpoint) is a well-established CKB technique for exactly this case, used by CKB’s own Type ID script and NFT standards like Spore.

Fixed-term loans instead of a dynamic CDP. A collateralized-debt-position model (like Stable++, an existing live protocol on CKB) requires live pricing and a liquidation engine, real financial-engineering surface area. Since the goal here is building the compliance-gated lending pattern, not building a second CDP protocol, loan terms are fixed at deposit time instead, which removes the need for a price oracle entirely.

A dedicated attestation Cell instead of reusing an existing identity primitive. CKB already has a general-purpose claim/identity system (did:ckb), but its claims are revocable only by the credential holder, not the issuer. That fits reputation use cases well but doesn’t fit compliance: a KYC credential needs to be revocable by the verifying party. This project uses a small, purpose-built attestation Cell instead, rather than retrofitting a primitive built for a different trust model.


Fee Model and Sustainability

The open-source contracts, scripts, and documentation funded by this grant remain free for any CKB project to use. Revenue comes from the production layer built on top of them: a small origination fee on each loan once the platform is live with real loans, and managed onboarding for asset issuers who want a supported integration. Additional revenue can come from paid integration and compliance support for CKB projects that adopt the attestation and unique-asset patterns. As adoption grows, these fees allow the platform to sustain itself without compromising the free, open-source core.


Alignment with CKB philosophy

CKB’s Cell model is well suited to representing a single non-fungible real-world claim with provable uniqueness and explicit ownership. This project uses the Cell model as designed rather than simulating account-based balances.

The RWA application is therefore one use case for a more fundamental primitive: a unique, ownable, transferable on-chain representation of a real-world claim.


Background and Experience

Kirea Finance is built and maintained by Salmandev, I’m a full-stack blockchain developer. My public GitHub (salmansarwarr (Salman Sarwar) · GitHub) holds work across smart contracts and full-stack applications. I have previously completed a project funded under the Nervos Spark program: a “Stripe-Style” React Payment Library for Fiber Network.

For this proposal, I designed and implemented all three core components of Kirea Finance: the Type-ID RWA asset cell, the issuer-revocable KYC attestation cell, and the fixed-term lending state machine. The contracts are written in Rust and compiled for CKB’s RISC-V VM, and the full lifecycle is deployed and verified on CKB testnet.


What This Grant Adds

| Milestone | Deliverable |

|—|—|

| **1. Security hardening, attestation and asset pattern** | Enforce the loan rules on every collateral spend, verify actual net disbursement and repayment, then generalize the attestation cell and asset representation. Details below. |

| **2.Reference KYC integration** |replace mocked verification with a real Sumsub integration that other CKB projects can reuse: webhook handling, mapping results to the on-chain attestation write, sandbox-to-limited-production setup. |

| **3. Repayment edge cases, reference UI and verification tooling** | Explicit late-repayment/default handling on top of the existing repay/release flow; a UI for the lending flow and reference asset (collateral/loan status, lifecycle progress, reproducible testnet activity); expanded testnet verification tooling. |

**Milestone 1 details**

- Enforce the loan rules on every collateral spend: replace the issuer-key vault with a dedicated vault lock that pins the loan type script and only allows the collateral to be spent in a transaction that also consumes the matching loan cell, so the release checks always run.

- Verify actual net disbursement and repayment: borrow and repay compare each party’s token balance across inputs and outputs, so only a real net transfer of at least the loan amount or repay amount passes, not recycled change.

- Tests covering both: a collateral spend without the loan cell must fail, borrow and repay transactions that only recycle the party’s own tokens must fail, and the honest paths still pass.

- Then generalize the attestation cell and asset representation: configurable parameters, documented schema. This lays the groundwork for more asset types in a future phase.

**Acceptance:** the negative tests pass in the test suite, and the updated contracts complete a full deposit-to-release run on testnet.


Budget

Total requested: $7,250 USD equivalent

Area Amount
Attestation + asset pattern hardening (tests, config-driven design) $2,500
Live Sumsub integration (engineering + API/sandbox-to-production fees) $2,500
Repayment handling, UI, and testnet deployment/verification tooling $2,250

Disbursement: staged, 20% ($1,450) on approval, remaining 80% ($5,800) released against milestone completion.


Out of Scope (this phase)

  • Real custody or legal backing of the underlying asset
  • Dynamic collateral ratios, price oracles, or liquidation auctions
  • Mainnet deployment or production issuance
  • General-purpose identity/reputation infrastructure
  • Formal third-party security audit
  • Legal/compliance licensing work

Why This Matters for Nervos

Real-world borrowers need capital, and DeFi has capital looking for yield. Today there is no compliant, on-chain path connecting the two on CKB. Tokenizing real-world assets is increasingly seen as a major direction for the blockchain industry, CKB already has the infrastructure for DeFi applications, but the ecosystem has limited access to high-quality real-world assets and productive external liquidity. This pattern is a first step toward changing that.

This grant turns a working demo into reusable infrastructure:

  • For builders: a documented, configurable attestation Cell and unique-asset pattern, usable for any compliance-gated flow, not just lending.
  • For reviewers and users: explicit late-repayment and default handling, a UI, and reproducible testnet activity that anyone can verify.
  • For the ecosystem: a fully open-source reference showing a bridge-free, custodian-free RWA lending flow on the Cell model.

What this could be used for (future applications, not deliverables of this grant)

  • Invoice and receivables financing. A business borrows against a verified invoice instead of waiting 60–90 days for payment.
  • **Cheaper credit for underserved borrowers.**Producers of physical goods (coffee, commodities, etc.) in places with no access to normal credit can post their real-world assets as collateral, get verified through an on-chain ID+KYC system, and borrow money from DeFi lenders around the world at reasonable rates, instead of going to loan sharks charging predatory interest.
  • Asset-backed short-term loans. Equipment, inventory, or commodity claims used as collateral for fixed-term loans with ability to onboard other types of assets in the future, such as Gold, Real estate, stocks etc.
  • Transferable RWA claims. A uniquely identified claim could potentially be transferred between parties on CKB, subject to the legal and contractual framework governing the underlying real-world asset.

Why on-chain RWA matters (what this pattern enables in future phases)

  • For asset holders: a business or individual holding a real-world claim, such as an invoice, can unlock liquidity from it without selling it, while keeping ownership of the underlying claim.
  • For lenders and liquidity providers: loans backed by verified real-world claims could offer yield sourced from real economic activity, rather than only from crypto-native lending and trading. Yield levels would depend on loan terms and asset quality, and none are promised here.
  • For CKB: access to real-world assets and external liquidity that the ecosystem currently lacks, brought in through a transparent, on-chain lifecycle rather than a bridge or custodian.

Risk & Mitigation

  • Execution risk (solo developer): mitigated by narrow scope and a complete, working demo on testnet before this proposal. I have a previous history of completing projects under the Nervos Spark program. Asset issuance, KYC attestation, deposit, borrow, repay, and release are all implemented and tested, which demonstrates the core pattern is technically sound.
  • KYC vendor dependency: Sumsub is a widely used, established provider; this grant’s integration work is limited to API/webhook integration, not building verification logic from scratch. While also allowing for any KYC to be used without changes to the core design.
  • Scope creep risk: explicitly bounded by the Out of Scope list above.

Call to Action

The core pattern, a real-world claim, gated by KYC, used as loan collateral, is fully implemented and verified end to end on CKB testnet. This proposal funds hardening that working, open-source pattern so any builders, asset type or team can pick it up and extend it.

I appreciate the community’s consideration and welcome any feedback on the architecture, scope, or budget.

36 Likes

Can you clarify how this proposal fits alongside your active Tranfr — Programmable Recovery for CKB - #6 by tianji Spark grant?

Tranfr has received its initial payment and still has the recovery path, SDK, frontend, and documentation outstanding, while Kirea is another solo 10-week commitment. The scopes appear separate but the overlapping timeline and delivery capacity should be disclosed. Would Kirea begin only after Tranfr is completed and accepted?

4 Likes

Thank you for raising this important question.
To clarify:

  1. Tranfr Timeline: Tranfr (my second project under the Spark program) is already well underway and will be fully completed, wrapped up, and ready for acceptance within the next two weeks.

  2. Proven Execution Capacity: In fact, I was able to build the complete working MVP for Kirea Finance while concurrently pushing updates and delivering on Tranfr, which demonstrates my ability to manage multiple workflows efficiently.

  3. Sequential Focus: Now that the core prototype for Kirea is built, its heavy hardening and integration phase will kick off seamlessly as Tranfr reaches its final completion stage.

  4. Previous Experience: Having successfully delivered my previous project under the Nervos Spark program (the Stripe-Style React Payment Library for Fiber Network), I am very comfortable pacing deliverables effectively. That project was delivered ahead of schedule.

Tranfr will be completely out the door within the next two weeks before Kirea hits its major milestone execution. I appreciate you keeping me accountable on delivery bandwidth.

5 Likes

A small clarification for anyone reviewing this proposal:

Kirea is not asking the DAO to fund an unbuilt RWA concept. The complete core lifecycle — RWA asset issuance, KYC attestation, deposit, borrow, repayment and release — is already implemented and verified on CKB testnet.

The $7,250 request is specifically to harden that working pattern: generalize the asset/attestation components, integrate live KYC via Sumsub, handle repayment/default edge cases, and provide a reproducible testnet UI/tooling.

The precedent for RWA being built by the DAO is the Palmyra project which had to be refunded by them due to other priorities. Kirea is deliberately much narrower in scope to turn an already-working prototype into reusable CKB infrastructure.

If you’ve reviewed the proposal and believe this is worth advancing to the voting stage, I’d appreciate a :heart: on the first post. Questions and criticism are equally welcome.

1 Like

I think projects on CKB should proactively explore their own business models ( including securing external funding and acquiring end-users ) rather than relying excessively on community DAO grants. If you truly believe in this community, take your project into the broader market and scale it. While it’s reasonable to seek community support when building essential public goods for the ecosystem, the core objective must always be finding a viable path to profitability.

2 Likes

Thanks for the candid feedback, I agree with the principle. This grant covers the open-source layer any CKB project can reuse: the unique-asset pattern, the issuer-revocable attestation cell, the live KYC integration and the tests. That is the public-good part, and it’s the focus of this grant. The commercial side (custody, compliance, mainnet and loan fees) sits outside the grant and is meant to sustain itself through fees, as outlined in the Fee Model and Sustainability section.

2 Likes

Thanks for reaching out, Salman. I’d like to support you this, but I’d want two things explicitly covered in the hardening milestones.

From the current code, the issuer appears able to spend the collateral without consuming the loan cell, bypassing the loan’s release checks. The borrow/repay checks also count output balances rather than net funds received.

Could you include enforcing the loan rules on every collateral spend, and verifying actual net disbursement and repayment, with tests covering both?

1 Like

Thanks, Arthur. These are important points, and I agree both need to be explicitly covered in the hardening scope. Milestone 1 is now updated to cover both:

  • Enforcing the loan’s validation rules on every collateral spend, so the collateral cannot be moved in a way that bypasses the corresponding loan’s release conditions.
  • Verifying the actual net disbursement and repayment amounts, with tests for both paths, including cases where output balances could give a misleading result.

Appreciate you taking the time to review and flag these.

3 Likes

:counterclockwise_arrows_button: DAO Proposal Sync (Discussion Phase)
Project: Kirea Finance
reached 34 likes within the 7-day discussion window and is now eligible to proceed to the Metaforo voting stage.

2 Likes

Thanks to everyone who supported and voted during the discussion phase! The proposal is now live for voting on Metaform: https://dao.ckb.community/thread/vot-kirea-finance-native-rwa-lending-infrastructure-for-ckb-80639
Every vote counts. Thank you

1 Like

i dont think you set it up well

cause i cant find the quota

Yes I noticed that too. I reached out to the admin. I have to close it and start a new one.

check this out

1 Like

Thank you. I just created 2 new proposals both time I filled in the " Minimum number of votes required to pass" field but it does not show up on metaforo, do you have any idea what the issue could be? screenshots attached.


dont know, why but did do the right setup before getting to this stage?

Yes, just crosschecked and redid it same result.

@zz_tovarishch pls help

I suspect this could be a bug. Could you please test it without the decimal point? Try using 13,982,642 instead of 13,982,642.25.

remove the comma from the numbers, that i think is the issue

Just tried 13,982,642 and same issue

1 Like