Skip to content

Commit 3666a75

Browse files
committed
feat: add canonical Registry Type Script
1 parent 6efbb3b commit 3666a75

23 files changed

Lines changed: 2738 additions & 14 deletions

‎AGENTS.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ require extra tooling.
8888

8989
| Mode | What it does |
9090
| --- | --- |
91-
| `dev` | Explicit workspace-package formatting and checks for the compiler, Fiber adapter, CKB adapter, WASM crate, CKB SDK builder example, `cellscript-tools`, and the independent Registry verifier crate; native source-policy enforcement; strict backend audit (quick); syntax combo audit (quick); parity-gated skill-pack freshness; `git diff --check`. Run before committing. |
92-
| `ci` | `dev` coverage plus tests and clippy for every workspace package, `cellscript-tools`, and the Registry verifier; Registry API tests plus Node API/verifier bundles; full package contents check, website build check (requires `npm`), shell syntax and native source-policy checks, parity-gated skill-pack freshness, and trailing-whitespace check. Run before claiming merge-readiness. |
91+
| `dev` | Explicit workspace-package formatting and checks for the compiler, Fiber adapter, CKB adapter, WASM crate, CKB SDK builder example, `cellscript-tools`, and the independent Registry verifier crate; reproducible Registry Type Script build and CKB-VM tests; native source-policy enforcement; strict backend audit (quick); syntax combo audit (quick); parity-gated skill-pack freshness; `git diff --check`. Run before committing. |
92+
| `ci` | `dev` coverage plus tests and clippy for every workspace package, `cellscript-tools`, the Registry verifier, and the Registry Type Script; Registry API tests plus Node API/verifier bundles; full package contents check, website build check (requires `npm`), shell syntax and native source-policy checks, parity-gated skill-pack freshness, and trailing-whitespace check. Run before claiming merge-readiness. |
9393
| `backend` | For IR / codegen / assembler / ABI / ELF / RISC-V changes: explicit workspace-package format checking, `cargo check --locked -p cellscript --all-targets`, `cargo test --locked -p cellscript`, `cargo clippy ... -D warnings`, strict backend audit (full, which itself fires the CKB stateful-scenarios harness via `cellscript_ckb_stateful_scenarios.sh`), `git diff --check`. |
9494
| `release` / `release-quick` | Everything `ci` does plus release-auxiliary checks (CKB acceptance, NovaSeal pinning, NovaSeal Rust tooling for RISC-V, fresh WASM + VS Code packaging, CKB tx measure tool, etc.) and the CKB acceptance harness (`scripts/ckb_cellscript_acceptance.sh`). These modes need the pinned sibling CKB checkout from `scripts/ckb_acceptance_pin.json`, the NovaSeal submodule, a sibling `ckb-sdk-rust` checkout at tag `v5.1.0`, Docker for the canonical Linux/amd64 WASM build, and `riscv64imac-unknown-none-elf` for NovaSeal verifier builds. Do not run them casually. |
9595

@@ -121,7 +121,7 @@ The root `Cargo.toml` declares a virtual workspace with these members:
121121
- `examples/ckb-sdk-builder`
122122

123123
Excluded from the workspace (still buildable through their own manifests):
124-
`services/registry-verifier`,
124+
`contracts/registry-type-script`, `services/registry-verifier`,
125125
`proposals/novaseal/v0-mvp-skeleton/{harness,verifier}` and
126126
`proposals/novaseal/agreement-profile-v0/harness/ckb_vm`. `tools/ckb-tx-measure`
127127
defines its own `[workspace]` (no parent) because it pulls `ckb-jsonrpc-types`

‎CODING_STYLE.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,28 @@ project contract.
2828
short reason; crate-wide or module-wide clippy allowances are only for
2929
documented legacy or transition boundaries.
3030

31+
## On-Chain Registry Script Rules
32+
33+
`contracts/registry-type-script` is an independent `no_std` CKB Script crate.
34+
Its release binary is part of the Registry trust boundary, not a host utility.
35+
36+
- Build only with the pinned repository toolchain and
37+
`build_reproducible_release.sh`; the script path-remaps sources, strips the
38+
RISC-V ELF, and verifies both SHA-256 and CKB data hash against the tracked
39+
release manifest.
40+
- Keep Script args equal to the 32-byte custody Lock Script hash and the
41+
accepted Cell data exactly `CSREGv1 || 32-byte commitment hash`. Every group
42+
Cell must use that Lock and every transition must consume a Cell using it;
43+
otherwise an unauthorised creator could impersonate an official commitment.
44+
Format changes require a new protocol prefix and migration plan, not a
45+
permissive parser.
46+
- Run the `ckb-testtool` suite for every Script change. Positive creation,
47+
replacement, and destruction plus unauthorised creation, incorrect custody
48+
Locks, malformed input/output, and non-canonical args are mandatory evidence.
49+
- Production deployment requires a live mainnet code Cell, the standard
50+
custody Lock CellDep, sufficient confirmations, and a committed deployment
51+
manifest. Local CKB-VM tests are not mainnet deployment evidence.
52+
3153
## Backend And Codegen Rules
3254

3355
`src/codegen/mod.rs` is the orchestration layer of a multi-file backend.

‎Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ members = [
88
"examples/ckb-sdk-builder",
99
]
1010
exclude = [
11+
"contracts/registry-type-script",
1112
"services/registry-verifier",
1213
"proposals/novaseal/agreement-profile-v0/harness/ckb_vm",
1314
"proposals/novaseal/v0-mvp-skeleton/harness/ckb_vm",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target/

0 commit comments

Comments
 (0)