Skip to content

Commit 54ce199

Browse files
committed
Release CellScript 0.16.2
1 parent 1b75d33 commit 54ce199

15 files changed

Lines changed: 1907 additions & 35 deletions

‎Cargo.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cellscript"
3-
version = "0.16.1"
3+
version = "0.16.2"
44
edition = "2021"
55
rust-version = "1.92.0"
66
autobins = false

‎README.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ policy defaults:
606606
```toml
607607
[package]
608608
name = "token"
609-
version = "0.16.1"
609+
version = "0.16.2"
610610
entry = "src/main.cell"
611611
source_roots = ["src"]
612612

@@ -685,8 +685,9 @@ registry dependency resolution remain experimental and fail-closed.
685685
| `cellc scheduler-plan` | Consume scheduler hints and report serial/conflict policy |
686686
| `cellc ckb-hash` | Compute CKB default Blake2b-256 hashes for builders and release evidence |
687687
| `cellc explain-assumptions` | Emit v0.16 builder-assumption evidence from ProofPlan metadata |
688-
| `cellc validate-tx` | Validate transaction JSON shape against builder assumptions before signing |
689-
| `cellc solve-tx` | Emit a deterministic transaction template from metadata |
688+
| `cellc validate-tx` | Validate transaction JSON shape against builder assumptions before signing; add `--production` to reject fixture-only resource identities |
689+
| `cellc resource-identity` | Generate passive resource identity artifact and plan JSON for output type scripts |
690+
| `cellc solve-tx` | Emit a deterministic transaction template plus resource identity contract from metadata |
690691
| `cellc deploy-plan` | Emit a reproducible deployment plan |
691692
| `cellc verify-deploy` / `diff-deploy` / `lock-deps` | Verify, compare, and lock deployment metadata |
692693
| `cellc proof-diff` / `profile` / `trace-tx` / `audit-bundle` | Emit v0.16 audit and debug reports |

‎docs/CELLSCRIPT_CAPACITY_AND_BUILDER_CONTRACT.md‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,68 @@ A production builder must:
8989
The compiler can give lower bounds and requirements. The builder supplies the
9090
transaction-specific proof.
9191

92+
## Resource Identity Contract
93+
94+
For CKB targets, `constraints.ckb.resource_identities` records the compiler's
95+
current resource identity contract for schema-backed CellScript resources and
96+
receipts.
97+
98+
Statuses have builder meaning:
99+
100+
- `ckb-type-id-builder-managed` means the builder must install the declared CKB
101+
TYPE_ID script and preserve the compiler metadata for that identity.
102+
- `compiler-passive-identity-available` means `cellc resource-identity` can
103+
emit a passive resource identity artifact and JSON plan for that resource.
104+
105+
Scoped action artifacts are active verifiers. They must not be used as passive
106+
type-script identities for newly-created resource Cells. `cellc validate-tx`
107+
rejects transactions whose output type script uses the current scoped action
108+
artifact hash as a resource identity, because CKB would execute that artifact
109+
during output creation and the entry wrapper may expect action witness bytes.
110+
111+
Use `cellc resource-identity` to generate the compiler-owned passive badge:
112+
113+
```bash
114+
cellc resource-identity examples/amm_pool.cell \
115+
--target-profile ckb \
116+
--identity Token=token-a \
117+
--identity Token:token_b_out=token-b \
118+
--identity Pool=pool-main \
119+
--plan-output build/resource-identities.json
120+
```
121+
122+
The plan contains the exact `{ code_hash, hash_type, args }` type script each
123+
created resource Cell should wear. `--identity TYPE=INSTANCE` sets a type-level
124+
default; `--identity TYPE:BINDING=INSTANCE` overrides one create binding when
125+
the same resource type needs more than one passive identity. Production
126+
builders should pass the plan back into validation:
127+
128+
```bash
129+
cellc validate-tx --against build/action.elf.meta.json \
130+
--resource-identities build/resource-identities.json \
131+
build/tx.json --json
132+
```
133+
134+
Fixture scripts such as `always_success` can still be useful in local shape
135+
tests, but they are not production resource identities. Treat them as
136+
`always_success_fixture_only`: acceptable in fixture, harness, or negative-test
137+
contexts; forbidden as the type script for real `MintAuthority`, `Token`,
138+
`Pool`, or `LPReceipt` resource outputs.
139+
140+
For production-facing validation, pass `--production`:
141+
142+
```bash
143+
cellc validate-tx --against build/action.elf.meta.json \
144+
--resource-identities build/resource-identities.json \
145+
--production \
146+
build/tx.json --json
147+
```
148+
149+
In production mode, `validate-tx` rejects known fixture-only resource type
150+
identities such as the devnet `always_success` code hash and all-zero
151+
placeholder hashes. This keeps fixture plumbing useful without allowing it to
152+
become a resource identity scheme.
153+
92154
## Mass Constraints
93155

94156
For CKB, `constraints.ckb` exposes compiler-estimated compute, storage,

‎docs/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ drafts. Released versions should use non-draft filenames.
3535
note and release-evidence summary.
3636
- `docs/releases/CELLSCRIPT_0_16_1_RELEASE_NOTES.md` is the final 0.16.1 release
3737
note and release-evidence summary.
38+
- `docs/releases/CELLSCRIPT_0_16_2_RELEASE_NOTES.md` is the final 0.16.2 release
39+
note and release-evidence summary.
3840

3941
Release candidates and planning notes should not live here unless they are the
4042
final release record.

‎docs/examples/token_amm_bootstrap.md‎

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,31 @@ launch.bootstrap_token or launch.launch_token
3939
`launch_token` materialises the Pool and LP receipt topology directly. It does
4040
not link or call the `amm_pool.seed_pool` entry at runtime.
4141

42+
## Resource Identity Boundary
43+
44+
There are three separate script roles in this flow:
45+
46+
- scoped action artifacts are active verifiers for one selected CellScript
47+
action;
48+
- resource type scripts are passive or lifecycle-stable identity badges for
49+
`MintAuthority`, `Token`, `Pool`, and `LPReceipt` Cells;
50+
- fixture badges such as `always_success_fixture_only` are local test
51+
scaffolding only.
52+
53+
Do not use an action artifact such as `token_mint_with_authority.elf` as the
54+
passive type script for a newly-created resource Cell. CKB executes output type
55+
scripts during creation, so the generated `_cellscript_entry` wrapper will look
56+
for action witness bytes and can fail with `entry-witness-abi-invalid`.
57+
58+
Current compiler metadata exposes this boundary through
59+
`constraints.ckb.resource_identities` and `cellc solve-tx` under
60+
`transaction_plan.resource_identities`. Entries marked
61+
`compiler-passive-identity-available` should be materialized with
62+
`cellc resource-identity`, which emits the passive artifact plus the exact
63+
`{ code_hash, hash_type, args }` scripts to place on resource outputs. A
64+
production builder must not replace that passive identity with the scoped
65+
action artifact.
66+
4267
## Entry Action Selection
4368

4469
Do not rely on "the first action runs on creation" as a protocol rule. Cell
@@ -131,6 +156,20 @@ cellc entry-witness examples/amm_pool.cell \
131156
For `launch_token`, the `distribution` payload is exactly four
132157
`(Address, u64)` entries, so it is 160 bytes: `4 * (32 + 8)`.
133158

159+
## One-Line Builder Contract Bundle
160+
161+
After building the scoped artifact and producing a candidate transaction JSON,
162+
run the compiler-facing contract checks as one shell bundle. Replace `META` and
163+
`TX` with the generated `.meta.json` sidecar and transaction file:
164+
165+
```bash
166+
INPUT=examples/amm_pool.cell ACTION=swap_a_for_b META=build/amm_swap_a_for_b.elf.meta.json TX=build/swap.tx.json RID=build/resource-identities.json MIN_OUT=49000 TO=0x1111111111111111111111111111111111111111111111111111111111111111; cellc resource-identity "$INPUT" --target-profile ckb --identity Token=token-default --identity Token:token_out=token-b --identity Pool=pool-main --identity LPReceipt=pool-main --plan-output "$RID" --json && cellc abi "$INPUT" --target-profile ckb --action "$ACTION" && cellc constraints "$INPUT" --target-profile ckb --entry-action "$ACTION" && cellc solve-tx "$INPUT" --target-profile ckb --entry-action "$ACTION" --primitive-strict 0.16 --json && cellc entry-witness "$INPUT" --target-profile ckb --action "$ACTION" --arg "$MIN_OUT" --arg "$TO" --json && cellc explain-assumptions "$INPUT" --target-profile ckb --entry-action "$ACTION" --primitive-strict 0.16 --json && cellc validate-tx --against "$META" --resource-identities "$RID" "$TX" --production --primitive-strict 0.16 --json
167+
```
168+
169+
`cellc entry-witness` emits the raw `_cellscript_entry` payload. Do not wrap it
170+
in `WitnessArgs.input_type` unless the CellScript source explicitly reads that
171+
separate CKB witness surface.
172+
134173
## ProofPlan And Builder Assumptions
135174

136175
Before signing, builders should inspect both the proof plan and the concrete
@@ -158,7 +197,8 @@ particular, verify:
158197

159198
- each cell-bound parameter resolves to the expected input or output Cell;
160199
- output data matches the generated Molecule schema;
161-
- output type scripts use the intended artifact and script args;
200+
- resource output type scripts follow `constraints.ckb.resource_identities`;
201+
- scoped action artifacts are not used as passive resource type identities;
162202
- CellDeps or script refs resolve to the intended code cells;
163203
- capacity floors and occupied capacity are both satisfied;
164204
- the transaction size and cycle budget are measured from the final
@@ -187,13 +227,16 @@ The relevant flows are:
187227
- AMM lifecycle: seed, add liquidity, swap, and remove liquidity operate on
188228
live `Pool`, `Token`, and `LPReceipt` Cells.
189229

190-
External builder repos should mirror those flows instead of using
191-
`always_success` token stand-ins for the token and pool state path. It is fine
192-
to keep `always_success` locks for pure locking scaffolding, but token Cells,
193-
Pool Cells, LP receipts, and the MintAuthority hand-off should be real
194-
CellScript typed Cells when testing this bootstrap sequence.
230+
External builder repos should mirror those flows, but should treat
231+
`always_success` resource type scripts as `always_success_fixture_only` badges.
232+
They prove the transaction shape is plausible; they do not prove the production
233+
resource identity story. The compiler now exposes passive resource identity
234+
contracts in metadata and emits resource identity plans so builders can fail
235+
early instead of discovering identity mistakes through an opaque action-witness
236+
error. Use `cellc validate-tx --production` to reject known fixture identities
237+
before signing.
195238

196239
The production gate now exercises these flows with original scoped strict
197240
artifacts for `token.cell`, `amm_pool.cell`, and `launch.cell`; generated
198-
harnesses remain only as fallback coverage for examples that are not part of
199-
this bootstrap path.
241+
harnesses and passive fixture badges remain coverage scaffolding, not the
242+
external-builder production identity contract.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# CellScript 0.16.2 Release Notes
2+
3+
**Status**: Released as `v0.16.2`.
4+
5+
**Release date**: 2026-06-21.
6+
7+
**Release tag**: `v0.16.2`.
8+
9+
**Updated**: 2026-06-21.
10+
11+
CellScript 0.16.2 is a builder-ergonomics patch for CKB resource identity
12+
handoff. It keeps the 0.16 compiler/runtime scope, while making external
13+
transaction builders less dependent on copied harness conventions.
14+
15+
## Highlights
16+
17+
- `cellc resource-identity` emits a compiler-owned passive resource identity
18+
artifact and JSON plan for resource output type scripts.
19+
- `cellc validate-tx --resource-identities` checks created resource outputs
20+
against the generated passive identity plan.
21+
- `cellc validate-tx --production` rejects known fixture-only resource
22+
identities, including devnet `always_success` and all-zero placeholders, when
23+
they appear as real resource output type scripts.
24+
- `cellc explain-assumptions` and `cellc solve-tx` can be scoped with
25+
`--entry-action` or `--entry-lock`, so external builders can consume the
26+
selected entrypoint contract instead of whole-module noise.
27+
- `cellc solve-tx --json` now exposes structural builder-evidence requirements
28+
and a fixture identity policy.
29+
- Builder docs clarify that scoped action artifacts are active verifiers and
30+
must not be used as passive `MintAuthority`, `Token`, `Pool`, or `LPReceipt`
31+
resource identities.
32+
33+
## Validation
34+
35+
The release patch was validated with the v0.16 CLI/backend suite:
36+
37+
```bash
38+
cargo test --test v0_16 -- --nocapture
39+
```
40+
41+
The suite covers resource identity plan generation and validation, scoped
42+
assumption/solver output, wildcard structural evidence requirements, active
43+
artifact misuse rejection, and production fixture-identity rejection.

‎docs/releases/CELLSCRIPT_0_16_RELEASE_NOTES.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ In practical terms, this means:
4343
The initial 0.16.0 release kept some bundled-example bootstrap paths
4444
conservative. The current 0.16 patch line closes the token/AMM/launch and NFT
4545
first-cell lifecycle gaps; see
46-
`docs/releases/CELLSCRIPT_0_16_1_RELEASE_NOTES.md` for the current production
46+
`docs/releases/CELLSCRIPT_0_16_2_RELEASE_NOTES.md` for the current production
4747
example evidence.
4848

4949
### Better Builder Handoff

‎docs/wiki/Home.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ Release-facing CKB evidence comes from the repository root:
152152
```
153153

154154
The bundled examples are covered by the current local production evidence suite.
155-
The 0.16.1 patch line also closes the token/AMM/launch and NFT first-cell
156-
bootstrap examples used by external builders.
155+
The 0.16.2 patch line also closes the token/AMM/launch and NFT first-cell
156+
bootstrap builder handoff, including passive resource identity checks.
157157
New external contracts still need their own metadata review, builder evidence,
158158
security review, and chain acceptance evidence before they should be called
159159
production-ready.

‎docs/wiki/Tutorial-11-Scoped-Invariants-and-ProofPlan.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,5 +405,5 @@ commands unless you create a `Cell.toml` there.
405405
contracts.
406406
- Read `docs/releases/CELLSCRIPT_0_15_RELEASE_NOTES.md` for the release boundary.
407407
- Read `roadmap/CELLSCRIPT_0_16_ROADMAP.md` and
408-
`docs/releases/CELLSCRIPT_0_16_1_RELEASE_NOTES.md` for the implemented
408+
`docs/releases/CELLSCRIPT_0_16_2_RELEASE_NOTES.md` for the implemented
409409
0.16 ProofPlan soundness and metadata-assurance boundary.

0 commit comments

Comments
 (0)