CKB Script
Binary executables that run on CKB-VM to implement smart contract logic.
A Script in CKB is a binary executable that can be executed on-chain. It is a program that runs on a virtual machine powered by the RISC-V instruction set, called the CKB-VM, and can perform arbitrary logic to guard and protect your Cells. You can think of it as smart contract.
Key Characteristics
RISC-V Based
Runs on CKB-VM powered by the RISC-V instruction set
Binary Executable
Compiled binary code that executes deterministically on-chain
Arbitrary Logic
Can implement any computation logic to validate transactions
Cell Protection
Guards and protects Cells through validation rules
Types of Scripts
Lock Script
A required Script controlling the ownership and access to a Cell, ensuring only authorized users can spend/consume the Cell.
Type Script
An optional Script dictating how a Cell can be used or modified in a transaction.
Role in RGB++
CKB Scripts in RGB++ implement the validation logic for isomorphic binding, ensuring that Bitcoin UTXO operations are properly synchronized with CKB Cell state changes. They enforce the rules that maintain the integrity of the RGB++ protocol.