CKB UniSat Proof of Concept: Bridging Bitcoin Wallets to CKB Network

ยท

Project Overview

This proof-of-concept demonstrates how to integrate common Bitcoin browser wallets with the CKB (Nervos) blockchain, enabling users to receive and send CKB using their BTC addresses. The project currently supports two major Web3 wallets:

๐Ÿ‘‰ UniSat Wallet
๐Ÿ‘‰ OKX Wallet

Technical Architecture

The project consists of two main components:

  1. Web Interface (./dapp)
    A demo UI that facilitates asset transfers on CKB testnet using browser-based cryptocurrency wallets.
  2. On-Chain Script (./lock)
    A deployed CKB smart contract script currently running on the testnet.

Wallet Integration Guide

UniSat Wallet Implementation

  1. Setup Process

    • Install the UniSat Wallet extension
    • Restore two test accounts using these mnemonic phrases:

      • cousin minimum crazy knock electric curve inflict acid neck gift castle slush
      • soup butter loud convince rabbit horn salute clump still amount immune sustain
    • Select your preferred BTC address format (Native Segwit, Nested Segwit, Legacy, or Taproot)
  2. Launch Commands

    cd dapp && npm install && npm run uiWalletUnisat

OKX Wallet Implementation

  1. Setup Process

    • Install the OKX Wallet extension
    • Restore the same test accounts using the provided mnemonic phrases
    • Choose your address format preference
  2. Launch Commands

    cd dapp && npm install && npm run uiWalletOkx

Taproot Address Considerations

Important Note: Current Taproot (P2TR) address support has limitations:

Technical Deep Dive: Taproot Implementation Challenges

Our analysis revealed limitations in current wallet APIs regarding Schnorr signature support:

  1. Public Key Format
    The obtained 33-byte public key (028d...53a) exceeds standard Schnorr requirements
  2. Signature Verification
    Generated 65-byte signatures suggest secp256k1 algorithm usage rather than pure Schnorr

The current workaround involves native Segwit address generation via:

pubkey = unisat.getPublicKey()
pubkey_hash = RIPEMD160(SHA256(pubkey))
address = bech32_encode(pubkey_hash)

Frequently Asked Questions

Which wallets does this PoC currently support?

The demo supports UniSat and OKX wallets, with potential for future expansions to other Bitcoin-compatible wallets.

Why do Taproot addresses display differently?

This occurs because current wallet APIs don't fully support Schnorr signatures required for Taproot, necessitating a native Segwit workaround.

Can I use this on CKB mainnet?

Currently, the smart contract is only deployed on testnet for security and testing purposes.

How secure are the test accounts?

The provided mnemonic phrases are for demonstration only. Never use test credentials with real funds.

What's the project's roadmap?

Future development includes full Taproot support, additional wallet integrations, and mainnet deployment after thorough testing.


Key Terms: CKB integration, Bitcoin wallet compatibility, UniSat implementation, OKX wallet support, Taproot addresses, blockchain interoperability, proof-of-concept development