You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -14,21 +14,21 @@ Build and deploy a **Trusted Execution Environment (TEE) extension** that secure
14
14
This guide walks through every step — from writing the smart contract and extension handler to deploying on Coston2 and running an end-to-end test.
15
15
16
16
:::info[New to Flare TEE?]
17
-
A TEE extension is an off-chain program that runs inside a Trusted Execution Environment.
18
-
It receives **instructions** from on-chain transactions, processes them in a secure enclave, and writes results back on-chain.
17
+
A TEE extension is an offchain program that runs inside a Trusted Execution Environment.
18
+
It receives **instructions** from onchain transactions, processes them in a secure enclave, and writes results back onchain.
19
19
The TEE framework handles attestation, key management, and message routing — you only write the business logic.
20
20
:::
21
21
22
22
## Overview
23
23
24
24
The Private Key Manager extension demonstrates the core TEE workflow:
25
25
26
-
1. A user sends an Elliptic Curve Integrated Encryption Scheme (ECIES) encrypted private key on-chain via the `InstructionSender` contract.
26
+
1. A user sends an Elliptic Curve Integrated Encryption Scheme (ECIES) encrypted private key onchain via the `InstructionSender` contract.
27
27
2. The TEE extension decrypts and stores the key inside the secure enclave.
28
28
3. A user sends a `sign` instruction with an arbitrary message.
29
-
4. The TEE extension signs the message with the stored key and returns the signature on-chain.
29
+
4. The TEE extension signs the message with the stored key and returns the signature onchain.
30
30
31
-
We will build this in three parts: the **on-chain contract** that sends instructions, the **off-chain handler** that processes them, and the **deployment tooling** that ties everything together.
31
+
We will build this in three parts: the **onchain contract** that sends instructions, the **offchain handler** that processes them, and the **deployment tooling** that ties everything together.
32
32
33
33
## Architecture
34
34
@@ -37,7 +37,7 @@ The extension stack consists of three components running as Docker services:
37
37
-**`extension-tee`:** Your extension code (Go, Python, or TypeScript).
38
38
Receives decoded instructions from the proxy and returns results.
39
39
-**`ext-proxy`:** The TEE extension proxy.
40
-
Watches the chain for new instructions targeting your extension, forwards them to your handler, and submits results back on-chain.
40
+
Watches the chain for new instructions targeting your extension, forwards them to your handler, and submits results back onchain.
41
41
-**`redis`:** In-memory store used by the proxy for internal state.
42
42
43
43
The tunnel ([Cloudflared](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/) or [ngrok](https://ngrok.com/)) exposes the proxy's external port so that other TEE nodes on the network can reach your extension for attestation and availability checks.
@@ -57,7 +57,7 @@ Before you begin, make sure you have the following installed:
57
57
58
58
## Onchain Contract
59
59
60
-
The `InstructionSender` contract is the on-chain entry point.
60
+
The `InstructionSender` contract is the onchain entry point.
61
61
It interacts with two Flare system contracts:
62
62
63
63
-**`TeeExtensionRegistry`:** Registers extensions and routes instructions to TEE machines
@@ -166,12 +166,12 @@ Both functions return a `bytes32` instruction ID that can be used to track the i
166
166
167
167
:::tip[Customizing the contract]
168
168
When building your own extension, change the `opType` and `opCommand` constants to match your use case.
169
-
The same constants must appear in both the Solidity contract and your off-chain handler code.
169
+
The same constants must appear in both the Solidity contract and your offchain handler code.
170
170
:::
171
171
172
172
## Offchain Handler
173
173
174
-
The off-chain handler is where your extension's business logic lives.
174
+
The offchain handler is where your extension's business logic lives.
175
175
The TEE framework calls your registered handler functions whenever a matching instruction arrives from the chain.
176
176
177
177
This example is available in three languages.
@@ -207,14 +207,14 @@ const (
207
207
208
208
### Handler signature
209
209
210
-
Every handler receives the hex-encoded `originalMessage` from the on-chain instruction and returns three values:
210
+
Every handler receives the hex-encoded `originalMessage` from the onchain instruction and returns three values:
0 commit comments