bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 45쪽 중 3쪽
ption shares. The shares combine into the plaintext
output, which goes on-chain with a proof.
Each step has a deadline. When a step misses its deadline, anyone can mark the E3 as failed, and the
refund rules apply. The
E3 lifecycle
page describes each stage.
For example, in a sealed-bid auction, each bidder encrypts a bid. The computation runs over the
encrypted bids, and only the result is decrypted. The individual bids stay encrypted.
Guarantees
The table shows each guarantee, the mechanism that backs it, and where the protocol checks it.
Guarantee
What backs it
Where the protocol checks it
Inputs stay encrypted during the computation
Fully homomorphic encryption (FHE) with the threshold BFV scheme
The compute provider receives only ciphertexts
No single party can decrypt
Threshold cryptography: DKG and Shamir secret sharing
The decryption proof combines T + 1 verified shares
Key generation and decryption are correct
Zero-knowledge (ZK) proofs from circuits C0 to C7
BfvPkVerifier
at
publishCommittee
,
BfvDecryptionVerifier
at
publishPlaintextOutput
The computation is correct
A compute proof (an OpenVM zkVM receipt in the current code)
The ciphertext verifier and the E3 program
verify
function at
publishCiphertextOutput
Committee selection is random
Ticket-weighted sortition with a Chainlink VRF v2.5 seed
CiphernodeRegistry
functions
submitTicket
and
finalizeCommittee
Operators have a reason to act correctly
Economic security: FOLD bonds, tFOLD tickets, slashing, rewards, refunds
BondingRegistry
,
SlashingManager
, and
E3RefundManager
Fully homomorphic encryption
BFV is a fully homomorphic encryption scheme. A program can add encrypted values and get an
encrypted sum without decryption. The compute provider runs the program on ciphertexts only. It
never sees an input or the output in plaintext.
Threshold cryptography
The committee creates its public key with DKG. Each member contributes a piece of the secret key and
splits it into Shamir shares for the other members. No member ever holds the complete secret key.
Decryption needs T + 1 valid shares, and each share reveals nothing alone. The
Cryptography
page explains the committee sizes and the math.
Zero-knowledge proofs
Each ciphernode proves every key, share, and decryption step with a ZK proof. An aggregator folds
these proofs into two recursive proofs for each E3. The protocol contracts verify both proofs
on-chain, so anyone can check the result without trust in the committee.
Economic security
A ciphernode needs a FOLD bond (
InterfoldToken
) and tFOLD tickets (
InterfoldTicketToken
) to
serve on committees. The
SlashingManager
can slash ticket collateral and bonds for proven faults,
ban an operator, and expel a committee member. A successful E3 pays the active committee members. A
failed E3 returns fee escrow to the requester according to who caused the failure.
Assumptions and limits
The guarantees depend on these conditions:
Collusion threshold.
If T + 1 committee members collude, they can decrypt any ciphertext under
the committee key, including a single input. Larger committees raise T.
Public output.
The plaintext output is public on-chain. The E3 program must make sure that the
output does not reveal an individual input, for example a tally with only one vote.
Input validation.
The E3 program decides which inputs to accept. The default template does not
check that a ciphertext matches its commitment. A production program must verify this binding.
Data availability.
The ciphertext output is stored outside Ethereum. The E3 program verifies a
receipt from the data-availability layer. CRISP uses Avail with the VectorX bridge.
Roles
Role
What the role does
Main interface
Requester
Selects the E3 program, committee size, and input window. Pays the fee and receives the result.
Interfold.request
,
Interfold.getE3Quote
Data provider
Encrypts an input under the committee public key and submits it during the input window.
The E3 program
publishInput
function
E3 program developer
Writes the program contract and the secure process, which is the FHE computation.
IE3Program
(
validate
,
publishInput
,
verify
)
Ciphernode operator
Runs a ciphernode that serves on committees. The ciphernode needs a FOLD bond and tFOLD tickets.
BondingRegistry
, the
interfold start
command
Compute provider
Runs the secure process over the encrypted inputs and produces a compute proof. The output and proof go to the Interfold contract.
Interfold.publishCiphertextOutput
One party can have more than one role. For example, an application can request an E3 and also run
its compute provider.
Enclave is now The Interfold
The Interfold was previously named Enclave. Older articles and code can still use the name
Enclave.
Next steps
What is an E3?
The parts of one Encrypted Execution Environment and the proof that protects each part.
Learn
Architecture
The on-chain contracts and off-chain services, and how they interact.
Learn
Quick Start
Make a project from the template and run a complete E3 on your computer.
Build
Run a ciphernode
Bond FOLD, get tickets, and serve on committees.
Operate
Home
What is an E3?
## /learn/what-is-e3
Learn
What is an E3?
What is an E3?
An Encrypted Execution Environment (E3) is one confidential computation on the Interfold. This page
explains the parts of an E3 and how they connect. It is for developers and operators who want the
concept before the procedures. At the end, you can name each part and the proof that protects it.
Definition
An E3 is one computation over encrypted inputs. The Interfold contract (
Interfold.sol
) creates the
E3 when a requester calls
request
. The contract then records the E3 as it moves through its stages
to a result or to a failure.
Each E3 has its own committee, its own DKG, and its own public key. Each E3 also has its own
deadlines and its own fee escrow. The contract identifies the E3 with an
e3Id
.
An
e3Id
is a large number, not a small counter. Each Interfold deployment starts its counter at
its own contract address shifted left by 96 bits. Tools must store an
e3Id
as a full
uint256
value.
Request
The requester selects an E3 program and pays.
Committee key
Ciphernodes run DKG and publish one key.
Encrypted inputs
Data providers encrypt under that key.
Compute
The compute provider runs over ciphertexts.
Decrypt
T + 1 shares decrypt only the output.
Parts of an E3
E3 program
The E3 program defines what the E3 computes. It has two parts:
The program contract.
A Solidity contract that implements
IE3Program
and
IE3ProgramDataAvailability
. It validates each request, accepts inputs, and verifies the compute
proof and the data-availability receipt.
The secure process.
The FHE computation that runs over the encrypted inputs. The default
template adds all inputs (
templates/default/program/src/lib.rs
).
The owner of the Interfold contract must register a program with
registerE3Program
before requests
can use it. The Interfold contract calls these program functions:
Function
When the Interfold contract calls it
validate
During
request
. The program checks the parameters and returns the scheme ID.
verify
During
publishCiphertextOutput
. The program checks the compute proof.
verifyDataAvailability
During
publishCiphertextOutput
. The program checks the availability receipt.
The
IE3Program
interface also has
publishInput
. Data providers call it directly on the program
contract. See
Program Contract
and
Secure Process
.
Encrypted inputs
A data provider encrypts an input under the committee public key. Clients get the serialized key
from
CommitteePublicKeyChunkPublished
events. A client must check the key against the proven
commitment before it uses the key. The client then calls
publishInput(e3Id, data)
on the E3
program.
The E3 program sets the input rules. The default template rejects an input after
inputWindow[1]
. A
program can also require a ZK proof that each ciphertext is a valid BFV encryption under the
committee key. The
user_data_encryption
circuits make this proof, and
@interfold/sdk
can
generate it in the client. CRISP requires such a proof for each ballot.
Committee
The committee is a set of N ciphernodes that sortition selects for this E3. The requester selects
the committee size. Three sizes exist:
Size
Committee size N
DKG contributions H
Threshold T
Shares to decrypt (T + 1)
Minimum
3
2
1
2
Micro
9
5
4
5
Small
19
14
9
10
The committee runs DKG. The public key comes from H accepted contributions, and decryption needs T +
1 shares. The
Cryptography
page explains N, H, and T. The
Sortition
page explains how tickets select the committee.
Compute provider
The compute provider runs the secure process over the published inputs after the input window
closes. In the current code, the compute provider is the OpenVM zkVM. The template and CRISP both
use it. The zkVM produces a receipt that proves which program ran over which inputs.
The ciphertext output is stored on a data-availability layer. The Interfold contract stores only the
Keccak-256 hash of the output bytes and a SAFE commitment to the ciphertext. See
Compute Provider
.
Output
The E3 has two outputs:
The ciphertext output. The compute provider produces it, and the E3 enters
CiphertextReady
.
The plaintext output. The committee decrypts the ciphertext output with T + 1 shares, and the E3
enters
Complete
.
The committee decrypts only the output. The inputs stay encrypted. Applications read the result from
getE3(e3Id).plaintextOutput
or from the
PlaintextOutputPublished
event.
Proofs
Four kinds of proof protect an E3:
Proof
Made by
What it proves
Where it is verified
DKG proof (C0 to C5)
The active aggregator
Key generation and key aggregation were correct
publishCommittee
, through
BfvPkVerifier
and
DkgFoldAttestationVerifier
Input proof (optional)
The data provider's client
The input is a valid BFV encryption under the committee key
The E3 program, according to its own rules
Compute proof
The compute provider
The secure process ran over the committed inputs
publishCiphertextOutput
, through the ciphertext verifier and program
verify
Decryption proof (C6, C7)
The active aggregator
The plaintext is the correct decryption of the ciphertext output
publishPlaintextOutput
, through
BfvDecryptionVerifier
The E3 record
The Interfold contract stores each E3 as an
E3
struct (
interfaces/IE3.sol
).
getE3(e3Id)
returns it.
Field
Content
seed
A random seed for the computation. Committee selection uses a separate seed.
committeeSize
Minimum
,
Micro
, or
Small
requestBlock
The request time as a timestamp. The name stays for ABI compatibility.
inputWindow
The start and end times for inputs
encryptionSchemeId
The scheme that
validate
returned, for example
keccak256("fhe.rs:BFV")
e3Program
The E3 program contract
paramSet
The BFV parameter set index
customParams
Application-defined ABI-encoded parameters
decryptionVerifier
The verifier for the decryption proof
pkVerifier
The verifier for the DKG proof
committeePublicKey
The commitment to the committee public key
ciphertextOutput
The Keccak-256 hash of the serialized ciphertext output
ciphertextCommitment
The SAFE commitment to the ciphertext, used by the decryption proof
plaintextOutput
The decrypted output
requester
The address that requested the E3
When an E3 fits
An E3 fits a task when all of these conditions are true:
Several parties contribute inputs that they do not want to reveal.
The application needs one result from those inputs, for example a sum or a tally.
No single operator is acceptable as the custodian of the inputs.
The application can wait for committee setup, the input window, computation, and decryption. An E3
does not give a real-time result.
The
Use Cases
page shows examples and their limits.
Next steps
Architecture
The contracts and services that run an E3, and how they interact.
Learn
E3 lifecycle
Each stage, the call that enters it, its events, and its deadline.
Learn
Build an E3 program
Write the program contract and the secure process.
Build
Overview
Architecture
## /learn/architecture
Learn
Architecture
Architecture
This page describes the parts of the Interfold and how they work together. It is for developers who
build an E3 program and for operators who run a ciphernode. At the end, you know which contract or
service does each job, and the order of the calls in one E3.
The stack
The Interfold has four layers. All E3 programs share the protocol contracts and the ciphernode
network. Each application brings its own program contract, servers, and client.
Application
One set for each E3 program
Client
Coordination server
Program server
E3 program contract
Compute
Off-chain
Compute provider (OpenVM zkVM)
Data-availability layer
Ciphernode network
Off-chain, libp2p
Sortition
DKG and decryption shares
Aggregator role
Proofs
Accusations
Protocol contracts
On-chain
Interfold
CiphernodeRegistry
BondingRegistry
SlashingManager
E3RefundManager
Verifiers
Randomness provider
On-chain contracts
All paths are relative to
packages/interfold-contracts/contracts/
. The deployed addresses are on
the
Contracts
reference page.
Contract
Source
Responsibility
Interfold
Interfold.sol
Accepts requests and fees, holds the service fee in escrow, records stages and deadlines, verifies outputs, and credits rewards.
CiphernodeRegistry
registry/CiphernodeRegistryOwnable.sol
Keeps the ciphernode set in an incremental Merkle tree (IMT). Runs committee requests, tickets, finalization, and key publication.
BondingRegistry
registry/BondingRegistry.sol
Holds FOLD bonds and tFOLD ticket balances, registers operators, runs the exit queue, and executes slashes.
SlashingManager
slashing/SlashingManager.sol
Accepts slash proposals, applies penalties, bans operators, and expels committee members.
E3RefundManager
E3RefundManager.sol
Splits the escrow of a failed E3, holds success rewards for claims, and routes slashed funds.
E3 program
For example
templates/default/contracts/MyProgram.sol
Validates requests, accepts inputs, and verifies the compute proof and the data-availability receipt.
ChainlinkVrfRandomnessProvider
randomness/ChainlinkVrfRandomnessProvider.sol
Connects one Chainlink VRF v2.5 subscription to the registry. Supplies one random word for each E3.
NodeReleaseRegistry
registry/NodeReleaseRegistry.sol
Sets which ciphernode release versions can take part in new E3s.
InterfoldToken (FOLD)
token/InterfoldToken.sol
The token for ciphernode bonds.
InterfoldTicketToken (tFOLD)
token/InterfoldTicketToken.sol
The non-transferable ticket balance, backed by deposited collateral.
The Interfold contract links two libraries,
InterfoldLifecycle
and
InterfoldPricing
. They hold
the lifecycle checks and the fee math and run in the context of the Interfold contract.
Each E3 records the registry, bonding registry, slashing manager, and refund manager at request
time. Governance can replace these contracts only after it pauses requests and all active E3s end.
Verifiers
Verifier
Checks
Called from
BfvPkVerifier
The recursive DKG proof. It calls the generated Honk verifier
DkgAggregatorVerifier
.
publishCommittee
DkgFoldAttestationVerifier
One signed fold attestation from each accepted DKG party
publishCommittee
BfvDecryptionVerifier
The recursive decryption proof. It calls the Honk verifier
DecryptionAggregatorVerifier
.
publishPlaintextOutput
OpenVmBfvCiphertextVerifier
The protocol fields in the OpenVM compute receipt
publishCiphertextOutput
AvailVectorXDataAvailabilityVerifier
Avail blob inclusion through the VectorX bridge, for E3 programs that use Avail
The E3 program
BfvPkVerifierRouter
and
BfvDecryptionVerifierRouter
can sit in front of the BFV verifiers. A
router sends each proof to the verifier for its parameter set and committee size.
Off-chain components
Ciphernode
A ciphernode is the
interfold
binary that runs with
interfold start
. It reads contract events,
talks to other ciphernodes over libp2p, and sends transactions. Its main parts are actors:
Part
Crate
Job
EVM readers and writers
crates/evm
Read contract events and send transactions
Sortition
crates/sortition
Score tickets, submit tickets, and track committee membership
CommitteeFinalizer
crates/aggregator
Call
finalizeCommittee
after the ticket window closes
ThresholdKeyshare
crates/keyshare
Run DKG and compute decryption shares for one E3
PublicKeyAggregator
crates/aggregator
Aggregate the public key and the DKG proofs
ThresholdPlaintextAggregator
crates/aggregator
Combine decryption shares and fold the decryption proofs
Proof actors
crates/zk-prover
Generate and verify ZK proofs with Barretenberg (
bb
)
AccusationManager
crates/slashing
Start an accusation after a failed proof and collect committee votes
Network
crates/net
libp2p gossip between ciphernodes
Storage
crates/data
sled storage and event replay after a restart
Ciphernodes exchange their proofs over gossip and verify each other's proofs. Individual proofs do
not go on-chain. Only the aggregated proofs do.
Aggregator role
Each committee has one active aggregator. The runtime sorts the finalized committee by address. The
active aggregator is the eligible member with the lowest party ID. It sends two permissionless
transactions:
publishCommittee
with the DKG proof and
publishPlaintextOutput
with the decryption
proof.
The on-chain proof check protects both transactions, so the caller does not need special rights. If
the expected result does not appear on-chain within 10 minutes, the next eligible member takes the
role.
Compute provider
The compute provider runs the secure process over the ciphertexts. In the current code, it is the
OpenVM zkVM, run on the operator's GPU or CPU. The receipt binds the E3, the committee public key,
the input Merkle root, and the output hash. Deployed networks keep their RISC Zero verifiers until
an OpenVM migration. See
Compute Provider
.
Program server
interfold program start
starts the program server (
crates/program-server
). It accepts a compute
request over HTTP, runs the FHE computation, and posts the result to a callback URL. It runs one job
at a time by default.
⚠️
The program server is development tooling. It does not authenticate callers or limit callback
destinations. Any client that can reach it can start a computation.
Coordination server
The template and CRISP each include a coordination server. The template server is in
templates/default/server
, and the CRISP server is in
examples/CRISP/server
. The template server
does these tasks:
It rebuilds the committee public key from its chunks and checks the key commitment.
It waits until the input window closes on-chain.
It sends the compute request to the program server.
It stores the ciphertext output on the data-availability layer.
It calls
publishCiphertextOutput
with the output reference and the compute proof.
Client
The client uses
@interfold/sdk
or
@interfold/react
. It reads the committee public key, encrypts
inputs, and can generate an input proof. It submits inputs to the E3 program and reads the output.
See
SDK
and
Client and Server
.
Interaction flow
The diagram shows the main calls in one successful E3.
The requester calls
request
. The Interfold contract asks the registry for a committee.
Ciphernodes submit tickets after the VRF result arrives, then a ciphernode finalizes the
committee.
The committee runs DKG. The active aggregator publishes the key commitment and the DKG proof.
Data providers submit encrypted inputs to the E3 program during the input window.
After the input window closes, the compute output goes to
publishCiphertextOutput
.
The committee computes decryption shares. The active aggregator publishes the plaintext and the
decryption proof.
The requester reads the result with
getE3
.
The
E3 lifecycle
page gives the events and deadlines for each step.
Next steps
E3 lifecycle
Each stage, 프로젝트로 돌아가기