Skip to content
LogoLogo

Params

#[weld::params] on a struct generates:

  • A canonical flattening to [Field; N] (u128 → 1 limb, arrays inline), plus a hidden salt: Field limb.
  • params_commitment = H(PARAMS, schema_hash, salt, flattened...).
  • A witness slot and the weld assert(commit(p) == params_commitment) in every generated main.
  • A JSON schema entry in the manifest and weld params set --cap 500e18, which samples a fresh salt, encodes, commits, and submits setParams.

Rule of thumb documented for authors: constants that define what the policy is go in code; numbers a compliance officer tunes go in params. Both are private; both are auditable by the FI's own tooling.