> ## Documentation Index
> Fetch the complete documentation index at: https://x402-docs.ftptech.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Recover a wallet

> Move your wallet to a new node if a node that hosts it is lost. Only your key can sign the move.

Your wallet is a Canton party that you control with your key. Nodes only host it. Wallets created through FTP's relay with `@ftptech/canton-agent-wallet` 2.12 or later are hosted on three nodes, run by FTP, Nodejumper and Qasara, and any two of them confirm. If one node is lost, your funds stay on the other two, and a new node can take its place. Older wallets have one host, an FTP node: if it is lost, see [If every node is lost](#if-every-node-is-lost).

You sign the move with the CLI, version 2.13 or later: `npm i -g @ftptech/canton-agent-wallet`.

## When a node is lost

1. The new node's operator sends you its node id (`<name>::1220…`), a proposal to host your wallet (`P.proposal.b64`) and a reading of your wallet's current hosting (`P.target-current.b64`). The operator of a node that still hosts your wallet sends a second reading (`P.current.b64`) and, in a separate message, the current serial. `P` is your party id with `::` written as `__`.
2. Check and sign. `HOSTS` is your wallet's hosting now, typed by you, not copied from the operators' files. For a wallet that never moved, it is these three nodes:

```bash theme={null}
HOSTS="FTP-validator-2::1220da867ceb28e1531ebfbea9ca9b25f75be06755999f48f0ec4b96f4174e3cd133:CONFIRMATION"
HOSTS="$HOSTS,nodejumper-main-1::122013e01068556122b6878a6ca33508f36127fbb59ca0b8d1706f7d5ddab6f1ca04:CONFIRMATION"
HOSTS="$HOSTS,qasara-validator-1::1220632cdae7977b01e0024d6310a32003bb67a6215cbdfffc6bbc8791be2382f0e0:CONFIRMATION"

canton-agent-wallet rehost sign --shape add \
  --in P.proposal.b64 --out P.signed.b64 \
  --current P.current.b64 \
  --current P.target-current.b64 \
  --serial <serial> --threshold 2 --hosts "$HOSTS" \
  --add-uid <new node id>
```

The wallet prints what changes and signs only if one new host is added and nothing else changes. Add `--check-only` to see the change without signing. If it prints `REFUSED`, send nothing: nothing has changed. Otherwise send `P.signed.b64` to the operator who sent the serial.

3. That operator loads it and exports your contracts, and the new node imports them.
4. The new node's operator sends a final proposal, and both operators send fresh readings and the serial, with the same file names as in step 1: keep them in a new folder. List the hosts that stay and the new node in `--final-hosts`, and the lost node in `--removed`, as ids without `:CONFIRMATION`. Send the signed file to the new node's operator.

```bash theme={null}
canton-agent-wallet rehost sign --shape final \
  --in P.proposal.b64 --out P.final.signed.b64 \
  --current P.current.b64 \
  --current P.target-current.b64 \
  --serial <serial> --threshold 2 \
  --final-hosts <hosts that stay>,<new node id> \
  --removed <lost node id>
```

Hosted MCP users: export the key on the [account page](https://pay.ftptech.xyz/account), save it to a file and add `--key-file <file>` to each command. With `--check-only`, also add `--party <your party id>`.

## If every node is lost

Your key still controls the wallet, and a new node can host it again. You sign the same two steps. The second reading comes from another connected node, which also loads your signed `add`. In the final step `--removed` lists every lost node and `--threshold` is 1. Your contracts come from a snapshot instead of an export:

* CC: from Scan, see [Recover the Coin balance of an external party](https://docs.canton.network/global-synchronizer/production-operations/validator-disaster-recovery#recover-the-coin-balance-of-an-external-party) in the Canton Network docs.
* DA Registry tokens such as USDCx: the issuer runs the registry's [Asset Recovery](https://docs.digitalasset.com/registry/features/asset-recovery).
* Other tokens: ask the issuer.

## Safety

* FTP never asks for your key.
* Sign only when you know which node was lost and which node replaces it.
* The wallet refuses any change you did not name.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.