v0.1.0-beta

CKB Wallet Setup

Nervos CKB is where Veil stores your public identity pass. The pass proves that a Veil ID belongs to your CKB wallet, while your raw score stays private on Midnight.

What Is CKB?

CKB (Common Knowledge Base) is the Layer 1 blockchain of the Nervos Network. Unlike most smart contract chains that prioritize computation, CKB is designed around a storage-first model: the fundamental resource on CKB is cell capacity (measured in CKBytes), not computation gas. This makes CKB uniquely suited for long-lived, immutable on-chain objects.

CKB uses a UTXO-like model called the Cell Model, where each "cell" holds arbitrary data and is locked by a script (similar to a smart contract). Cells can only be consumed by the owner of the lock key, making CKB data both persistent and tamper-resistant.

Key properties that make CKB useful for Veil:

  • Permanent records: Once a cell is created, its data cannot be changed without destroying it. Your identity pass is designed to be long-lived.
  • Low ongoing cost: You pay once to create the cell (capacity deposit), not recurring fees to keep it alive.
  • Decentralization: CKB is a public PoW blockchain with global node distribution — no single party controls the data.
  • Wallet-friendly: CKB can work with keys from many wallet types, including EVM wallets.

What Is an Identity Pass?

A Veil identity pass is a public CKB record created through Spore. It is similar to an NFT, but its important data is stored directly on CKB instead of pointing to a separate server.

The pass contains:

  • Content type: A MIME type or custom type string describing the data format (Veil uses application/json).
  • Content: The JSON data that links your Veil ID to your CKB wallet.
  • Lock: The CKB rule that makes the pass belong to your wallet.
  • Record ID: The CKB identifier used to find the pass later.

Once minted, the pass content cannot be modified. In normal use, it is intended to stay with the wallet that minted it.

Note
Your identity pass is stored on CKB. It will persist as long as CKB itself does.

Why Veil Uses CKB

Veil uses CKB because users can own a public proof without giving up score privacy:

User-Owned Pass
A CKB identity pass cannot be changed by Veil or a third party. The user owns it.
Works Across Wallets
CKB can support keys from many wallet types, including EVM wallets.
Easy to Check
Apps can check the pass through CKB without needing special infrastructure.
Low Cost
The one-time mint costs CKB for storage. There are no ongoing fees to maintain the pass.

Supported Wallets

Veil uses the CCC (CKB Connect Connector) library to support multiple CKB wallets. The following wallets are currently supported:

WalletTypeNetworksNotes
JoyIDMobile (Passkey)Mainnet, TestnetRecommended; uses WebAuthn, no seed phrase
MetaMask (EVM)Browser extensionMainnet, TestnetUses EVM key, requires CCC adapter
OKX WalletBrowser extensionMainnet, TestnetNative CKB support
UTXO GlobalBrowser extensionMainnet, TestnetCKB-specific wallet
Tip
JoyID is the easiest wallet for new users. It uses your phone's biometrics (Face ID or fingerprint) as the key — no seed phrase required. Visit joy.id to get started.

Connect Your CKB Wallet

From the Veil dashboard, after completing the Midnight wallet steps:

  1. Scroll to the CKB Identity section and click Connect CKB Wallet.
  2. A wallet picker modal will appear. Select your preferred wallet.
  3. For JoyID:A QR code will appear. Scan it with your phone's camera app. Authenticate with your biometric (Face ID / fingerprint). The connection completes automatically.
  4. For MetaMask: Click through the MetaMask popup. The CCC adapter will derive a CKB key from your Ethereum key using BIP44 derivation.
  5. Your CKB address will appear in the dashboard once connected.

The dashboard reads the public CKB wallet data needed for your identity pass automatically.

What Goes Into Your Pass

When you mint a Veil identity pass, the following JSON is stored on CKB:

jsonIdentity pass content (stored on-chain)
{
  "protocol": "Veil",
  "objectType": "VeilIdentity",
  "veilIdHash": "0x7f3a91b2c4d5e6f700112233445566778899aabbccddeeff0011223344556677",
  "ownerCkbLockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "midnightNetwork": "preprod",
  "midnightContract": "0xcontract_address_here",
  "version": "1"
}

Field descriptions:

FieldDescription
protocolAlways "Veil"; used to identify Veil records
objectTypeAlways "VeilIdentity"; identifies this as a Veil identity pass
veilIdHashYour Veil ID hash; links the pass to your private credit profile
ownerCkbLockHashThe public wallet hash of the CKB wallet that owns this pass
midnightNetworkShows which Midnight network stores the score
midnightContractThe Veil network address on Midnight
versionPass format version; currently "1"
Note
The pass content is permanently public on CKB. Do not embed personal data. TheveilIdHash is a one-way hash — it cannot be used to recover your real identity or Midnight private key.

The Mint Process

Minting an identity pass creates a new CKB record. Here is what happens:

  1. The dashboard prepares the identity JSON.
  2. A CKB transaction is prepared with one new identity pass record.
  3. The transaction is signed by your CKB wallet using the lock script corresponding to your wallet's public key.
  4. The signed transaction is broadcast to the CKB network. Miners include it in the next block (usually within 30–60 seconds on testnet).
  5. Once confirmed, the transaction hash and output index identify your pass.

Gas & Fees

CKB uses a different fee model than Ethereum. Instead of paying gas for computation, you lock some CKB to pay for the storage used by your identity pass.

  • Minimum capacity: Each CKB cell requires at least 61 CKBytes of base capacity. The Veil pass content adds approximately 300–400 bytes, bringing the total capacity to around 65–70 CKBytes minimum (but the dashboard uses a comfortable 200 CKB to ensure success).
  • Transaction fee: A small miner fee of approximately 0.001 CKB is added to the transaction to incentivize miners.
  • Total cost: Approximately 200–250 CKB to mint. This CKB is locked in the record. Treat this capacity as committed to a long-lived public identity.

On testnet, use the Nervos faucet to get free test CKB. On mainnet, at current CKB market prices, the mint cost is typically under $5 USD.

View Your Pass

After minting, you can view your identity pass on the CKB Explorer:

Search for your CKB wallet address to find your pass. Click on the transaction hash to see the record data. You can verify that the veilIdHash in the pass content matches the one shown on your Veil dashboard.

The Spore explorer at spore.pro may show your Veil identity pass in a more readable format once it processes the new record.