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.
Why Veil Uses CKB
Veil uses CKB because users can own a public proof without giving up score privacy:
Supported Wallets
Veil uses the CCC (CKB Connect Connector) library to support multiple CKB wallets. The following wallets are currently supported:
| Wallet | Type | Networks | Notes |
|---|---|---|---|
| JoyID | Mobile (Passkey) | Mainnet, Testnet | Recommended; uses WebAuthn, no seed phrase |
| MetaMask (EVM) | Browser extension | Mainnet, Testnet | Uses EVM key, requires CCC adapter |
| OKX Wallet | Browser extension | Mainnet, Testnet | Native CKB support |
| UTXO Global | Browser extension | Mainnet, Testnet | CKB-specific wallet |
Connect Your CKB Wallet
From the Veil dashboard, after completing the Midnight wallet steps:
- Scroll to the CKB Identity section and click Connect CKB Wallet.
- A wallet picker modal will appear. Select your preferred wallet.
- 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.
- For MetaMask: Click through the MetaMask popup. The CCC adapter will derive a CKB key from your Ethereum key using BIP44 derivation.
- 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:
{
"protocol": "Veil",
"objectType": "VeilIdentity",
"veilIdHash": "0x7f3a91b2c4d5e6f700112233445566778899aabbccddeeff0011223344556677",
"ownerCkbLockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"midnightNetwork": "preprod",
"midnightContract": "0xcontract_address_here",
"version": "1"
}Field descriptions:
| Field | Description |
|---|---|
protocol | Always "Veil"; used to identify Veil records |
objectType | Always "VeilIdentity"; identifies this as a Veil identity pass |
veilIdHash | Your Veil ID hash; links the pass to your private credit profile |
ownerCkbLockHash | The public wallet hash of the CKB wallet that owns this pass |
midnightNetwork | Shows which Midnight network stores the score |
midnightContract | The Veil network address on Midnight |
version | Pass format version; currently "1" |
veilIdHash 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:
- The dashboard prepares the identity JSON.
- A CKB transaction is prepared with one new identity pass record.
- The transaction is signed by your CKB wallet using the lock script corresponding to your wallet's public key.
- The signed transaction is broadcast to the CKB network. Miners include it in the next block (usually within 30–60 seconds on testnet).
- 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:
- Testnet (Pudge): pudge.explorer.nervos.org
- Mainnet: explorer.nervos.org
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.