You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the positive runtime semantics for BoundedList<P, N>::create_each.
The compiler already retains the plan predicate and create template, but production builds correctly reject the operation because there is no canonical witness codec or on-chain proof that every plan corresponds to exactly one output Cell in the required order, with the required identity, Script, data, lock, and capacity.
This issue depends on the selection and decoding foundations in #7, but it remains separate because output authorization and one-to-one correspondence have a larger attack surface than bounded input consumption.
Portfolio status
This is a candidate consensus-runtime workstream, not an authorized 0.26 or P0 implementation commitment. Until the post-0.25 evidence review accepts concrete use cases, an accountable owner, an independent reviewer, capacity, and stop conditions, only Phase 0 specification and use-case discovery are authorized. The issue priority describes semantic risk, not a promised release slot.
Security statement
A transaction builder may construct a plausible transaction, but builder behavior is not a consensus boundary. The emitted CKB Script must independently prove:
plan count == selected output count <= N
and
for every i: plan[i] authorizes exactly selected_output[i]
Missing, extra, duplicated, or reordered outputs must fail on chain.
a versioned canonical Molecule list in WitnessArgs.input_type;
a compile-time maximum N and runtime count enforcement;
canonical Type Script group-relative output ordering;
exact one-to-one plan/output correspondence;
one evaluation of each plan predicate and one materialization of each output template;
explicit Type Script, Lock Script, data schema, and capacity policies;
an explicit identity rule for every created resource;
stable failures for omission, duplication, reordering, malformed plans, and under-capacity outputs;
builder evidence that mirrors—but never replaces—the checks performed by the Script.
The accepted RFC must decide whether the initial version permits zero plans. It must not infer freshness or authority from action/function names.
Correspondence model
sequenceDiagram
participant B as Transaction builder
participant W as Witness PlanList
participant T as Candidate outputs
participant V as CellScript verifier
B->>W: encode versioned plans
B->>T: construct candidate outputs
V->>W: decode and bound count
V->>T: select canonical group outputs
loop each index i
V->>V: validate plan[i] against output[i]
end
V-->>B: accept only if all pairs and counts match
Loading
The builder and verifier must use the same ordering specification. A global-index witness is acceptable only if the Script proves uniqueness, monotonicity, group membership, and complete coverage.
Required failure taxonomy
Failure
Required behavior
missing or empty required witness field
stable witness/codec error
unknown plan codec version
reject
malformed offset table or truncated item
stable Molecule error
plan count greater than N
stable count error
fewer outputs than plans
stable missing-output error
more outputs than plans
stable extra-output error
reordered outputs
stable correspondence error
duplicate plan or output index
stable duplication error
wrong Type Script or Lock Script
stable Script-policy error
wrong data/schema
stable output-data error
insufficient capacity
stable capacity error
reused identity where freshness is required
stable identity error
machine block removed
standalone checker rejects the mutation
Implementation phases
Phase 0 — specification
Extend or add an accepted RFC that fixes:
witness field and Molecule schema;
codec versioning and canonical encoding;
output selection source and ordering;
count and zero-element behavior;
one-to-one correspondence;
Script/data/lock verification;
occupied-capacity policy;
fresh and preserved identity policies;
ProofPlan and typed-semantics records;
error codes and resource budgets.
Phase 1 — codec and typed boundary
generate and verify the canonical plan-list codec;
bind codec identity into entry ABI and metadata;
retain the full create template and predicate in typed semantics;
add separate ProofPlan obligations for decode, count, selection, ordering, pair correspondence, identity, and capacity;
make the builder manifest generate a fillable but non-authoritative plan skeleton.
Phase 2 — CKB runtime lowering
decode once with strict bounds;
select group-relative outputs canonically;
compare counts before materialization;
lower a deterministic bounded pair loop;
verify all output fields the compiler claims are constructed;
retain fail-closed behavior for every unsupported shape.
Phase 3 — independent verification and builder parity
teach the standalone checker to link every pair-validation block to typed semantics and source ranges;
add mutations deleting or bypassing count, ordering, identity, capacity, and data checks;
ensure generated builders and cellc tx validate use the same ordering and codec;
run every positive and adversarial fixture in simulator, CKB-VM, and the stateful harness.
Acceptance matrix
Case
Expected
zero plans/outputs when allowed
pass
one plan/output
pass
exactly N pairs
pass
N + 1 plans
stable count error
missing output
stable missing-output error
extra output
stable extra-output error
reordered outputs
stable correspondence error
duplicated plan or selected output
stable duplication error
wrong Type Script
stable Script-policy error
wrong Lock Script
stable Script-policy error
wrong data payload
stable schema/data error
under-capacity output
stable capacity error
reused Type ID or logical identity
stable identity error
valid builder output with one adversarial post-build mutation
CKB-VM rejects
removed correspondence block in ELF
standalone checker rejects
Completion criteria
An accepted RFC fixes the codec, ordering, identity, and capacity contracts.
Supported shapes no longer emit runtime error 24 or E2105.
Summary
Implement the positive runtime semantics for
BoundedList<P, N>::create_each.The compiler already retains the plan predicate and create template, but production builds correctly reject the operation because there is no canonical witness codec or on-chain proof that every plan corresponds to exactly one output Cell in the required order, with the required identity, Script, data, lock, and capacity.
This issue depends on the selection and decoding foundations in #7, but it remains separate because output authorization and one-to-one correspondence have a larger attack surface than bounded input consumption.
Portfolio status
This is a candidate consensus-runtime workstream, not an authorized 0.26 or P0 implementation commitment. Until the post-0.25 evidence review accepts concrete use cases, an accountable owner, an independent reviewer, capacity, and stop conditions, only Phase 0 specification and use-case discovery are authorized. The issue priority describes semantic risk, not a promised release slot.
Security statement
A transaction builder may construct a plausible transaction, but builder behavior is not a consensus boundary. The emitted CKB Script must independently prove:
Missing, extra, duplicated, or reordered outputs must fail on chain.
flowchart LR W["WitnessArgs.input_type"] --> CODEC["Decode versioned PlanList<P>"] CODEC --> PC["plan_count"] GO["Canonical group-relative outputs"] --> OC["output_count"] PC --> EQ{"plan_count == output_count <= N?"} OC --> EQ EQ -- "no" --> REJECT["Stable correspondence error"] EQ -- "yes" --> ZIP["Zip plan[i] with output[i]"] ZIP --> SCRIPT["Verify Type/Lock Script policy"] SCRIPT --> DATA["Verify canonical output data"] DATA --> CAP["Verify occupied capacity floor"] CAP --> ID["Verify fresh/preserved identity policy"] ID --> ACCEPT["Every pair covered exactly once"]Required semantic contract
The first supported shape should require:
WitnessArgs.input_type;Nand runtime count enforcement;The accepted RFC must decide whether the initial version permits zero plans. It must not infer freshness or authority from action/function names.
Correspondence model
sequenceDiagram participant B as Transaction builder participant W as Witness PlanList participant T as Candidate outputs participant V as CellScript verifier B->>W: encode versioned plans B->>T: construct candidate outputs V->>W: decode and bound count V->>T: select canonical group outputs loop each index i V->>V: validate plan[i] against output[i] end V-->>B: accept only if all pairs and counts matchThe builder and verifier must use the same ordering specification. A global-index witness is acceptable only if the Script proves uniqueness, monotonicity, group membership, and complete coverage.
Required failure taxonomy
NImplementation phases
Phase 0 — specification
Extend or add an accepted RFC that fixes:
Phase 1 — codec and typed boundary
Phase 2 — CKB runtime lowering
Phase 3 — independent verification and builder parity
cellc tx validateuse the same ordering and codec;Acceptance matrix
NpairsN + 1plansCompletion criteria
tx validateagree.dev,ci, andbackendgates pass.Non-goals
Dependencies
References