Hi community,
I would like to share something I’ve been working on in the past half year, and be honest about where it stands.
The Cell model is one of the most thoughtful designs I’ve encountered in blockchain architecture. CKB proved that UTXO-style state, combined with a general-purpose VM, gives you something account models simply can’t: explicit ownership, no implicit mutation, and real composability at the transaction level.
But writing Cell scripts by hand is hard. Really hard. You’re parsing witness bytes, tracking indices, encoding state into raw arrays, calling syscalls by number. It’s powerful, but it doesn’t scale to an ecosystem.
So I built CellScript.
CellScript is a domain-specific language that compiles .cell source to RISC-V ELF binaries — the same ones ckb-vm already runs. It doesn’t introduce a new VM. It doesn’t replace the CellTx envelope. It layers a type-safe, linearity-enforced programming model on top of the existing execution stack.
The Design of CellScript
The design follows the same layered philosophy that makes CKB interesting in the first place: CKB should remain the secure value and settlement layer, while richer protocol logic can be expressed, checked, and executed through Cell transitions. CellScript does not try to turn L1 into a monolithic execution computer. Instead, it makes off-layer or verifier-level state transitions more explicit, typed, and auditable.
What it gives you:
- Typed resources:
resource,shared,receipt— linear values the compiler tracks. No silent drops. No accidental copies. - Explicit lifecycle:
consume,create,transfer,destroy,claim,settle— operations that map 1:1 to Cell transactions. - Effect inference: the compiler knows if your code reads, writes, creates, or destroys.
- Scheduler metadata: for DAG-parallel execution, the compiler emits access summaries so block builders can reason about independent work.
- Policy gates: production builds can reject incomplete or risky paths before deployment.
This is an preview release. The compiler works. The type checker catches real mistakes. The codegen produces valid ELF. But the stateful protocol semantics are still maturing, and I’m looking for people willing to break things.
If you’ve ever written a Cell script in C and thought ‘there has to be a better way’ — this is my attempt at that better way.
Try it. File issues. Tell me where the abstractions leak. Tell me where the compiler should reject something it currently accepts.
Examples cover tokens, NFTs, vesting, timelocks, multisig, and AMM pools. They’re not production contracts, they’re proofs that the language maps to real Cell patterns.
How to test the examples:
For example testing, the main Rust test entry is cargo test --locked -p cellscript --test examples. That test file covers the checked-in .cell examples under examples/ and examples/language/, including assembly/ELF compilation, metadata, schema, and backend-shape checks. The production bundled examples are amm_pool.cell, launch.cell, multisig.cell, nft.cell, timelock.cell, token.cell, and vesting.cell.
For CKB-facing acceptance, the scripts are under scripts/. The main release gate is:
./scripts/cellscript_ckb_release_gate.sh full
The lower-level CKB acceptance entry is:
./scripts/ckb_cellscript_acceptance.sh --production
There is also a wrapper for stateful local CKB scenarios:
./scripts/cellscript_ckb_stateful_scenarios.sh
Repo: Github Repo: tsukifune-kosei/CellScript
Tutorials: Home · a19q3/CellScript Wiki · GitHub
VS-Code Extension:CellScript/editors/vscode-cellscript at main · a19q3/CellScript · GitHub
Latest Release Note:
CellScript - A DSL for Cell-Based Contracts - #12 by ArthurZhang
