Note: The Interfold was previously known as Interfold.
Many repositories, packages, and CLI tools still use theinterfoldname while the project transitions.
This is the monorepo for The Interfold, an open-source protocol for confidential coordination.
The Interfold leverages a combination of Fully Homomorphic Encryption (FHE), Zero-Knowledge Proofs (ZKPs), and Multi-Party Computation (MPC) to enable Encrypted Execution Environments (E3), with integrity and privacy guarantees rooted in cryptography and economics, rather than hardware and attestations.
Full documentation is available at: https://docs.theinterfold.com
Follow instructions in the quick start section of the documentation.
See the CRISP example for a fully functioning example application.
Join the community Telegram group.
See CONTRIBUTING.md.
Maintainers use RELEASING.md for shared-workspace releases and domain documentation for cross-layer contracts and known limits.
This section covers the essential commands for setting up and working with the Interfold codebase locally.
# Install dependencies
pnpm i
# Build the project
pnpm build
# Clean build artifacts
pnpm cleanUse the root pnpm scripts for full/layer suites: their setup builds binaries and fixtures that raw
tool commands can omit. Focused cargo test -p and cargo check -p are also supported once the
affected suite's prerequisites are prepared.
The monorepo provides several test scripts for different components:
-
pnpm test- Runs all tests across the entire monorepo:- EVM/Smart contract tests (
evm:test) - Rust crate tests (
rust:test) - SDK tests (
sdk:test) - Noir circuit tests (
noir:test)
- EVM/Smart contract tests (
-
pnpm rust:test- Runs all Rust crate tests in thecrates/directory. This script runs tests for all crates in the workspace, not just ciphernode-related crates. -
pnpm evm:test- Runs tests for the EVM smart contracts inpackages/interfold-contracts. -
pnpm sdk:test- Runs tests for the TypeScript SDK inpackages/interfold-sdk. -
pnpm noir:test- Runs tests for Noir circuits in thecircuits/directory usingnargo test. Requires the Noir toolchain (nargo) and Barretenberg (bb) to be installed and on yourPATH. -
pnpm test:integration- Runs integration tests fromtests/integration/. These tests may require prebuilt binaries and can be run with--no-prebuildif binaries are already available. Pre-built circuit artifacts for the configured BFV preset must be present in thecircuits/artifacts directory.
Fast pnpm sdk:test mocks the prover API boundary; it does not verify a real cryptographic proof.
The separate pnpm sdk:test:proofs suite prepares a proof and rejects tampered proof/public inputs;
pnpm sdk:test:proofs:prepared reuses an already prepared build/circuit set.
Before pnpm rust:test:proofs or the full pnpm test, prepare the matching insecure-minimum inner
and recursive circuits with
pnpm build:circuits --preset insecure-64 --committee minimum --skip-if-built. Proof substitution
tests additionally need pinned nargo on PATH. Before pnpm rust:test:slashing, run pnpm evm:build
and provide Anvil. The named proof/slashing suites fail when prerequisites are missing; ordinary
Rust runs leave these expensive tests ignored. A successful fast suite is not evidence that they
ran. See artifact requirements.
# Run only Rust crate tests
pnpm rust:test
# Run only EVM/smart contract tests
pnpm evm:test
# Run only SDK tests
pnpm sdk:test
# Run only Noir circuit tests
pnpm noir:test
# Run only integration tests
pnpm test:integration
# Run integration tests without prebuild step (if binaries already exist)
pnpm test:integration --no-prebuildThis workspace's minimum supported rustc version is 1.91.1.
The Interfold employs a modular architecture involving numerous actors and participants. The sequence diagram below offers a high-level overview of the protocol, but necessarily omits most detail.
sequenceDiagram
participant Users
participant Interfold
participant CiphernodeRegistry
participant RandomnessProvider
participant E3Program
participant ComputeProvider
participant CiphertextVerifier
participant DecryptionVerifier
participant Ciphernodes
Users->>Interfold: request(parameters)
Interfold->>E3Program: validate(e3ProgramParams)
Interfold->>ComputeProvider: validate(computeProviderParams)
ComputeProvider-->>Interfold: decryptionVerifier
Interfold->>CiphernodeRegistry: requestCommittee(e3Id, legacySeed, threshold)
CiphernodeRegistry->>RandomnessProvider: requestRandomness(e3Id)
RandomnessProvider-->>CiphernodeRegistry: requestId
CiphernodeRegistry-->>Interfold: success
Interfold-->>Users: e3Id, E3 struct
Note over RandomnessProvider: Chainlink verifies and stores the VRF response
CiphernodeRegistry->>RandomnessProvider: getRandomness(requestId)
RandomnessProvider-->>CiphernodeRegistry: random word and fulfillment context
Users->>Interfold: activate(e3Id)
Interfold->>CiphernodeRegistry: committeePublicKey(e3Id)
CiphernodeRegistry-->>Interfold: publicKey
Interfold->>Interfold: Set expiration and committeePublicKey
Interfold-->>Users: success
Users->>CRISPServer: stage encrypted input + Noir proof
CRISPServer-->>Users: signed compact commitment
Users->>E3Program: publishInput(e3Id, commitment)
E3Program-->>Users: InputCommitted
CRISPServer->>Avail: submit_data(encryptedInput)
CRISPServer->>E3Program: finalizeInput(e3Id, VectorX receipt)
E3Program-->>CRISPServer: InputPublished
ComputeProvider-->>CRISPServer: aggregateCiphertext + OpenVM proof
CRISPServer->>E3Program: verify output proof (read only)
CRISPServer->>Avail: submit_data(aggregateCiphertext)
CRISPServer->>Interfold: publishCiphertextOutput(e3Id, reference + VectorX receipt)
Interfold->>E3Program: verifyDataAvailability(contentHash, receipt)
Interfold->>CiphertextVerifier: verify compute proof
CiphertextVerifier-->>Interfold: success
Interfold->>E3Program: verify compute proof
E3Program-->>Interfold: success
Interfold->>Interfold: Store ciphertextOutput
Interfold-->>CRISPServer: success
Ciphernodes->>Avail: retrieve aggregateCiphertext
Ciphernodes->>Interfold: publishPlaintextOutput(e3Id, data)
Interfold->>E3Program: verify(e3Id, data)
E3Program-->>Interfold: output, success
Interfold->>DecryptionVerifier: verify plaintext proof
DecryptionVerifier-->>Interfold: success
Interfold->>Interfold: Store plaintextOutput
Interfold-->>Ciphernodes: success
RELEASING.md owns release preparation, qualification, tagging, and publication.
pnpm bump:versions prepares release files by default; --commit and --push explicitly enable
Git operations. Its dry run is read-only. Tagging is a separate command after the release PR merges
and qualifies on main.
Follow the release branch and tag sequence. Stable and prerelease publications use different channels; neither implies protocol compatibility.
The tag workflow does not repeat the repository CI that qualified the merged main commit. It
checks protected history, builds binaries, and requires a complete source-matched circuit matrix
before publication. See
publication checks and outputs for containers,
npm, DAppNode, and GitHub assets. Rust workspace crates are not published to crates.io.
The Interfold follows Semantic Versioning:
- Stable:
v1.0.0- Production ready - Pre-release:
v1.0.0-beta.1- Testing/preview versions-alpha.X- Early development, may have breaking changes-beta.X- Feature complete, testing for bugs-rc.X- Release candidate, final testing
Use stable versions only:
curl -fsSL https://raw.githubusercontent.com/theinterfold/interfold/main/install | bash # Latest release
interfold update --version v1.0.0 # Change to a specific stable versionYou can use pre-release versions. install without --version always selects the latest release:
interfold update --version dev # Most recently published release, stable or pre-release
interfold update --version v1.0.0-dev.1 # Specific pre-releaseBuild from source:
git clone https://github.com/theinterfold/interfold.git
cd interfold
cargo build --releasemain- Latest code. All releases are tagged from here. Using feature flags for experimental features, we ensure that code is always stable.v*.*.*- Version tags for releasesstable- Always points to the latest stable release
# Latest stable release (recommended for production)
curl -fsSL https://raw.githubusercontent.com/theinterfold/interfold/stable/install | bash
# Latest development version (may be unstable)
curl -fsSL https://raw.githubusercontent.com/theinterfold/interfold/main/install | bashUse the qualification and release procedure, not a second checklist here. After successful publication, verify the packages on npm, GitHub binaries, and changelog before announcing or deploying the release.
The release guide's command table distinguishes
dry-run, file-only, local-commit, and push modes. File-only preparation still updates manifests,
lockfiles, and the changelog; use --dry-run for a read-only preview.
Follow channels and recovery, including the protocol rollback decision. Deprecating an npm version does not roll back deployed contracts or node state.
Check our Releases page for full version history and changelogs.
This repo is provided WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This repo created under the LGPL-3.0+ license.