# 報酬のmintを委任先に任せる

> external partyの受益者が報酬のmintを委任先に任せると、validatorのノードの自動化がどの条件でどの引換券をmintしてAmuletをまとめ、委任のコントラクトが何を持つかを、表と2つの図で追います。

- URL: https://cardene.dev/diagrams/canton-minting-delegation
- 公開日: 2026-11-22
- 更新日: 2026-11-22
- トピック: Blockchain
- タグ: Canton
- 親の図解: [mintの委任](https://cardene.dev/diagrams/canton-reward-minting-delegation.md): external partyの受益者が報酬のmintを委任先に任せる仕組みを、委任のコントラクトとvalidatorのノードの自動化から、章の中の図解で追います。

この頁は、minting delegationを追います。
minting delegationは、委任先が自分のvalidatorのノードに、同じノードがホストするexternal partyの受益者の代わりに、報酬のmintを自動で行わせる仕組みです。
external partyの報酬の受け取りを自動にするために使います。

まず、委任が与える権限と、委任が持つ性質と、委任でmintできる引換券を見ます。
続けて、validatorのノードの自動化が動く条件と、引換券をmintしてAmuletをまとめる順を追います。
最後に、委任のコントラクトが持つ欄とchoiceと、受け入れる前に確かめる事を見ます。

external partyは、頁「外部署名のparty」で見ました。

https://cardene.dev/diagrams/canton-external-party

報酬の引換券は、頁「roundごとに報酬の引換券を作る」で見ました。

https://cardene.dev/diagrams/canton-amulet-rewards

minting delegationは、頁「roundごとにCCを発行して配る」と、頁「trafficでアプリの報酬を決める」と、頁「アプリの報酬を他のpartyと分ける」と、頁「アプリ提供者が報酬を得る条件」でも触れました。

https://cardene.dev/diagrams/canton-cc-rewards

https://cardene.dev/diagrams/canton-traffic-app-rewards

https://cardene.dev/diagrams/canton-reward-sharing

https://cardene.dev/diagrams/canton-app-rewards

walletの背後の自動化の報酬の回収は、頁「組み込みのwalletで送金する」で見ました。

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

signatoryとchoiceとcontrollerは、頁「誰が変更を頼めるかを決める」で見ました。

https://cardene.dev/diagrams/canton-ledger-authorization

`TransferInput`と`PaymentTransferContext`と`TransferResult`は、頁「Canton Coinを送る」で見ました。

https://cardene.dev/diagrams/canton-amulet-transfer

DSOのpartyは、頁「DSOとSpliceの構成」で見ました。

https://cardene.dev/diagrams/canton-dso-structure

## 委任は報酬のmintとAmuletのまとめを任せる

minting delegationは、委任先に、受益者の代わりに2つの事をする権限を与えます。
1つ目は、報酬の引換券をmintする事です。
2つ目は、受益者のAmuletを、設定した上限まで自動でまとめる事です。

委任先になれるのは、validatorのノードのwalletに加えられた任意のpartyです。
validatorの運用者のpartyのほかに、internal partyもなれます。

委任は、次の表の4つの性質を持ちます。

| 性質 | 中身 |
|---|---|
| 受益者 | 代わりにmintされるexternal party |
| 委任先 | mintを行う権限を持つinternal party |
| 期限 | 委任が無効になる時刻 |
| Amuletをまとめる上限 | 自動でまとめた後に残すAmuletの数 |

委任でmintできる引換券の型は、次の6つです。

- `ValidatorRewardCoupon`
- `UnclaimedActivityRecord`
- `DevelopmentFundCoupon`
- `AppRewardCoupon`
- `ValidatorLivenessActivityRecord`
- `SvRewardCoupon`

`ValidatorRewardCoupon`をmintするには、受益者が先に`ValidatorRight`を作ることが前提です。
`SvRewardCoupon`を委任でmintできるのは、Splice 0.9.0からです。

## 自動化は委任が有効な間に動く

委任が有効な間、validatorのノードは、受益者のために自動化の`MintingDelegationCollectRewardsTrigger`を定期的に動かします。
この自動化は、受益者が持つmintできる引換券を探し、受益者の代わりに集めてmintします。
自動化は、受益者のAmuletの数が上限の2倍を超えた時に、受益者のAmuletをまとめます。

自動化が動く条件は、次の表の5つです。

| 条件 | 中身 |
|---|---|
| 委任先 | validatorのノードのwalletに加えられたpartyです。validatorの運用者のpartyか、自分のユーザー用のアカウントを持つほかのinternal partyです |
| 期限 | 委任が期限切れではありません |
| 受益者のホスト | 受益者が、validatorのノードに、少なくともobserver modeでホストされています |
| walletのアプリ | 受益者は、walletのアプリに加えないことが勧められています。加えると、委任の自動化がwalletのアプリの組み込みの自動化と競合するためです |
| 処理の対象 | 受益者が、処理の要る引換券かAmuletを持っています |

Splice Walletのpartyは最大200までで、minting delegationもその数に入ります。
自動化は、委任先のpartyとしてトランザクションを出し、その費用はvalidatorのノードのtrafficの残高から払います。

Amuletの数が上限の2倍を超えると、自動化は、最も小さいAmuletからまとめて、設定の数ちょうどに保ちます。

図Aは、自動化が引換券をmintしてAmuletをまとめるまでを追います。
この図では、動く条件と費用は線を引かず、線の無い段で示します。

```dragon
sequence 自動化がmintしてまとめる順

box C as 受益者の引換券 [note: mintできる物, color: slate, icon: doc]
box V as validatorのノードの自動化 [note: 受益者のために動く, color: blue, icon: server]
box A as 受益者のAmulet [note: まとめる対象, color: rose, icon: doc]

step 動く条件
  say 自動化は、委任先がwalletに加えられたpartyで、委任が期限の内にあり、受益者が少なくともobserver modeでホストされ、処理の要る引換券かAmuletがある時に動きます。
  act V: 条件が揃うと動く
  source CantonのMinting Delegations [url: https://docs.canton.network/global-synchronizer/splice-fundamentals/rewards-minting]

step 費用
  say 自動化は、委任先のpartyとしてトランザクションを出し、その費用はvalidatorのノードのtrafficの残高から払います。
  act V: 委任先としてトランザクションを出す
  source CantonのMinting Delegations [url: https://docs.canton.network/global-synchronizer/splice-fundamentals/rewards-minting]

step 探す
  say 自動化は、定期的に、受益者が持つmintできる引換券を探します。
  V -> C: 探す
  source CantonのMinting Delegations [url: https://docs.canton.network/global-synchronizer/splice-fundamentals/rewards-minting]

step mintする
  say 自動化は、受益者の代わりに、引換券を集めてmintします。
  V -> C: 集めてmintする
  source CantonのMinting Delegations [url: https://docs.canton.network/global-synchronizer/splice-fundamentals/rewards-minting]

step まとめる
  say 自動化は、受益者のAmuletの数が上限の2倍を超えた時に、Amuletをまとめます。
  V -> A: まとめる
  source CantonのMinting Delegations [url: https://docs.canton.network/global-synchronizer/splice-fundamentals/rewards-minting]
```

## 委任のコントラクトは両者がsignatoryになる

`Splice.Wallet.MintingDelegation`のモジュールの`MintingDelegation`は、委任先が受益者に代わって報酬をmintする権利を表すtemplateです。
signatoryは、`beneficiary`と`delegate`の2者です。
欄は、次の表の5つです。

| 欄 | 型 | 中身 |
|---|---|---|
| `beneficiary` | `Party` | 代わりにmintが行われるparty |
| `delegate` | `Party` | mintを行う権限を持つparty |
| `dso` | `Party` | 想定するDSOのparty |
| `expiresAt` | `Time` | この委任が無効になる時刻 |
| `amuletMergeLimit` | `Int` | 自動でまとめた後に残すAmuletのコントラクトの数。この欄では、コントラクトの数がこの数を厳密に超えた時に、自動でまとめます |

`amuletMergeLimit`は、委任先への提案にとどまり、Damlの中では強制されません。

`MintingDelegation`のchoiceは、次の表の4つです。

| choice | controller | 受け取る物 | 返す物 |
|---|---|---|---|
| `Archive` | `beneficiary`と`delegate` | 欄なし | `()` |
| `MintingDelegation_Mint` | `delegate` | `[TransferInput]`の`inputs`と、`PaymentTransferContext`の`context` | 欄`transferResult`を持つ`MintingDelegation_MintResult`。`transferResult`は`TransferResult`です |
| `MintingDelegation_Reject` | `delegate` | 欄なし | 欄を持たない結果 |
| `MintingDelegation_Withdraw` | `beneficiary` | 欄なし | 欄を持たない結果 |

`inputs`は、受益者が持つ`ValidatorLivenessActivityRecord`などの、送金の入力です。
`context`は、Amuletの規則を含む、送金の`PaymentTransferContext`です。
`MintingDelegation_Reject`と`MintingDelegation_Withdraw`の操作は、次の頁「mintの委任を提案して受け入れる」が追います。

図Bは、委任のコントラクトが持つ物を、signatoryと欄とchoiceの3つの枝にして追います。
この図では、枝は表の順に足し、枝どうしの線は描きません。

```dragon
mind 委任のコントラクトが持つ物

step 委任のコントラクト
  say 委任のコントラクトが持つ物を、signatoryと欄とchoiceの3つの枝で追います。
  idea root as "委任のコントラクト" [color: slate]
  source CantonのSplice.Wallet.MintingDelegation [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-wallet/splice-wallet-mintingdelegation]

step signatory
  say signatoryは、受益者と委任先の2者です。
  idea s as "signatory" of root [color: blue]
  idea s1 as "受益者" of s [color: blue]
  idea s2 as "委任先" of s [color: blue]
  source CantonのSplice.Wallet.MintingDelegation [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-wallet/splice-wallet-mintingdelegation]

step partyの欄
  say 欄のうち、受益者と委任先と想定するDSOの3つは、partyを持ちます。
  idea f as "欄" of root [color: blue]
  idea f1 as "受益者のparty" of f [color: blue]
  idea f2 as "委任先のparty" of f [color: blue]
  idea f3 as "想定するDSO" of f [color: blue]
  source CantonのSplice.Wallet.MintingDelegation [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-wallet/splice-wallet-mintingdelegation]

step 残る2つの欄
  say 残る2つの欄は、委任が無効になる時刻と、まとめた後に残す数です。
  idea f4 as "無効になる時刻" of f [color: blue]
  idea f5 as "まとめた後に残す数" of f [color: blue]
  source CantonのSplice.Wallet.MintingDelegation [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-wallet/splice-wallet-mintingdelegation]

step 委任先のchoice
  say 委任先がcontrollerのchoiceは、MintingDelegation_MintとMintingDelegation_Rejectです。
  idea c as "choice" of root [color: blue]
  idea c1 as "委任先のMint" of c [color: blue]
  idea c2 as "委任先のReject" of c [color: blue]
  source CantonのSplice.Wallet.MintingDelegation [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-wallet/splice-wallet-mintingdelegation]

step 受益者と両者のchoice
  say 受益者がcontrollerのchoiceはMintingDelegation_Withdrawで、受益者と委任先の両方がcontrollerのchoiceはArchiveです。
  idea c3 as "受益者のWithdraw" of c [color: blue]
  idea c4 as "両者のArchive" of c [color: blue]
  source CantonのSplice.Wallet.MintingDelegation [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-wallet/splice-wallet-mintingdelegation]
```

## 受け入れる前に確かめる事

Wallet UIでは、委任先が、委任の提案を受け入れる前に、次の2つを確かめることが勧められています。

- 受益者を知っていて信頼できるか、party IDが期待どおりか
- validatorの運用者が、mintのトランザクションの費用をvalidatorのノードのtrafficの残高から払ってよいか

Wallet UIでは、委任先が、有効な委任を定期的に見直し、要らない物と認めていない物を取り下げることが勧められています。

## 次に読む頁

次の頁「mintの委任を提案して受け入れる」は、受益者がLedger APIで委任の提案を作って取り下げ、委任先がWallet UIで提案を受け入れて既存の委任を置き換える手順と、validatorの活動と報酬の記録を確かめるAPIを追います。

https://cardene.dev/diagrams/canton-minting-delegation-proposal

## 出典

https://docs.canton.network/global-synchronizer/splice-fundamentals/rewards-minting

https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-wallet/splice-wallet-mintingdelegation
