Zcash ZIPs
Theme
Appearance
Contents

Unnumbered proposal

Circle STARK Verification as a Transparent Zcash Extension

Draft

Terminology

The key words “MUST”, “SHOULD”, and “MAY” are to be interpreted as described in BCP 14 1 when, and only when, they appear in all capitals.

Abstract

This ZIP defines a new Transparent Zcash Extension that verifies a bounded‑size Circle STARK 2 proof. The extension has a single type and a single mode, and exposes a compact precondition/witness interface suitable for verifying validity proofs of a Starknet-style scaling solution 3 on Zcash. It specifies:

This ZIP does not change Sapling/Orchard; it only adds a TZE that can be used to enforce state transition of a Starknet chain or other validity claims.

Motivation

Zcash’s programmability is restricted by the Bitcoin script, which lacks sufficient expressiveness and implies high costs that limit throughput. A Starknet‑style scaling solution can address the issue by providing an expressive programming language (Cairo 5), a ZK friendly virtual machine, and an effective proving system (Stwo 6) that compresses large computation into a succinct proof, suitable for onchain verification. A custom transparent extension 7 is the cleanest way to introduce such verifier and enable scaling solutions on top of Zcash.

Requirements

Specification

TZE identification

All serialization below is inside the tze_data_payload defined by 7; lengths are compactSize.

Precondition (prefix‑free)

u16  param_id         // selects a pinned Stwo verifier parameter set (see below)
u8   flags            // bit 0 = bind_ctx; all other bits MUST be 0
vec  pub_in           // public inputs to the proved statement (len + bytes)
if (flags & 0x01) {
    bytes32 ctx_digest   // non-malleable transaction digest
}

Witness (prefix‑free)

vec  proof            // the Stwo (Circle STARK) proof object (len + bytes)

The proof MUST conform to the Stwo proof object format pinned by param_id.

Verification

bool tze_verify(0, precondition, witness, context):

  1. Parse param_id; load the exact pinned parameter set. Reject if unknown.
  2. Parse flags; if any reserved bits set, reject.
  3. If bind_ctx, compute the required ctx_digest from context and compare; on mismatch, reject. ([Zcash Zips][3])
  4. Parse pub_in and proof. Enforce all consensus bounds (see Bounds).
  5. Initialize the Stwo transcript/channel, absorb pub_in exactly, and verify proof using the parameters pinned by param_id.
  6. Return true iff the verifier accepts; otherwise return false.

Parameter sets (param_id)

The namespace is 16‑bit (0x0001..0xFFFF). This ZIP introduces:

Normative reference material for STWO_V1_P1 (encodings, proof format, prover parameters) is included alongside this ZIP in zip-XXXX/params/STWO_V1_P1.json and the accompanying test vectors. These files are to be treated as normative parts of this specification.

Future parameter sets (e.g., different hash suite or query caps) MAY be proposed under new param_ids in a subsequent ZIP.

Bounds (consensus)

Let the following consensus constants be defined for this (type, mode):

Nodes MUST reject if any bound is exceeded, and MUST NOT allow denial of service via memory exhaustion due to allocating memory before bounds are checked.

Fee model

Follows ZIP-317 8.

TODO: introduce an adapted fee model with discounted price per byte (rationale: large proof size does not reflect the cost of the verification)

TODO: introduce a rate limiting policy that prevents crowding out non-TZE transactions

Rationale

Privacy Implications

No changes to Sapling/Orchard. Protocols built on top MUST document their own privacy model (e.g., DA choices, metadata leakage). This ZIP’s verifier only checks validity of a statement over public inputs; it does not guarantee zero‑knowledge unless the prover uses a ZK proof generation mode.

Backward Compatibility

Nodes that do not implement this TZE will reject transactions that use it after activation. Because TZE uses a distinct TZE unspent set and separate fields (tze_inputs/tze_outputs), existing transparent and shielded logic is unaffected.

Deployment

Security Considerations

Reference Implementation

TBD

Test Vectors

TBD

References