All planned phases (P0-P5) implemented. 103 unit + 11 integration + 28 anvil tests passing.
- P0: Tier system, privacy levels, attestation scoring
- P1: Input validation, normalizeInputs
- P2: Proof type mappings, XochiVerifier, OracleLite, circuit sync, frontend migration
- P3: Timestamp recency, pattern time_window bounds, integration tests (all 6 circuits)
- P4: Cross-repo anvil validation (16 tests in erc-xochi-zkp/test/sdk/xochi-sdk.test.ts)
- P5: Proof binding -- submitter field in compliance/risk_score circuits, oracle enforces submitter == msg.sender, consumer.test.ts updated (28 tests)
Bug fixes found during implementation:
- tier-proofs.ts provider_set_hash mismatch
- non-membership input builder missing timestamp
- consumer.test.ts risk_score inputs missing num_providers/provider_ids (fixed in P5)
- Type error fix in execution-orchestrator test (readonly tuple vs mutable VenueId[])
- Missing exports: 6 input builder functions added to index.ts
- XIP-1/XIP-2 integration tests (6 tests, real Barretenberg proofs)
- Settlement Registry integration tests (7 tests, full contract stack on anvil)
- Oracle + Verifier anvil integration (15 tests: submit, check, history, verify, batch, versioned)
- OracleLite parity tests (4 tests: checkCompliance, attestation fields, verifyProof)
- OracleLite bug fixes: wrong checkCompliance selector (0x9ec48178 -> 0xd1e8eba9), incorrect ABI offset decoding for static structs
- Removed duplicate BrowserCircuitLoader from circuits.ts
- Added prepublishOnly script, typecheck script, GitHub Actions CI
- Oracle.submitBatch: batch submit proofs from BatchProveResult, returns proofHashes for settlement
- Full XIP-1 lifecycle test: proveBatch -> submitBatch -> registerTrade -> recordSubSettlements -> finalize
- Total: 190 tests passing (145 unit + 45 integration)
- Contract alignment:
setVerifier->setVerifierInitial(verifier timelock pattern) - ABI:
ComplianceAttestationstruct gainedproofTypefield (10 fields, was 9) - OracleLite:
decodeAttestationupdated for 10-field struct layout - Integration tests: timestamps use current time (contract enforces
MAX_PROOF_AGE = 1h) - Integration tests: pattern public inputs include
submitter(contract enforces for all proof types) - CLAUDE.md: documented circuit vs on-chain public input count gap, verifier timelock, MAX_PROOF_AGE
Aligned SDK with erc-xochi-zkp@828a41b (security hardening + emergency verifier revocation) and bumped to 0.1.1 for first publish.
Upstream alignment:
- Re-synced 6 circuit artifacts after recompiling upstream with nargo
1.0.0-beta.20(upstream source had drifted to beta.20 syntax; CI pin was stale) PUBLIC_INPUT_COUNTS: pattern 5→6, attestation 5→6, membership 4→5, non_membership 4→5 (all 4 circuits gainedsubmitteras a public input -- "submitter gap" closed)submitternow required on all 4 affected input builders (was previously appended SDK-side at submission time)XochiOracle.checkComplianceByType()-- query attestations filtered by proof typeXochiVerifier.isVersionRevoked()+revokeVerifierVersion()+VerifierVersionRevokedevent -- emergency revocation APIXochiOracle.submitBatchrewired to on-chainsubmitComplianceBatch(single atomic tx, max 100 proofs);MAX_BATCH_SIZEconstant exported
Polish (publish hygiene):
- Typed contract errors (
src/errors.ts):XochiContractErrorbase + 12 named subclasses (SubmitterMismatchError,ProofAlreadyUsedError, etc.);decodeContractError+withDecodedErrorshelpers; all write methods now throw typed errors. Full ABI error entries added toORACLE_ABIandVERIFIER_ABI. submittertyped as viemAddress(wasstring); newvalidateSubmitterrejects zero address fail-fast- Killed
as anyon allwriteContractcalls viaviem/actionsand tightened generics; newConfiguredWalletClienttype alias - Centralized
EXPECTED_NOIR_VERSIONinsrc/noir-version.ts - Drift test for
DEFAULT_CONFIG_HASH(asserts the hardcoded value matches the circuit'sconfig_hashfor single-provider proofs) CHANGELOG.mdadded;package.jsonbumped to0.1.1- Test count: 199 (was 190) -- +8 unit (errors), +1 integration (drift)
- Dynamic re-splitting (retry failed sub-trades with new split plan)
- Relayer/meta-transaction support (bind to recipient instead of msg.sender)
- Cross-chain settlement coordination
- Bump
@noir-lang/noir_jsto1.0.0-beta.20once a stable (non-nightly) release lands on npm