|
| 1 | +# Remote Signing Coordinator |
| 2 | + |
| 3 | +This demo is a local coordinator for Taproot Assets Issuances that need an |
| 4 | +external signing device. It uses the Go SDK on the server side and a |
| 5 | +Next.js/Tailwind dashboard for the browser workflow. |
| 6 | + |
| 7 | +The dashboard does not talk to `tapd` directly. The Go server connects to |
| 8 | +`tapd`, starts an SDK issuer call, pauses when the SDK asks for an external |
| 9 | +Issuance signature, exposes the unsigned virtual PSBT for review, accepts the |
| 10 | +signed virtual PSBT, and then lets the SDK finalize the Issuance. |
| 11 | + |
| 12 | +## Requirements |
| 13 | + |
| 14 | +- Docker with Compose |
| 15 | +- Go, using the version required by this repository |
| 16 | +- Node.js with Yarn 4 through Corepack |
| 17 | + |
| 18 | +If Corepack is not enabled yet: |
| 19 | + |
| 20 | +```bash |
| 21 | +corepack enable |
| 22 | +``` |
| 23 | + |
| 24 | +## Quick Start |
| 25 | + |
| 26 | +From this directory: |
| 27 | + |
| 28 | +```bash |
| 29 | +cd dashboard |
| 30 | +yarn install |
| 31 | +yarn regtest |
| 32 | +yarn dev |
| 33 | +``` |
| 34 | + |
| 35 | +Open the dashboard at: |
| 36 | + |
| 37 | +```text |
| 38 | +http://127.0.0.1:3000 |
| 39 | +``` |
| 40 | + |
| 41 | +`yarn regtest` starts the repository integration-test regtest stack and exports |
| 42 | +Alice and Bob `tapd` credentials into `.tapd/`. The default `.env` values point |
| 43 | +the coordinator at Alice on regtest. |
| 44 | + |
| 45 | +Stop the regtest stack with: |
| 46 | + |
| 47 | +```bash |
| 48 | +yarn regtest:down |
| 49 | +``` |
| 50 | + |
| 51 | +## Commands |
| 52 | + |
| 53 | +Run from `dashboard/`: |
| 54 | + |
| 55 | +| Command | Purpose | |
| 56 | +| --- | --- | |
| 57 | +| `yarn dev` | Run the Go coordinator and dashboard together | |
| 58 | +| `yarn server` | Run only the Go coordinator | |
| 59 | +| `yarn dashboard` | Run only the Next.js dashboard | |
| 60 | +| `yarn regtest` | Start the pinned regtest stack and export creds | |
| 61 | +| `yarn regtest:down` | Stop the pinned regtest stack | |
| 62 | +| `yarn test` | Typecheck, lint, build dashboard, build server | |
| 63 | + |
| 64 | +## Configuration |
| 65 | + |
| 66 | +Defaults live in `.env.example`. Running any demo command creates `.env` from |
| 67 | +that file if it does not exist. |
| 68 | + |
| 69 | +| Variable | Default | |
| 70 | +| --- | --- | |
| 71 | +| `COORDINATOR_LISTEN` | `127.0.0.1:8091` | |
| 72 | +| `COORDINATOR_API_URL` | `http://127.0.0.1:8091` | |
| 73 | +| `TAP_TRANSPORT` | `grpc` | |
| 74 | +| `TAPD_HOST` | `localhost:10029` | |
| 75 | +| `TAPD_REST_URL` | `https://localhost:8089` | |
| 76 | +| `TAPD_NETWORK` | `regtest` | |
| 77 | +| `TAPD_TLS_PATH` | `.tapd/alice/tls.cert` | |
| 78 | +| `TAPD_MACAROON_PATH` | `.tapd/alice/admin.macaroon` | |
| 79 | +| `TAPD_TLS_INSECURE` | `false` | |
| 80 | + |
| 81 | +Relative paths are resolved from this demo directory, so the default credential |
| 82 | +paths work after `corepack yarn regtest`. |
| 83 | + |
| 84 | +## Flow |
| 85 | + |
| 86 | +1. Enter the external Issuance key descriptor: account xpub, master |
| 87 | + fingerprint, and derivation path. |
| 88 | +2. Start either a new Asset or a new Issuance for an existing AssetRef. |
| 89 | +3. The server calls the SDK issuer with an external signer callback. |
| 90 | +4. The SDK stages and funds the Issuance, then returns a signing request. |
| 91 | +5. The dashboard presents the SDK review fields: |
| 92 | + - the virtual PSBT authorizes a new Issuance |
| 93 | + - the AssetRef being affected |
| 94 | + - the amount by which supply increases |
| 95 | + - the Issuance key descriptor |
| 96 | + - the script key that controls the minted Asset |
| 97 | + - the anchor outpoint that commits the Issuance |
| 98 | +6. Sign the virtual PSBT externally. |
| 99 | +7. Paste the signed virtual PSBT into the dashboard. |
| 100 | +8. The SDK submits the signature, seals the batch, and finalizes the Issuance. |
| 101 | + |
| 102 | +State is kept in memory. Restarting the Go coordinator clears sessions. |
0 commit comments