Design & Operations Best Practices
Competitor docs such as Fhenix's "Key Considerations" and Ritual's architecture primers emphasize clear guardrails for confidential compute. This guide distills the equivalent playbook for Enclave.
Parameter Strategy
- Thresholds: Choose
threshold = [t, n]so thattwithstands your adversary model whilenmatches available Ciphernodes. Higher thresholds improve collusion resistance but increase fees. - Timing Windows: Ensure
startWindowleaves enough time for committee selection (a few blocks) anddurationmatches the longest credible compute time plus buffer. - Custom Params: Use
customParamsinE3RequestParamsto tag jurisdiction, use case, or feature toggles without redeploying contracts.
Input Validation
- Push logic to validators: Implement
IE3Program.validateInputso ZK proofs and policy checks happen before the Secure Process. This mirrors how CoFHE tutorials offload range proofs from the heavy computation path. - Replay protection: Include round identifiers or nullifiers inside inputs before you hash them into the Lean IMT.
- Access control: Gate inputs via registries (e.g., DAO membership) or staking requirements to keep spam out of the queue.
Secure Process & Compute Providers
- Determinism: Reconstruct the on-chain Merkle root inside the Secure Process, then assert equality prior to any heavy math.
- Proof hooks: When using RISC Zero or other verifiable CPs, keep witness blobs small and
reserve
computeProviderParamsfor runtime toggles (precision, chunk size, etc.). - Failover: Decide how your app reacts if
CiphertextOutputPublishednever arrives—e.g., allow a guardian to cancel the round and refund deposits.
Key Material & Ciphernodes
- Key hygiene:
dev:setupwipes.enclavedirectories for you; mimic that behavior in production by rotating committee keys when nodes churn. - Monitoring: Subscribe to
E3ActivatedandPlaintextOutputPublishedevents to ensure the CiCo publishes keys and decryptions on schedule. - Operator docs: Keep the Ciphernode Operators runbooks close to your app documentation so node providers can mirror your expectations.
Observability & Tooling
- Structured logs: Adopt the logging schema from the CRISP server (JSON with
e3_idand phase) so you can stitch together end-to-end traces. - Synthetic tests: Reuse
pnpm dev:up+ Playwright to run rehearsal rounds on CI before shipping new circuits or SDK releases. - Dashboarding: Track request fees, committee saturation, and mean time from
requesttoPlaintextOutputPublishedjust like Ritual exposes node specialization metrics.
Deployment Checklist
- Run
pnpm dev:buildto preflight the entire stack. - Execute integration tests that cover
request → publishInput → publishCiphertextOutputwith mock proofs. - Verify wallet funding for any automation (enclave CLI, Hardhat deployers).
- Update onboarding docs (MetaMask, scripts) when RPC URLs or ports change.
- Publish a postmortem template so incidents have consistent follow-up.
Pair these practices with the Use Cases catalog to craft predictable launch plans.