情報開発と利活用

情報開発と利活用

PR

Profile

令和維新

令和維新

Favorite Blog

🍊 武士の巨星・信長… New! 神風スズキさん

キハ20、DF50、キハ… New! GKenさん

源氏物語〔34帖 若菜… New! USM1さん

直説法、仮定法の「… samito07さん

P's Pictures P's Picturesさん

Category

カテゴリ未分類

(111)

連絡

(24)

交流会

(27)

セミナー

(29)

参考情報

(138)

オフ会

(36)

on-line報告会

(13)

翻訳ビジネス

(8)

情報開発

(270)

ビッグデータ

(79)

ブロックチェーン

(222)

人工知能

(389)

IOT

(283)

仮想通貨

(775)

コンテンツ

(120)

政治経済

(1701)

先端技術

(919)

DITA

(46)

テレワーク

(28)

UX

(0)

文書管理

(8)

テクニカルライテイング

(17)

学習

(9)

訓練

(1)

XMLソリューション

(3)

メタバース

(99)

Web3

(66)

投資

(134)

IoT

(27)

投資信託

(1)

ビットコイン

(546)

イーサリアム

(146)

NFT

(41)

オンライン

(0)

受動収入

(14)

ソーシャルメデイア

(0)

DAO

(2)

DeFi

(68)

暗号通貨

(151)

トークノミクス

(21)

アルトコイン

(215)

空中投下

(16)

スマート契約

(4)

ステーブルコイン

(41)

(5)

生成AI

(5)

SCM

(4)

ウオレット

(9)

不労所得

(51)

セキュリテイ

(4)

ミームコイン

(50)

CBDC

(5)

PoS

(3)

PoW

(1)

ETF

(11)

仮想通貨ETF

(1)

予言

(7)

裁定取引

(1)

GameFi

(5)

マイニング

(6)

RWA

(19)

DePIN

(18)

SWFT

(1)

WLFI

(1)

アービトラージ

(7)

XRP

(42)

大統領選

(4)

BCH

(1)

取引ボット

(17)

トレーデイング

(17)

不動産

(1)

詐欺

(4)

貿易戦争

(1)

医療

(1)

金融

(2)

TEZOS

(1)

CARDANO

(2)

カルダーノ

(3)

ステーキング

(4)

チェーンリンク

(1)

開発

(0)

HEDERA

(1)

スマートマネー

(0)

流動性

(0)

AIエージェント

(6)

401k

(1)

国際送金

(1)

solano

(1)

AI

(1)

Keyword Search

▼キーワード検索

Shopping List

お買いものレビューがまだ書かれていません。
2025.04.30
XML
カテゴリ: 仮想通貨

The Mechanics of Revenue-Generating Topics
収益を生み出すトピックの仕組み

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 がヘデラでどのように機能するかの仕組みを詳しく見ていきましょう。

Setting Fees During Topic Creation
トピック作成時の料金の設定

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 でのトークンの特注手数料作成と同様に機能します。このプロセスは、次の手順に従います。


    1. Define one or more fixed fees (up to 10 entries allowed)
      1
      つ以上の固定料金を定義する ( 最大 10 エントリまで許可される )
    2. Specify whether each fee is in HBAR or an HTS fungible token
      各料金が HBAR または HTS 代替トークンであるかどうかを指定する
    3. Set the fee amount for each message submission
      各メッセージ送信の手数料額を設定
    4. Designate the fee collector account(s) that will receive the payments
      支払いを受け取る料金コレクターアカウントを指定
    5. Optionally set a Fee Schedule Key to manage future fee updates
      オプションで、将来の料金更新を管理するための料金スケジュールキーを設定

    Fee Payment Flow
    料金支払いフロー

    When a user submits a message to a topic with custom fees, the following process occurs:
    ユーザーがカスタム料金でトピックにメッセージを送信すると、次のプロセスが発生します。


      1. The user submits a  TopicMessageSubmitTransaction to the network
        ユーザーが トピック メッセージ トランザクションの送信をネットワークに送信する
      2. The network validates the transaction and checks if fees are required
        ネットワークはトランザクションを検証し、手数料が必要かどうかチェックする。
      3. If the submitter’s key is in the Fee Exempt Key List, no fee is charged
        送信者のキーが手数料免除キー リストにある場合、手数料は請求されない。
      4. Otherwise, the network checks if the user has sufficient balance for the fee
        それ以外の場合、ネットワークはユーザーが手数料に対して十分な残高を持っているかどうかをチェックする
      5. The fee is transferred from the sender’s account to the designated fee collector account(s)
        手数料は送信者のアカウントから指定された手数料コレクター アカウントに送金される
      6. The message is recorded on the topic if all conditions are met
        すべての条件が満たされると、メッセージはトピックに記録される

      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.
      ユーザーが手数料を賄うのに十分な資金がない場合、取引は失敗しますが、ネットワーク手数料は依然として請求されます。これにより、ユーザーはトランザクションが失敗したネットワークにコストをかけずにスパムを送信することができなくなります。

      User Protection with Max Custom Fee Limits
      最大カスタム手数料制限によるユーザー保護

      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 では トランザクション本体に最大特注料金フィールドが導入されています。これにより、ユーザーは支払う意思のある最大料金を指定できます。手数料がこの制限を超えると、トランザクションは適切なエラーで失敗します。この保護手段により、トピック演算子がトランザクションが作成されてから処理されるまでの間に手数料が予期せず増加する状況を防ぐことができます。

      Updating Fees with the Fee Schedule Key
      料金表キーによる料金の更新

      Topic operators can adjust fees over time using the Fee Schedule Key:
      トピック演算子は、料金表キーを使用して、時間の経過とともに手数料を調整できます。


        1. The operator creates a  ConsensusUpdateTopicTransaction
          演算子は合意更新トピックトランザクションを作成する
        2. The transaction includes the updated  custom_fees  property
          トランザクションには、更新された特注料金プロパティが含まれる
        3. The transaction must be signed by the Fee Schedule Key
          トランザクションは、料金表キーによって署名される必要がある
        4. Once processed, the updated fees apply to all future message submissions
          処理が完了すると、更新された料金は今後のすべてのメッセージ送信に適用される

        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.
        このメカニズムにより、市場の状況、ネットワークの使用、または進化するビジネスモデルに基づいた動的な価格設定が可能になります。トピックが料金スケジュールキーなしで作成された場合、料金を後で追加または変更することはできず、ユーザーに確実性を提供します。

        Fee Exemptions for Authorized Participants
        認定参加者の手数料免除

        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 個のキーを含めることができ、さまざまなキーの種類がサポートされています。


          • Single ED25519/ECDSA keys
            単一の ED25519/ECDSA キー
          • Threshold keys requiring multiple signatures
            複数の署名が必要なしきい値キー
          • Key lists for flexible authorization option
            柔軟な認証オプションのためのキーリスト

        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 層構造のシステムが生まれ、公開投稿が収益を生み出します。

        Practical Steps for Developers
        開発者向けの実践的なステップ

        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 テストネットのカスタム料金の更新、および効果的な料金管理の最善事例の概要を示します。

        Code Example
        コード例​

        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.");
        }


        インターネット・コンピュータランキング
        ==============================
        ネットサービスランキング
        ==============================

        [商品価格に関しましては、リンクが作成された時点と現時点で情報が変更されている場合がございます。]

        PlayStation5 Pro 価格:119,980円(税込、送料無料)  (2024/10/2時点)






        お気に入りの記事を「いいね!」で応援しよう

        Last updated  2025.05.01 05:22:53
        コメント(0) | コメントを書く


        【毎日開催】
        15記事にいいね!で1ポイント
        10秒滞在
        いいね! -- / --
        おめでとうございます!
        ミッションを達成しました。
        ※「ポイントを獲得する」ボタンを押すと広告が表示されます。
        x
        X

        © Rakuten Group, Inc.
        X
        Design a Mobile Site
        スマートフォン版を閲覧 | PC版を閲覧
        Share by: