# FTO 入门指南 · Getting Started

> 中文在下面 / English below the divider. 交互式版：[`/fto/canvas/start`](https://fractaltapeout.pages.dev/fto/canvas/start)（中/英切换，含钱包状态自检）。
> 本文件随站点发布在 `/getting-started.md`。

---

## 中文

### 0. FTO 是什么

**FTO = Fractal TapeOut**：在 **Fractal Bitcoin** 上用「代币=晶体管 → 画布接线 → 流片 → 可调用电路」的玩法造芯片。与中心化版本不同：**电路不会被管理员改掉，任何人都能独立复算它的状态**（不可篡改 + 可验证 + 链即时钟）。

- 目前运行在 **Fractal 测试网**（testnet）。**上主网、开放给所有人**是目标，尚在测试网冲刺。
- 全程 **去托管**：你的资产由你自己的钱包签名，服务端不持你的私钥。

### 1. 准备：装一个钱包

1. 安装支持 Fractal 的浏览器钱包，推荐 **UniSat**（<https://unisat.io/download>）或 **OKX Wallet**（<https://www.okx.com/web3>）。
2. 打开钱包，把网络切到 **Fractal Bitcoin Testnet**。
3. 回到 FTO 页面点「**连接钱包**」。检测到多个钱包时，按钮旁会出现选择框。

> 钱包在 FTO 里只做两件事：**签 PSBT**（流片 / 铸币 / 结算）和**签消息**（挂单）。所有规则与状态由协议和索引器决定。详见 [`WALLET.md`](./WALLET.md)。

### 2. 拿测试币

测试网 BTC 用于付矿工费：

- 官方水龙头：<https://explorer-testnet.fractalbitcoin.io/faucet>
- UniSat 水龙头：<https://explorer.unisat.io/fractal-testnet/faucet>

把钱包地址粘进去领取即可（到账需等测试网确认，约几十秒到几分钟）。

### 3. 五分钟上手

| 步骤 | 做什么 | 去哪 |
| --- | --- | --- |
| ① 流片 | 在画布上放几个门、接线、点「编译 / 自检」，再点「流片」——用**你的钱包**签名并付费 | <https://fractaltapeout.pages.dev/fto/canvas/> |
| ② 建厂 / 铸币 | 建一个 factory（含首铸）或给已有 factory 铸币；分叉后创建的 factory 由**创建者**（首笔 mint 的签名者）继续控制 | <https://fractaltapeout.pages.dev/fto/canvas/issue> |
| ③ 挂单 / 结算 | 连接钱包 → 挂出**已签名订单** → 选「可结算组合」生成 PSBT → 双方各签自己的输入 → 合并广播（一笔原子结算） | <https://fractaltapeout.pages.dev/fto/canvas/market> |
| ④ 只读验证 | 用公开浏览器查看处理器 / 余额 / 电路 / 事件 / **状态根承诺**；不信任单点时可 `?degraded=1` 直接读链复算 | <https://fractaltapeout.pages.dev/fto/canvas/explorer> |

### 4. 自己验证（不信任任何服务器）

- 公开、版本化协议规范：[`/spec.md`](https://fractaltapeout.pages.dev/spec.md)；金标向量：`/spec/vectors.json`。
- 第三方**仅凭规范**即可复现 digest / state root；本地一把梭：`node tools/verify_all.mjs`（全绿）。
- 只读 explorer 的「承诺」区块会显示链上 `stateRoot` 是否与边端实时复算一致。

### 5. 常见问题

- **点「连接钱包」没反应？** 先确认已安装钱包扩展并**刷新页面**；仍无反应多为未安装或未授权。
- **流片/铸币失败？** 常见原因是钱包不在 **Fractal Bitcoin Testnet**，或余额不足（建议 ≥ 20000 sat 的已确认 UTXO）。页面会提示。
- **没有钱包能用吗？** 有一个**仅测试网自用**的服务端签名回退路径（画布底部「写令牌」），会由运营方地址上链；公开使用请连接自己的钱包。
- **资产会丢吗？** 服务端不持你的私钥；但测试网资产无价值，请勿放入真实资产。

### 6. 链接

- 画布 `/fto/canvas/` · 市场 `/fto/canvas/market` · 发 `/fto/canvas/issue` · 浏览器 `/fto/canvas/explorer` · 入门 `/fto/canvas/start`
- 协议规范 `/spec.md` · 钱包接入 `/wallet.md` · 发层经济 `/g9-r15.md` · 运营手册 `/ops.md`

---

## English

### 0. What is FTO

**FTO = Fractal TapeOut**: build chips on **Fractal Bitcoin** with the "token = transistor → wire a canvas → tape out → callable circuit" loop. Unlike a centralized version: **a circuit can never be changed by an admin, and anyone can independently recompute its state** (immutable + verifiable + chain-as-clock).

- It currently runs on **Fractal Testnet**. The goal is **mainnet, open to everyone**; we are still hardening on testnet.
- Fully **de-custodied**: your assets are signed by your own wallet; the server never holds your keys.

### 1. Setup: a wallet

1. Install a Fractal-capable browser wallet — **UniSat** (<https://unisat.io/download>) or **OKX Wallet** (<https://www.okx.com/web3>).
2. In the wallet, switch the network to **Fractal Bitcoin Testnet**.
3. Back on an FTO page, click **Connect wallet**. If several wallets are detected, a picker appears next to the button.

> In FTO the wallet does exactly two things: **sign PSBTs** (tape-out / mint / settlement) and **sign messages** (orders). All rules and state come from the protocol and the indexer. See [`WALLET.md`](./WALLET.md).

### 2. Get testnet coins

Testnet BTC pays the miner fee:

- Official faucet: <https://explorer-testnet.fractalbitcoin.io/faucet>
- UniSat faucet: <https://explorer.unisat.io/fractal-testnet/faucet>

Paste your wallet address and claim; confirmation takes tens of seconds to a few minutes.

### 3. Five-minute tour

| Step | Do | Go |
| --- | --- | --- |
| ① Tape out | Drop a few gates, wire them, click **Compile / self-check**, then **Tape out** — signed and paid by **your wallet** | <https://fractaltapeout.pages.dev/fto/canvas/> |
| ② Factory / mint | Create a factory (with a first mint) or mint into an existing one; a post-fork factory stays controlled by its **creator** (signer of the first mint) | <https://fractaltapeout.pages.dev/fto/canvas/issue> |
| ③ Order / settle | Connect wallet → post a **signed order** → pick a match → generate PSBT → each side signs its own inputs → broadcast one atomic settlement | <https://fractaltapeout.pages.dev/fto/canvas/market> |
| ④ Read-only verify | Browse factories / balances / circuits / events / the **state-root commitment** publicly; distrust a single server with `?degraded=1` (chain-direct recompute) | <https://fractaltapeout.pages.dev/fto/canvas/explorer> |

### 4. Verify it yourself (trust no server)

- Public, versioned spec: [`/spec.md`](https://fractaltapeout.pages.dev/spec.md); golden vectors: `/spec/vectors.json`.
- A third party can reproduce the digest / state root **from the spec alone**; locally: `node tools/verify_all.mjs` (all green).
- The explorer's "commitment" block shows whether the on-chain `stateRoot` matches the edge's live recomputation.

### 5. FAQ

- **"Connect wallet" does nothing?** Make sure the extension is installed and **reload the page**; no reaction usually means not installed or not authorized.
- **Tape-out / mint failed?** Usually the wallet is not on **Fractal Bitcoin Testnet**, or funds are short (keep ≥ 20000 sat of confirmed UTXOs). The page shows the reason.
- **No wallet?** There is a **testnet-only** server-signed fallback (the "write token" at the bottom of the canvas); it broadcasts from the operator address. For public use, connect your own wallet.
- **Can I lose assets?** The server never holds your keys; but testnet assets have no value — never put real assets in.

### 6. Links

- Canvas `/fto/canvas/` · Market `/fto/canvas/market` · Issue `/fto/canvas/issue` · Explorer `/fto/canvas/explorer` · Start `/fto/canvas/start`
- Spec `/spec.md` · Wallet `/wallet.md` · Issue economics `/g9-r15.md` · Ops runbook `/ops.md`
