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.
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 cleancargo test or other
build tools. The pnpm scripts ensure necessary setup steps are executed (e.g., building required
binaries, setting up test environments) that may be skipped when running tests directly.
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.
# 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-prebuild|
Π³Ξ» |
Hamza Khalid |
ctrlc03 |
Auryn Macmillan |
Cedoor |
Giacomo |
|
samepant |
CristΓ³vΓ£o |
Nathan Ginnever |
Malingshu |
marv |
Bryant |
|
Zara |
Armanc |
SUBHASISH BEHERA |
Jan-Felix |
callumweb3 |
cryptam |
This 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 DecryptionVerifier
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->>Interfold: publishInput(e3Id, data)
Interfold->>E3Program: validateInput(msg.sender, data)
E3Program-->>Interfold: input, success
Interfold->>Interfold: Store input
Interfold-->>Users: success
Users->>Interfold: publishCiphertextOutput(e3Id, data)
Interfold->>DecryptionVerifier: verify(e3Id, data)
DecryptionVerifier-->>Interfold: output, success
Interfold->>Interfold: Store ciphertextOutput
Interfold-->>Users: success
Users->>Interfold: publishPlaintextOutput(e3Id, data)
Interfold->>E3Program: verify(e3Id, data)
E3Program-->>Interfold: output, success
Interfold->>Interfold: Store plaintextOutput
Interfold-->>Users: success
# On a release branch: update versions, commit, and push the branch.
pnpm bump:versions 1.0.0
# Open a pull request. Wait for CI, then merge it.
# On an updated and clean main branch: create the release tag.
git checkout main
git pull --ff-only
pnpm release:tag 1.0.0bump:versions never creates a release tag. release:tag accepts only the exact origin/main
commit and starts the release workflow.
- Create a release branch from current
main. - Run
pnpm bump:versions X.Y.Z. - Open a pull request and wait for all required CI jobs.
- Merge the release pull request.
- Update local
mainwithgit pull --ff-only. - Run
pnpm release:tag X.Y.Z. - Wait for the Release workflow.
For a pre-release, use a semantic pre-release version:
pnpm bump:versions 1.0.0-beta.1
pnpm release:tag 1.0.0-beta.1The tag workflow does not repeat the repository CI that qualified the merged main commit.
Publication cannot start until these release checks succeed:
- The tag points to a commit in
origin/main. - Linux and Apple Silicon binaries build.
- The
circuit-artifactsbranch contains the complete source-matched release matrix.
After qualification, the workflow publishes versioned container images and npm packages. A stable
release also builds the DAppNode package. It then promotes the latest container aliases and the
stable Git tag. The GitHub release is the final step. Rust workspace crates are not published to
crates.io because the workspace uses unreleased git dependencies.
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:
interfoldup install # Latest stable
interfoldup install v1.0.0 # Specific stable versionYou can use pre-release versions:
interfoldup install --pre-release # Latest pre-release
interfoldup install v1.0.0-beta.1 # Specific pre-releaseBuild from source:
git clone https://github.com/gnosisguild/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/gnosisguild/interfold/stable/install | bash
# Latest development version (may be unstable)
curl -fsSL https://raw.githubusercontent.com/gnosisguild/interfold/main/install | bashFor maintainers doing a release:
- Ensure all tests pass on
main - Review commits since last release for proper conventional format
- Decide version number (major/minor/patch)
- Create a release branch and run
pnpm bump:versions X.Y.Z - Merge the release pull request only after CI passes
- Update local
mainand runpnpm release:tag X.Y.Z - Confirm the Release workflow passes before deployment
- Verify packages on npm
- Check GitHub release page for binaries and changelog
- Announce release (Discord/Twitter/etc)
The bump:versions script supports several options:
# Prepare, commit, and push the release branch
pnpm bump:versions 1.0.0
# Prepare and commit without pushing the branch
pnpm bump:versions --no-push 1.0.0
# Skip git operations entirely
pnpm bump:versions --skip-git 1.0.0
# Dry run - see what would happen
pnpm bump:versions --dry-run 1.0.0
# Show help
pnpm bump:versions --help
# Tag the merged release from an updated main branch
pnpm release:tag 1.0.0If a release has issues:
-
Mark as deprecated on npm:
npm deprecate @interfold/sdk@1.0.0 "Critical bug, use 1.0.1" -
Fix and release a patch:
pnpm bump:versions 1.0.1
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.