Quick Start (5 min)
Welcome to the Nervos CKB ecosystem! This guide will help you set up your local development environment in just a few minutes. After that, you can explore the various paths to build on CKB.
Start Your Local Devnet
We recommend using offCKB to quickly set up a local CKB Devnet for development.
This setup is useful when you want to build a dApp or deploy and test a Script on a local chain. If you only want to learn CKB concepts, develop a Script with local testing tools, or run a Mainnet or Testnet node, you can skip to Choose Your Path.
Install OffCKB
OffCKB requires Node.js 20 or later. Check your installed version:
node -v
If the version is below v20.0.0, install a current Node.js LTS release before continuing.
npm install -g @offckb/cli
Throughout this documentation, we use offckb/cli version >=0.4.0. You can always run the above command to update to the latest version.
Start the Devnet
- Command
- Response
offckb node
Launching CKB devnet Node...
CKB devnet is ready at http://127.0.0.1:8114.
Follow the full node log with: offckb logs -f
CKB devnet RPC Proxy server running on http://127.0.0.1:28114
Your local CKB blockchain is now running. Use the proxy RPC endpoint at http://127.0.0.1:28114 as the default for local development. It forwards requests to the node and records failed transactions for debugging. The direct RPC endpoint at http://127.0.0.1:8114 bypasses the debugging proxy.
Keep this terminal open while you use the Devnet, and open a second terminal for the commands you run next. To stop the chain, press CTRL+C. To resume where you left off, run offckb node again.
This Devnet runs only on your computer. Its transactions will not appear in public Testnet or Mainnet explorers.
View Pre-funded Accounts
In the second terminal, list the pre-funded Devnet accounts:
- Command
- Response
offckb accounts
#### ALL ACCOUNTS ARE FOR TEST AND DEVELOP ONLY
#### DON'T USE THESE ACCOUNTS ON MAINNET
#### OTHERWISE YOU WILL LOSE YOUR MONEY
Print account list, each account is funded with 42_000_000_00000000 capacity in the devnet genesis block.
- "#": 0
address: ckt1...
pubkey: 0x...
lock_arg: 0x...
lockScript:
codeHash: 0x...
hashType: type
args: 0x...
...
- "#": 19
address: ckt1...
pubkey: 0x...
lock_arg: 0x...
lockScript:
codeHash: 0x...
hashType: type
args: 0x...
OffCKB also provides built-in Scripts like Omnilock and Spore-contract, and useful debugging tools. Check out the OffCKB documentation for more details.
Reset the Devnet
If you need to start fresh with a new chain, first stop the running node by pressing CTRL+C. Then run:
- Command
- Response
offckb clean
Chain data cleaned.
Cleaning the Devnet creates a new local chain. Transaction hashes and deployed Script OutPoints from the previous chain will no longer be valid.
Choose Your Path
Choose the path that matches what you want to do on CKB:
🚀 Build a DApp
Learn how to build decentralized applications that interact with the CKB blockchain:
- View and Transfer CKB — Learn how CKB balance transfers work and build your first dApp (2-5 min)
- Store Data on Cell — Store arbitrary data on the CKB blockchain (2-5 min)
- Create a Fungible Token — Issue your own custom tokens using the xUDT standard (5-10 min)
- Create a Digital Object (DOB) — Build on-chain digital assets using the Spore Protocol (5-10 min)
🔐 Write Smart Contracts (Scripts)
CKB supports several languages for writing on-chain smart contracts (Scripts), but Rust is currently recommended for production use because of its performance, memory safety, and mature tooling.
Unlike an EVM contract, a deployed CKB Script does not have a contract address. Its code is stored in a Cell and identified by an OutPoint; transactions include that reference in a CellDep. See Deploy a CKB Smart Contract for details.
Get started with:
- Rust Quick Start — Set up your Rust environment and write your first Script (5-15 min)
- Script Basics — Understand how Scripts work on CKB
- Program Languages for Script — Explore available programming languages for Script development
📚 Learn Core Concepts
Deep dive into CKB's unique architecture:
- How CKB Works — Understand CKB's design philosophy
- Cell Model — Learn about CKB's UTXO-like data model
- CKB-VM — Explore the RISC-V based virtual machine
🖥️ Run a CKB Node
- Run a Node — Operate a persistent CKB Mainnet or Testnet node
Additional Resources
- OffCKB CLI — Full documentation for the OffCKB tool
- CCC SDK — CKB's official JavaScript/TypeScript SDK for building dApps
- CKB CLI — Command-line tool for interacting with CKB nodes
Happy building! 🎉