PR
Comments
New!
GKenさん
New!
USM1さん
samito07さんCategory
Keyword Search
Freepage List
Shopping List
Understanding the foundational workflows enabled by HIP-991 is essential for developers looking to leverage these new capabilities. Let’s break down the mechanics of how these permissionless revenue-generating topic IDs function on Hedera.
HIP-991
によって実現される基本的なワークフローを理解することは、これらの新機能を活用しようとしている開発者にとって不可欠です。これらの許可不要収益創出トピック
ID
がヘデラでどのように機能するかの仕組みを詳しく見ていきましょう。
When creating a new topic, developers can now specify custom fees using the custom_fees
property in the ConsensusCreateTopicTransactionBody
. This works similarly to custom fee creation for tokens in HTS. The process follows these steps:
新しいトピックを作成する際に、開発者はコンセンサス
トランザクション本体の特注料金プロパティを使用して特注料金を指定できるようになりました。これは、
HTS
でのトークンの特注手数料作成と同様に機能します。このプロセスは、次の手順に従います。
When a user submits a message to a topic with custom fees, the following process occurs:
ユーザーがカスタム料金でトピックにメッセージを送信すると、次のプロセスが発生します。
The transaction fails if the user doesn’t have sufficient funds to cover the fee, but the network fee is still charged regardless. This ensures that users can’t spam the network with failed
transactions without cost.
ユーザーが手数料を賄うのに十分な資金がない場合、取引は失敗しますが、ネットワーク手数料は依然として請求されます。これにより、ユーザーはトランザクションが失敗したネットワークにコストをかけずにスパムを送信することができなくなります。
To protect users from unexpected or excessive fees, HIP-991 introduces a max_custom_fee
field in the TransactionBody
. This allows users to specify the maximum fee they’re willing to pay. If the fee exceeds this limit, the transaction will fail with an appropriate error. This safeguard prevents situations where a topic operator might increase fees unexpectedly between when a transaction is created and when it’s processed.
予期しない手数料や過剰な手数料からユーザーを保護するために、
HIP-991
では
トランザクション本体に最大特注料金フィールドが導入されています。これにより、ユーザーは支払う意思のある最大料金を指定できます。手数料がこの制限を超えると、トランザクションは適切なエラーで失敗します。この保護手段により、トピック演算子がトランザクションが作成されてから処理されるまでの間に手数料が予期せず増加する状況を防ぐことができます。
Topic operators can adjust fees over time using the Fee Schedule Key:
トピック演算子は、料金表キーを使用して、時間の経過とともに手数料を調整できます。
This mechanism allows for dynamic pricing based on market conditions, network usage, or evolving business models. If a topic was created without a Fee Schedule Key, fees cannot be added or modified later, providing certainty for users.
このメカニズムにより、市場の状況、ネットワークの使用、または進化するビジネスモデルに基づいた動的な価格設定が可能になります。トピックが料金スケジュールキーなしで作成された場合、料金を後で追加または変更することはできず、ユーザーに確実性を提供します。
The Fee Exempt Key List can be updated through a ConsensusUpdateTopicTransaction
signed by the topic’s Admin Key. This list can contain up to 10 keys and supports various key
types:
手数料免除キーリストは、トピックの管理者キーによって署名された合意更新トピックトランザクションを通じて更新できます。このリストには、最大
10
個のキーを含めることができ、さまざまなキーの種類がサポートされています。
When a transaction is signed by a key on this list, the custom fee is waived entirely, though standard network fees still apply. This creates a two-tier system where trusted participants can interact freely while public submissions generate revenue.
このリストのキーによってトランザクションが署名された場合、カスタム手数料は完全に免除されますが、標準のネットワーク手数料は引き続き適用されます。これにより、信頼できる参加者が自由に交流できる
2
層構造のシステムが生まれ、公開投稿が収益を生み出します。
Now that we understand the technical foundations of HIP-991, let’s take a look at a practical implementation for developers looking to create and manage topics with custom fees. This section provides a concrete example using the Hedera JavaScript SDK
setting and updating custom fees on the Hedera testnet, and outlines best practices for effective fee management.
HIP-991
の技術的基盤を理解したところで、カスタム料金でトピックを作成および管理しようとしている開発者向けの実用的な実装を見てみましょう。このセクションでは、
Hedera JavaScript SDK
の設定を使用した具体的な例と、
Hedera
テストネットのカスタム料金の更新、および効果的な料金管理の最善事例の概要を示します。
require("dotenv").config();
const {
Client,
PrivateKey,
AccountCreateTransaction,
Hbar,
TopicCreateTransaction,
TopicMessageSubmitTransaction,
TopicUpdateTransaction
} = require("@hashgraph/sdk");
async function main() {
// --- Set up main testnet client using your main wallet credentials ---
const operatorId =process.env.MAIN_ACCOUNT_ID;
const operatorPrivateKey =process.env.MAIN_PRIVATE_KEY;
const operatorPublicKey =process.env.MAIN_PUBLIC_KEY;
if (!operatorId || !operatorPrivateKey || !operatorPublicKey) {
throw new Error("Please set MAIN_ACCOUNT_ID, MAIN_PRIVATE_KEY and MAIN_PUBLIC_KEY in your .env file.");
}
const client = Client.forTestnet();
client.setOperator(operatorId, operatorPrivateKey);
console.log(`Main client initialized with operator: ${operatorId}`);
// --- Create two new accounts with ECDSA keys and an initial balance of 10 HBAR each ---
console.log("\nGenerating two new ECDSA key pairs...");
const newKey1 =PrivateKey.generateECDSA();
const newKey2 =PrivateKey.generateECDSA();
console.log(`Account 1 public key: ${newKey1.publicKey.toStringRaw()}`);
console.log(`Account 2 public key: ${newKey2.publicKey.toStringRaw()}`);
console.log("\nCreating new account 1 with 10 HBAR initial balance...");
const createTx1 = await new AccountCreateTransaction()
.setKey(newKey1.publicKey)
.setInitialBalance(new Hbar(10))
.execute(client);
const receipt1 = await createTx1.getReceipt(client);
const accountId1 = receipt1.accountId;
console.log(`Account 1 created with ID:${accountId1}`);
console.log("\nCreating new account 2 with 10 HBAR initial balance...");
const createTx2 = await new AccountCreateTransaction()
.setKey(newKey2.publicKey)
.setInitialBalance(new Hbar(10))
.execute(client);
const receipt2 = await createTx2.getReceipt(client);
const accountId2 = receipt2.accountId;
console.log(`Account 2 created with ID: ${accountId2}`);
// --- Create HIP-991 topic ---
// The topic is created with:
// • the first wallet’s public key (newKey1) in the fee‐exempt list,
// • a custom fee of 5 HBAR,
// • and a “custom fee key” (here, set as the admin key) equal to the main wallet’s public key.
console.log("\nCreating HIP‑991topic with custom fee parameters...");
const topicCreateTx = new TopicCreateTransaction()
.setTopicMemo("HIP‑991 Demo Topic")
// Set the admin key to the main wallet public key so that only the main wallet can update fees.
.setAdminKey(operatorPublicKey)
// Hypothetical HIP‑991 method: attach custom fee parameters
.setCustomFee({
fee: new Hbar(5),
feeExemptPublicKeys: [newKey1.publicKey.toStringRaw()]
});
const topicResponse = await
topicCreateTx.execute(client);
const topicReceipt = await topicResponse.getReceipt(client);
const topicId = topicReceipt.topicId;
console.log(`HIP‑991 topic created with ID: ${topicId}`);
// --- Submit a message from the first wallet (should be fee-exempt) ---
console.log("\nAccount 1 submitting a message (should be fee‑exempt)...");
// Create a separate client for Account 1 using its key
const client1 = Client.forTestnet();
client1.setOperator(accountId1.toString(), newKey1);
const msgTx1 = await new TopicMessageSubmitTransaction()
.setTopicId(topicId)
.setMessage("Message from Account 1, fee‑exempt")
.execute(client1);
const msgReceipt1 = await msgTx1.getReceipt(client1);
console.log(`Account 1 message submitted, status: ${msgReceipt1.status}`);
// --- Submit a message from the second wallet with max_custom_fee = 6 HBAR ---
console.log("\nAccount 2 submitting a message with max custom fee of 6 HBAR...");
const client2 = Client.forTestnet();
client2.setOperator(accountId2.toString(), newKey2);
const msgTx2 = await new TopicMessageSubmitTransaction()
.setTopicId(topicId)
.setMessage("Message from
Account 2 with max custom fee 6 HBAR")
// Hypothetical method for HIP‑991:
set max custom fee on message submission
.setMaxCustomFee(new Hbar(6))
.execute(client2);
const msgReceipt2 = await msgTx2.getReceipt(client2);
console.log(`Account 2 message submitted, status: ${msgReceipt2.status}`);
// --- Update the topic’s custom fee from 5 HBAR to 7 HBAR using the main wallet ---
console.log("\nMain wallet updating the topic custom fee to 7 HBAR...");
const topicUpdateTx = new TopicUpdateTransaction()
.setTopicId(topicId)
// Hypothetical method for updating HIP‑991 fee parameters:
.setCustomFee({
fee: new Hbar(7),
feeExemptPublicKeys: [newKey1.publicKey.toStringRaw()]
})
.freezeWith(client);
// Sign with the main wallet’s private key (the admin key)
const signedTopicUpdateTx = await topicUpdateTx.sign(operatorPrivateKey);
const topicUpdateResponse = await signedTopicUpdateTx.execute(client);
const topicUpdateReceipt = await topicUpdateResponse.getReceipt(client);
console.log(`Topic custom fee updated, status: ${topicUpdateReceipt.status}`);
// --- Have Account 2 try to submit another message after fee update ---
console.log("\nAccount 2 attempting to submit a message after fee update (with max custom fee still 6 HBAR)...");
try {
const msgTx3 = await new TopicMessageSubmitTransaction()
.setTopicId(topicId)
.setMessage("Message from
Account 2 after fee update")
.setMaxCustomFee(new Hbar(6)) //
This is lower than the updated fee of 7 HBAR
.execute(client2);
const msgReceipt3 = await
msgTx3.getReceipt(client2);
console.log(`Account 2 message
submitted after fee update, status: ${msgReceipt3.status}`);
} catch (error) {
console.error("Expected error
when submitting message from Account 2 after fee update:", error);
}
console.log("\nApplication completed.");
}
インターネット・コンピュータランキング
==============================
ネットサービスランキング
==============================
Xbox Series S 1TB (ブラック) 価格:44,577円(税込、送料無料) (2024/5/5時点)
60%以上えび(具)海老 エビ えび 一龍堂 餃子 ぎょうざ ギョウザ ギョーザ 100個 えび餃子 海老餃子 冷凍 生餃子 冷凍食品 冷凍餃子 送料無料 鮮度抜群 ぷりぷり 惣菜 中華惣菜 中華点心 人気 極上 贅沢 価格:7,960円(税込、送料無料) (2024/5/1時点)
PlayStation5 Pro 価格:119,980円(税込、送料無料) (2024/10/2時点)
🥛4年サイクルと、いつ退出するか🚪(🥛 Th… 2025.11.12
(2)4年サイクルと、いつ退出するか 2025.11.10
上昇の10月から下落の10月へ(From Uptober… 2025.11.10