Skip to content

Commit 143133c

Browse files
committed
docs(migration): minimize to a single TEE caveat in Step 3
1 parent 67fdcf3 commit 143133c

1 file changed

Lines changed: 4 additions & 28 deletions

File tree

docs/node-migration-guide.md

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -139,41 +139,17 @@ For additional security, the backup and restore process encrypts keyshares durin
139139
**Important:** The `MPC_BACKUP_ENCRYPTION_KEY_HEX` must be the same between the backup-cli and the node it is currently communicating with (e.g., the old node when running `get-keyshares`, and the new node when running `put-keyshares`).
140140

141141

142-
### Obtain the encryption key (differs for TEE vs non-TEE nodes)
142+
### Retrieve a key from an existing node.
143143

144-
How you obtain `MPC_BACKUP_ENCRYPTION_KEY_HEX` depends on whether the node runs
145-
inside a TEE (TDX/dstack) or not.
146-
147-
If the key is not provided (neither the `MPC_BACKUP_ENCRYPTION_KEY_HEX` env var nor
148-
the `[mpc_node_config.secrets] backup_encryption_key_hex` config field is set), the
149-
node auto-generates one and writes it to `$MPC_HOME_DIR/backup_encryption_key.hex`.
150-
Whether you can *read that file back* is the difference:
151-
152-
**Non-TEE nodes.** `$MPC_HOME_DIR` is on the host filesystem, so you can retrieve
153-
the auto-generated key directly:
144+
**Note:** If your node has been running without the `MPC_BACKUP_ENCRYPTION_KEY_HEX` environment variable set, the node automatically generates an encryption key and stores it in a file called `backup_encryption_key.hex` in your `$MPC_HOME_DIR` directory. You can retrieve it with:
154145

155146
```bash
156147
export BACKUP_ENCRYPTION_KEY=$(cat $MPC_HOME_DIR/backup_encryption_key.hex)
157148
```
158149

159-
**TEE (TDX/dstack) nodes.** `$MPC_HOME_DIR` (`/data`) lives **inside the CVM's
160-
encrypted disk**, which the operator cannot read, and `/public_data` does not
161-
expose the key. So an auto-generated key is **unrecoverable** — you could never
162-
give `backup-cli` a matching key. You must instead **set the key yourself before
163-
first start**, in the node's user-config, and keep a copy outside the CVM:
164-
165-
```toml
166-
[mpc_node_config.secrets]
167-
backup_encryption_key_hex = "<your 32-byte hex key>"
168-
```
169-
170-
Store that value in your secret store — it is the `BACKUP_ENCRYPTION_KEY` you pass
171-
to `backup-cli`. The user-config is **not measured**, so you can set or rotate it
172-
via `update-user-config` without affecting the sealed disk (see the
173-
[TDX external guide](https://github.com/near/mpc/blob/main/docs/running-an-mpc-node-in-tdx-external-guide.md)).
150+
Copy this key and set it as the `BACKUP_ENCRYPTION_KEY` environment variable for the backup-cli when running `get-keyshares`.
174151

175-
In both cases, set the resulting key as the `BACKUP_ENCRYPTION_KEY` environment
176-
variable for the backup-cli when running `get-keyshares`.
152+
> **TEE (TDX/dstack) nodes:** `$MPC_HOME_DIR` (`/data`) is inside the CVM's encrypted disk, so you cannot read the auto-generated `backup_encryption_key.hex`. Set `backup_encryption_key_hex` in the `[mpc_node_config.secrets]` block of the node's user-config **before first start** and keep a copy outside the CVM — that is the key you pass to the backup-cli.
177153
178154

179155

0 commit comments

Comments
 (0)