CKB-Mobile-Core: Lightweight Native Mobile SDK for iOS & Android

CKB-Mobile-Core: Lightweight Native SDK for iOS & Android

1. Objective

To eliminate developer friction when building native mobile applications on the Nervos Network. This lightweight SDK will handle local cryptographic signing, Molecule data serialization, and automated cell selection natively on iOS and Android without relying on heavy webview wrappers or outdated JavaScript libraries.


2. Motivation & Target Audience

While CKB tooling on the web (e.g., CCC) and backend (Rust, Go) has matured, the native mobile developer experience remains a major bottleneck. Teams attempting to build native mobile wallets, Bitcoin L2 tools, or mobile games currently must write custom FFI bridges from scratch.

Target Beneficiaries:

  • RGB++ & Bitcoin L2 Teams: Enabling mobile companion apps and DEX interfaces (e.g., UTXOSwap, HueHub).
  • Mobile Wallet Developers: Clean cryptographic abstractions for biometric authentication (JoyID native bridges, multi-chain wallets).
  • On-Chain Mobile Gaming: High-performance transaction submission for mobile engines (e.g., Cellula).

3. Core Architecture & Technical Scope

:nut_and_bolt: Component A: Native Cryptographic Module

  • Hashing: Native implementation of Blake2b (using CKB’s ckb-blake2b personalization setting).
  • Signing: Direct bindings to secp256k1 for standard CKB Lock Scripts (such as SECP256K1/blake160).
  • Key Management: Secure integration with iOS Keychain and Android Keystore for hardware-backed key protection.

:package: Component B: Molecule Binary Serializer

  • Goal: High-performance Molecule serialization engine using a lightweight, native/Rust-backed bridge.
  • Functionality: Converts high-level mobile data models (Transaction, CellInput, CellOutput, Script) directly into compliant CKB byte streams.

:battery: Component C: Automated Cell Collector & Fee Estimator

  • Workflow:
    1. Fetch live cells for an address via JSON-RPC (get_cells).
    2. Filter out occupied/locked cells.
    3. Calculate required capacity (Occupied bytes + Fee).
    4. Automatically construct change cells and balance inputs/outputs.

4. Proposed Developer API (Example)

import CKBMobileCore

// 1. Initialize Client & Wallet
let client = CKBClient(rpcUrl: "https://testnet.ckb.dev")
let wallet = CKBWallet(privateKeyFromKeychain: "user_key_id")

// 2. Compose and send a capacity transfer
do {
    let txHash = try await client.transferCapacity(
        from: wallet,
        toAddress: "ckt1qzda0cr08...",
        amountInBytes: 100 // 100 CKB capacity
    )
    print("Transaction broadcasted! Hash: $txHash)")
} catch {
    print("Transaction failed: $error)")
}

@neon.bit @Nervos.Dev

3 Likes

Hi @sublime247,

We’re glad to see your interest in the Spark Program!

Thank you for submitting the CKB-Mobile-Core proposal. The committee has completed its review. After careful discussion, we regret that the proposal cannot be approved at this time.

We would like to transparently explain the reasons behind this decision:

  1. The proposal did not meet the formatting standards:

The current proposal structure falls far short of the required format standards. To help applicants answer the questions that concern the committee more accurately, the committee has prepared a standard template (Spark Program: Mini-Grant Initiative - #7 by xingtianchunyan).

  1. Misleading proposal narrative:

The proposal’s claim that it is “writing the FFI bridge from scratch” does not hold true for the Android system. The combination of ckb-sdk-java 4.0.0 + secp256k1-kmp + AndroidKeystore has already been validated in practice by pocket-node and is supported by multiple tests. If you disagree, please provide specific evidence.

Best regards,
xingtian
On behalf of the Spark Program Committee