# Wallet Gatewayを立てて運用する

> Wallet Gatewayを自分の基盤に立てて設定し、networkと認証と署名の仕組みを選び、人を介さない自動化まで運用する手順と判断を、章の中の図解で追います。

- URL: https://cardene.dev/diagrams/canton-ext-wallet-gateway
- 公開日: 2026-11-24
- 更新日: 2026-11-24
- トピック: Blockchain
- タグ: Canton
- 親の図解: [Canton Networkの全体像](https://cardene.dev/diagrams/canton-network.md): トランザクションの中身を関わるpartyにだけ見せるCanton Networkについて、部品ごとの役割と、1つのトランザクションが部品の間をどう流れるかを段ごとに追います。
- 子の図解: [Wallet Gatewayの役と全体を知る](https://cardene.dev/diagrams/canton-wg-overview.md): 自分で運用するWallet Gatewayが何をする部品かと、dAppとvalidatorと署名を任せる先をどうつなぐか、承認から署名と送信までの流れ、動かし始める手順を追います。
- 子の図解: [Wallet Gatewayを設定する](https://cardene.dev/diagrams/canton-wg-config.md): Wallet Gatewayの設定ファイルの各節が決める事と、保存先と秘密の値の選び方、データベースを失った時に戻る物と消える物を、表と2つの図で追います。
- 子の図解: [ネットワークとloginの方式を決める](https://cardene.dev/diagrams/canton-wg-networks-auth.md): Wallet Gatewayのnetworkとidentity providerの設定の欄と、authとadminAuthとserviceAccountAuthの使い分けを、表と2つの図で追い、本番に選ぶ方式を整理します。
- 子の図解: [partyの鍵で自分のトークンを作る](https://cardene.dev/diagrams/canton-wg-self-issued.md): 外部のidentity providerを使わず、partyの鍵で署名したアクセストークンで台帳にログインする要件と設定、onboardingの順、署名の結果の3つの状態を、2つの図で追います。
- 子の図解: [誰が鍵を持ち署名するかを選ぶ](https://cardene.dev/diagrams/canton-wg-signing-providers.md): Wallet Gatewayが署名を任せるsigning providerの7種類から本番に選ぶ物を図で見て、設定の値と、利用者の承認から署名と実行までの状態を追います。
- 子の図解: [画面でpartyを作り管理する](https://cardene.dev/diagrams/canton-wg-user-ui.md): 利用者がWallet GatewayのUser UIでloginし、partyを作ってprimaryを決め、活動を見て、sessionを終えるまでを、画面の図とloginから終了までの図で追います。
- 子の図解: [人を介さない自動化を準備する](https://cardene.dev/diagrams/canton-wg-service-account.md): バックエンドやCIがAPI keyで人を介さずにトランザクションを送るため、前もって揃える5つの前提と設定、一度の準備の手順、認証が通る順を、2つの図で追います。
- 子の図解: [自動化の送信を本番で見張る](https://cardene.dev/diagrams/canton-wg-service-account-run.md): API keyの送信が同期と非同期の署名でどう進むかを同期は本文、非同期は図で追い、本番での設定の固め方と見張るログと事前の検証、失敗の原因の候補の表を整理します。

前の部の章「Wallet GatewayのAPI」は、Wallet Gatewayが出すAPIの仕様を説明しました。
この章は、そのWallet Gatewayを自分の基盤に立てて設定し、networkと認証と署名の仕組みを選び、人を介さない自動化まで運用する人の手順と判断を追います。
APIの説明は写し直さず、章「Wallet GatewayのAPI」の頁を指します。

https://cardene.dev/diagrams/canton-wallet-gateway-api

まず、Wallet Gatewayが何をする部品で、dAppとvalidatorと署名を任せる先をどうつなぎ、どう動かし始めるかを見ます。

https://cardene.dev/diagrams/canton-wg-overview

次に、設定ファイルの各節が何を決め、保存先と秘密の値をどう選び、データベースを失った時に何が戻り何が消えるかを追います。

https://cardene.dev/diagrams/canton-wg-config

その次に、networkとidentity providerの設定と、利用者の認証に加えて、管理用と自動化用の認証を必要に応じて足す設定を見ます。
外部のidentity providerを使わず、partyの鍵で署名したアクセストークンで台帳にログインする進め方も追います。

https://cardene.dev/diagrams/canton-wg-networks-auth

https://cardene.dev/diagrams/canton-wg-self-issued

続いて、署名を任せるsigning providerの7種類から本番に選ぶ物を決め、利用者の承認から署名と実行までの状態を追います。
利用者がUser UIでloginし、partyを作ってprimaryを決め、作った後に署名の鍵を替える所も見ます。

https://cardene.dev/diagrams/canton-wg-signing-providers

https://cardene.dev/diagrams/canton-wg-user-ui

最後に、バックエンドやCIがAPI keyで人を介さずにトランザクションを送るため、前もって揃える物と、本番での見張り方を追います。

https://cardene.dev/diagrams/canton-wg-service-account

https://cardene.dev/diagrams/canton-wg-service-account-run

図の語は、それぞれの頁が説明します。

下の図は、dApp、Wallet Gateway、validator、signing providerの順に置き、dAppがdApp APIでWallet Gatewayを呼び、Wallet GatewayがLedger APIでvalidatorと話し、署名をsigning providerに任せる関係を線にします。
運用者の自動化は、バックエンドやCIがAPI keyで人を介さずに送る使い方で、Wallet Gatewayの部品ではないので線を持ちません。
Wallet Gatewayの中は、設定ファイルとUser UIが同じ段、その先の段にnetwork、さらにその先の段に自己発行のログインを置き、設定ファイルとUser UIがnetworkを使い、networkが自己発行のログインの設定をIDで参照する関係を線にします。

虫眼鏡の印が付いた部品を押すと、その部品の中へ入ります。
外側へ戻る時は、右上の「戻る」か、上に並んだ名前を押します。
部品の中へ入ると、名前の並びの下にその部品を説明する頁の題が出て、押すとその頁を開きます。

```dragon
architecture Wallet Gatewayとwalletをつなぐ
group Top as Wallet Gatewayのまわり [icon: net]
  box D as dApp [note: dApp APIで呼ぶ, color: blue, icon: app]
  box G as Wallet Gateway [note: 自分のvalidatorの隣で動かす, color: slate, icon: server, link: /diagrams/canton-wg-overview]
  box V as validator [note: Ledger APIを出す, color: rose, icon: server]
  box S as signing provider [note: 鍵を持ち署名する, color: rose, icon: server, link: /diagrams/canton-wg-signing-providers]
  box Auto as 運用者の自動化 [note: API keyで人を介さず送る, color: coin, icon: refresh]
end
group GIn as Wallet Gatewayの中 [color: slate, icon: server]
  box Conf as 設定ファイル [note: 起動時の設定を決める, icon: db, link: /diagrams/canton-wg-config]
  box Net as network [note: validatorへの接続先を決める, icon: net, link: /diagrams/canton-wg-networks-auth]
  box UI as User UI [note: partyを作り管理する画面, icon: user, link: /diagrams/canton-wg-user-ui]
  box SelfTok as 自己発行のログイン [note: partyの鍵で署名したトークンでlogin, icon: card, link: /diagrams/canton-wg-self-issued]
end
group AutoIn as 運用者の自動化の中 [color: coin, icon: refresh]
  box Pre as 揃える5つの前提 [note: loginとwalletとsigning providerとAPI keyとnetworkの設定, icon: check, link: /diagrams/canton-wg-service-account]
  box Watch as 本番の見張り [note: ログとイベントで見張る, icon: server, link: /diagrams/canton-wg-service-account-run]
end

step Wallet Gatewayのまわり
  say dAppはdApp APIでWallet Gatewayを呼び、Wallet GatewayはLedger APIでvalidatorと話し、署名はsigning providerに任せます。
  D -> G: dApp API
  G -> V: Ledger API
  G -> S: 署名を任せる
  source CantonのWallet GatewayのOverview [url: https://docs.canton.network/integrations/wallet-gateway/overview]
  source CantonのWallet GatewayのQuickstart [url: https://docs.canton.network/integrations/wallet-gateway/quickstart]
  source CantonのAsync dApp APIのprepareExecute [url: https://docs.canton.network/reference/wallet-gateway-json-rpc/operations/dapp-remote-api/prepareexecute]
  source CantonのSigning Providers [url: https://docs.canton.network/integrations/wallet-gateway/operate/signing-providers]
  source CantonのApprove & Sign Transactions [url: https://docs.canton.network/integrations/wallet-gateway/use/approve-and-sign]

step Wallet Gatewayの中
  say 設定ファイルがnetworkを書き、User UIでは利用者がnetworkを選び、networkは自己発行のログインの設定をIDで参照します。
  Conf -> Net: networkを書く
  UI -> Net: 利用者が選ぶ
  Net -> SelfTok: IDで参照
  source CantonのConfigure the Wallet Gateway [url: https://docs.canton.network/integrations/wallet-gateway/operate/configure]
  source CantonのConfiguration reference [url: https://docs.canton.network/integrations/wallet-gateway/reference/configuration-reference]
  source CantonのNetworks & identity providers [url: https://docs.canton.network/integrations/wallet-gateway/operate/networks-and-identity]
  source CantonのSelf-issued access token [url: https://docs.canton.network/integrations/wallet-gateway/operate/self-issued-authentication]
  source CantonのParty Management [url: https://docs.canton.network/integrations/wallet-gateway/use/party-management]

step 運用者の自動化の中
  say 運用者は、前もって5つの前提を揃え、本番ではログとイベントで見張ります。
  source CantonのService account automations [url: https://docs.canton.network/integrations/wallet-gateway/automation/service-account-automations]
```

## 出典

https://docs.canton.network/integrations/wallet-gateway/overview

https://docs.canton.network/integrations/wallet-gateway/quickstart

https://docs.canton.network/reference/wallet-gateway-json-rpc/operations/dapp-remote-api/prepareexecute

https://docs.canton.network/integrations/wallet-gateway/operate/configure

https://docs.canton.network/integrations/wallet-gateway/reference/configuration-reference

https://docs.canton.network/integrations/wallet-gateway/operate/networks-and-identity

https://docs.canton.network/integrations/wallet-gateway/operate/signing-providers

https://docs.canton.network/integrations/wallet-gateway/use/approve-and-sign

https://docs.canton.network/integrations/wallet-gateway/automation/service-account-automations

https://docs.canton.network/integrations/wallet-gateway/operate/self-issued-authentication

https://docs.canton.network/integrations/wallet-gateway/use/party-management
