Skip to content
theinterfoldPublic

About

An open-source protocol and distributed network for confidential coordination.

Resources

Contributing

Stars

85 stars

Watchers

2 watching

Forks

Latest commit

ย 

History

1,578 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

The Interfold

Docs Github Actions Hardhat License: LGPL v3

The Interfold

Note: The Interfold was previously known as Interfold.
Many repositories, packages, and CLI tools still use the interfold name 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.

Documentation

Full documentation is available at: https://docs.theinterfold.com

Quick Start

Follow instructions in the quick start section of the documentation.

See the CRISP example for a fully functioning example application.

Getting Help

Join the community Telegram group.

Contributing

See CONTRIBUTING.md.

Maintainers use RELEASING.md for shared-workspace releases and domain documentation for cross-layer contracts and known limits.

Development

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 clean

Testing

Use 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.

Test Scripts

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)
  • pnpm rust:test - Runs all Rust crate tests in the crates/ 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 in packages/interfold-contracts.

  • pnpm sdk:test - Runs tests for the TypeScript SDK in packages/interfold-sdk.

  • pnpm noir:test - Runs tests for Noir circuits in the circuits/ directory using nargo test. Requires the Noir toolchain (nargo) and Barretenberg (bb) to be installed and on your PATH.

  • pnpm test:integration - Runs integration tests from tests/integration/. These tests may require prebuilt binaries and can be run with --no-prebuild if binaries are already available. Pre-built circuit artifacts for the configured BFV preset must be present in the circuits/ artifacts directory.

Running Individual Test Suites

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-prebuild

Contributors

hmzakhalid
Hamza Khalid
ryardley
ะณฮป
ctrlc03
ctrlc03
auryn-macmillan
Auryn Macmillan
cedoor
Cedoor
0xjei
Giacomo
samepant
samepant
cristovaoth
Cristรณvรฃo
nginnever
Nathan Ginnever
neogiacomo
Giacomo Corrias
Toby1009
Malingshu
eccogrinder
marv
zahrajavar
Zara
0xkeygen
Bryant
ozgurarmanc
Armanc
Subhasish-Behera
SUBHASISH BEHERA
leonschh
Ethan
hcastc00
Hรฉctor
jfschwarz
Jan-Felix
callumweb3
callumweb3
CryptAm
cryptam

Minimum Rust version

This workspace's minimum supported rustc version is 1.91.1.

Architecture

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
Loading

๐Ÿš€ Release Process

Quick Release

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.

Release Order

Follow the release branch and tag sequence. Stable and prerelease publications use different channels; neither implies protocol compatibility.

What the Release Workflow Requires

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.

๐Ÿท๏ธ Version Strategy

Version Format

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

Which Version Should I Use?

For Production (Mainnet)

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 version

For Testing (Testnet)

You 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-release

For Development

Build from source:

git clone https://github.com/theinterfold/interfold.git
cd interfold
cargo build --release

๐ŸŒฟ Branch and Tag Strategy

Current Setup

  • main - 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 releases
  • stable - Always points to the latest stable release

Installation Sources

# 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 | bash

๐Ÿ“‹ Release Checklist

Use 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.

๐Ÿ”ง Script Options

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.

๐Ÿ”„ Rollback Procedure

Follow channels and recovery, including the protocol rollback decision. Deprecating an npm version does not roll back deployed contracts or node state.

๐Ÿ“Š Version History

Check our Releases page for full version history and changelogs.

Security and Liability

This repo is provided WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

License

This repo created under the LGPL-3.0+ license.

About

An open-source protocol and distributed network for confidential coordination.

Resources

Contributing

Stars

85 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages