操作

更新

Last updated August 26, 2026

現在の MPL-Distro 権限者は、新しい PDA を作らず既存のクレームレシートを無効化せずに、選択した配布フィールドを変更できます。

概要

updateDistribution は既存配布に対して権限者が承認した設定変更を適用します。

  • 完全な割り当て設定はアクティブなクレーム期間外でのみ変更します。
  • 権限者や permissioned distributor などの運用フィールドはクレーム中に変更できます。
  • 権限者変更は即時かつセキュリティ上重要として扱います。
  • ルート更新と同時に、置き換え Merkle 証明をアトミックに公開します。

クイックスタート

MPL-Distro 配布の更新は、既存アカウントへの署名付き設定変更です。

  1. クラスタ時刻が包含的な startTimeendTime の間にあるかを確認します。
  2. 変更すべきフィールドだけを updateDistribution に渡します。
  3. Merkle ルートが変わる場合は、すべてのオフチェーン証明を同時に置き換えます。
  4. 確認後に保存済み権限者と permissioned distributor を検証します。

MPL-Distro の更新権限

現在の権限者がすべての配布更新に署名する必要があります。

フィールド開始前アクティブ期間中終了後
merkleRootYesNoYes
treeHeightYesNoYes
startTimeYesNoYes
endTimeYesYesYes
totalClaimantsYesNoYes
newAuthorityYesYesYes
nameYesYesYes
newPermissionedDistributorYesYesYes

アクティブ期間は両方の境界タイムスタンプを含みます。保護された割り当てフィールドは startTime <= clusterTime <= endTime のときロックされます。

ルート更新には一致する証明が必要

Merkle ルートを変えると、以前のルート用に生成したすべての証明が無効になります。置き換え割り当てファイルをオンチェーン更新とアトミックに公開して保存してください。

MPL-Distro 設定を更新する

変更すべきフィールドだけを updateDistribution に渡します。

updateDistribution.ts
1import { mplDistro, updateDistribution } from '@metaplex-foundation/mpl-distro'
2import { publicKey } from '@metaplex-foundation/umi'
3import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
4
5const umi = createUmi(
6 process.env.RPC_URL ?? 'https://api.devnet.solana.com'
7).use(mplDistro())
8
9const distributionAddress = process.env.DISTRIBUTION_ADDRESS!
10const newEndTimestamp = Math.floor(Date.now() / 1000) + 14 * 24 * 60 * 60
11const newDistributorAddress = process.env.PERMISSIONED_DISTRIBUTOR!
12
13await updateDistribution(umi, {
14 distribution: publicKey(distributionAddress),
15 endTime: BigInt(newEndTimestamp),
16 name: 'Extended community distribution',
17 newPermissionedDistributor: publicKey(newDistributorAddress),
18}).sendAndConfirm(umi)
19
20// The distribution end time, name, and permissioned distributor are updated.

totalClaimants を明示的な treeHeight なしで変えると、プログラムは最小高を推論します。新しく準備したツリーが返す treeHeight を渡す方が明確で、claimant 数推論への結合を避けられます。

配布権限者を変更する

updateDistribution は、更新、入金、トークン出金、補助金出金ができる署名者を置き換えます。

changeDistributionAuthority.ts
1import { mplDistro, updateDistribution } from '@metaplex-foundation/mpl-distro'
2import { publicKey } from '@metaplex-foundation/umi'
3import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
4
5const umi = createUmi(
6 process.env.RPC_URL ?? 'https://api.devnet.solana.com'
7).use(mplDistro())
8
9const distribution = publicKey(process.env.DISTRIBUTION_ADDRESS!)
10const currentAuthority = umi.identity
11const nextAuthority = publicKey(process.env.NEXT_AUTHORITY!)
12
13await updateDistribution(umi, {
14 distribution,
15 authority: currentAuthority,
16 newAuthority: nextAuthority,
17}).sendAndConfirm(umi)
18
19// Subsequent deposits, withdrawals, and updates require the new authority.

新しい権限者は更新に署名する必要はありません。変更を送信する前に宛先公開鍵を確認し、その署名インフラが稼働していることを確かめてください。

Permissioned Distributor を変更する

updateDistributionAllowedDistributor.Permissioned で設定された配布が受け付ける署名者を変更します。updateDistributionnewPermissionedDistributor を渡します。

この変更は Merkle ツリーや既存レシートを変えません。以前の distributor が署名した進行中トランザクションは、更新が着地した後に失敗します。

更新エラー

更新エラーは権限者とタイミング制約を保護します。

エラー意味対処
DistributionStarted保護された割り当てフィールドがアクティブ期間中に変更された配布終了まで待つか、フィールドを変えない
InvalidDistributionAuthority渡された署名者が保存済み権限者ではない現在の権限者を使う
InvalidTreeHeightツリー高が最大を超える64 以下の値を使う
NameTooLongUTF-8 名が 32 バイトを超える配布名を短くする

注意事項

設定変更は確認後すぐに証明の有効性と運用権限に影響します。

  • アクティブ期間中の endTime 変更はクレーム期間を延長または短縮できます。
  • 期間後のルート更新は既存クレームレシートを削除しません。
  • 既存レシートは更新後も配布 PDA にキーされたままです。

FAQ

権限者はアクティブ期間中に Merkle ルートを変更できますか?

いいえ。ルート、ツリー高、開始時刻、claimant 数はアクティブ期間中ロックされますが、開始前または終了後は変更できます。

アクティブな配布中にクレーム終了時刻を延長できますか?

はい。権限者は配布がアクティブな間に endTime を更新できます。

新しい権限者は権限変更に署名する必要がありますか?

いいえ。現在の権限者だけが updateDistribution に署名します。送信前に宛先鍵を確認してください。