Skip to content

Commit e504962

Browse files
refactor(docs): spelling
1 parent 92110b5 commit e504962

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

docs/fcc/guides/01-sign.mdx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Private Key Extension
33
slug: sign-extension
44
authors: [nikerzetic]
5-
description: Build and deploy a TEE extension that stores a private key and signs messages on-chain.
5+
description: Build and deploy a TEE extension that stores a private key and signs messages onchain.
66
tags: [intermediate, tee, ethereum]
77
keywords:
88
[tee, trusted-execution-environment, extension, flare-network, coston2]
@@ -14,21 +14,21 @@ Build and deploy a **Trusted Execution Environment (TEE) extension** that secure
1414
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.
1515

1616
:::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.
1919
The TEE framework handles attestation, key management, and message routing — you only write the business logic.
2020
:::
2121

2222
## Overview
2323

2424
The Private Key Manager extension demonstrates the core TEE workflow:
2525

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.
2727
2. The TEE extension decrypts and stores the key inside the secure enclave.
2828
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.
3030

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

3333
## Architecture
3434

@@ -37,7 +37,7 @@ The extension stack consists of three components running as Docker services:
3737
- **`extension-tee`:** Your extension code (Go, Python, or TypeScript).
3838
Receives decoded instructions from the proxy and returns results.
3939
- **`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.
4141
- **`redis`:** In-memory store used by the proxy for internal state.
4242

4343
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:
5757

5858
## Onchain Contract
5959

60-
The `InstructionSender` contract is the on-chain entry point.
60+
The `InstructionSender` contract is the onchain entry point.
6161
It interacts with two Flare system contracts:
6262

6363
- **`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
166166

167167
:::tip[Customizing the contract]
168168
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.
170170
:::
171171

172172
## Offchain Handler
173173

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.
175175
The TEE framework calls your registered handler functions whenever a matching instruction arrives from the chain.
176176

177177
This example is available in three languages.
@@ -207,14 +207,14 @@ const (
207207

208208
### Handler signature
209209

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:
211211

212212
```go
213213
func myHandler(msg string) (data *string, status int, err error)
214214
```
215215

216216
- **`msg`:** Hex-encoded message payload from the instruction
217-
- **`data`:** Hex-encoded return data (written back on-chain), or `nil` if no data
217+
- **`data`:** Hex-encoded return data (written back onchain), or `nil` if no data
218218
- **`status`:** `0` = error, `1` = success, `>=2` = pending
219219
- **`err`:** Go error if the handler failed
220220

@@ -248,8 +248,8 @@ func handleKeyUpdate(msg string) (data *string, status int, err error) {
248248
```
249249

250250
The decryption uses the TEE node's built-in `/decrypt` endpoint.
251-
The caller ECIES-encrypts the private key using the TEE's public key (fetched from the proxy's `/info` endpoint) before sending it on-chain.
252-
This ensures the private key is never visible in plaintext on-chain.
251+
The caller ECIES-encrypts the private key using the TEE's public key (fetched from the proxy's `/info` endpoint) before sending it onchain.
252+
This ensures the private key is never visible in plaintext onchain.
253253

254254
### The `sign` Handler
255255

@@ -282,7 +282,7 @@ func handleKeySign(msg string) (data *string, status int, err error) {
282282
```
283283

284284
The result is ABI-encoded as `(bytes, bytes)` — the original message and the ECDSA signature — and returned as hex.
285-
The proxy writes this data back on-chain.
285+
The proxy writes this data back onchain.
286286

287287
### Framework Utilities
288288

@@ -585,9 +585,9 @@ The test performs the following sequence:
585585
1. Calls `setExtensionId()` on the `InstructionSender` contract to discover and store the extension ID.
586586
2. Fetches the TEE's public key from the proxy's `/info` endpoint.
587587
3. ECIES-encrypts a test private key using the TEE's public key.
588-
4. Sends an `updateKey` instruction on-chain with the encrypted key.
588+
4. Sends an `updateKey` instruction onchain with the encrypted key.
589589
5. Waits for the TEE to process the instruction and store the key.
590-
6. Sends a `sign` instruction on-chain with a test message.
590+
6. Sends a `sign` instruction onchain with a test message.
591591
7. Verifies the returned ECDSA signature matches the test private key.
592592

593593
If the test passes, your extension is fully operational.
@@ -614,8 +614,8 @@ To create your own TEE extension using this template:
614614
5. **Register handlers** - Wire up your handlers with the framework using `f.Handle(opType, opCommand, myHandler)`.
615615
6. **Deploy and test** - Follow the steps in this guide to deploy your contract, register the extension, and verify it works.
616616

617-
:::tip[What to change, what to keep]
618-
Only modify files in `app/` (your business logic) and `contract/InstructionSender.sol` (your on-chain interface).
617+
:::tip[What to change vs. what to keep]
618+
Only modify files in `app/` (your business logic) and `contract/InstructionSender.sol` (your onchain interface).
619619
The files in `base/` are framework infrastructure and should not need changes.
620620
:::
621621

@@ -684,7 +684,7 @@ rm -f .env config/proxy/extension_proxy.toml
684684
After a full reset, start again from [Step 0](#step-0-configure-environment).
685685

686686
:::info
687-
On-chain state (deployed contracts, registered extensions, registered TEEs) cannot be reset.
687+
onchain state (deployed contracts, registered extensions, registered TEEs) cannot be reset.
688688
Each fresh start deploys a new `InstructionSender` contract and registers a new extension.
689689
This is fine for testing — Coston2 is a testnet.
690690
:::

0 commit comments

Comments
 (0)