-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Tawan edited this page Apr 22, 2026
·
11 revisions
CellScript is a domain-specific language for Cell-based smart contracts on Spora and CKB. It compiles .cell source into ckb-vm compatible RISC-V assembly or ELF artifacts and emits metadata for schema auditing, target-profile policy checks, artifact verification, and Spora scheduler-aware execution.
This wiki is a practical tutorial set. It focuses on writing contracts, compiling them, checking portability, and preparing artifacts for Spora or CKB deployment.
- Getting Started
- Language Basics
- Resources and Cell Effects
- Packages and CLI Workflow
- Spora and CKB Target Profiles
- Metadata, Verification, and Production Gates
- LSP and Tooling
- Bundled Example Contracts
CellScript v1 supports:
-
.cellmodules with typed declarations and executableaction/lockentries. - Cell-native persistent values through
resource,shared, andreceipt. - Explicit Cell effects:
consume,create,read_ref,transfer,destroy,claim, andsettle. - RISC-V assembly and ELF output for ckb-vm compatible execution.
-
spora,ckb, andportable-celltarget profiles. - Metadata sidecars and artifact verification.
- A beta package manager based on
Cell.toml, local source roots, and local path dependencies. - LSP support for editor diagnostics, hover, completion, references, rename, formatting, and lowering metadata.
git clone https://github.com/tsukifune-kosei/CellScript.git
cd CellScript
cargo test --locked
cargo run --locked --bin cellc -- examples/token.cell --target riscv64-elf --target-profile spora -o /tmp/token.elf
cargo run --locked --bin cellc -- verify-artifact /tmp/token.elf --expect-target-profile sporaUse the CKB profile for admitted portable/pure contracts:
cargo run --locked --bin cellc -- examples/token.cell --target riscv64-elf --target-profile ckb -o /tmp/token.ckb.elf
cargo run --locked --bin cellc -- verify-artifact /tmp/token.ckb.elf --expect-target-profile ckbSome complex examples intentionally exercise Spora-only or runtime-required shapes. The compiler should reject unsupported CKB shapes by policy instead of silently producing an unsafe artifact.