GitHub Logo HIP-874: Enhancing Topic Metadata Accessibility in the Hedera REST API

Author Michael Kantor, Ty Smith
Requested By TierBot
Discussions-To https://github.com/hashgraph/hedera-improvement-proposal/pull/883
Status Accepted
Needs Council Approval Yes
Review period ends Wed, 27 Mar 2024 07:00:00 +0000
Type Standards Track
Category Mirror
Created 2024-02-14
Updated 2024-04-08

Abstract:

This HIP proposes an enhancement to the Hedera REST API to enable access to topic ID metadata, including the memo field and other relevant entity information. Currently, there is limited direct access to topic metadata through the REST API, which can hinder the development of applications that rely on this data for functionality or auditing purposes. This proposal aims to streamline access to topic metadata, reducing the need for workarounds and enhancing the capabilities of applications built on Hedera.

Motivation:

The ability to access topic ID metadata, including the memo field, submit key, and deleted field directly through the REST API is crucial for a wide range of applications, including messaging, event tracking, and audit-ability functions. Currently, developers may need to employ indirect methods or multiple API calls to retrieve this information, leading to inefficiencies and potential inaccuracies. By providing direct access to this metadata, the proposal seeks to enhance developer experience, reduce computational load, and foster the development of more feature-rich applications on the Hedera platform.

Specification:

The proposed enhancement involves extending the REST API to include a new endpoint to return topic ID metadata, including the memo field and other relevant entity information.

Route:

/api/v1/topics/{topic id}

Current Response Structure returns:

{"_status":{"messages":[{"message":"Not found"}]}}

Proposed Response Structure:

{
  "topic_id": "0.0.123456",
  "memo": "[Topic Memo]",
  "admin_key": {
      "_type": "ED25519",
      "key": "bfc9d4a344389324119eed485eb3a875b1e5a54bd189d2fd5ad88ce1d3473dee"
  },
  "deleted": false,
  "submit_key": {
      "_type": "ED25519",
      "key": "bfc9d4a344389324119eed485eb3a875b1e5a54bd189d2fd5ad88ce1d3473dee"
  },
  "auto_renew_period": 7890000,
  "auto_renew_account": "0.0.654321",
  "timestamp" : {
    "from: "1707953087.386834512",
    "to": null
  }
  "created_timestamp": "1707953087.386834512"
}

The addition of these fields will provide comprehensive metadata about topics directly through the API.

Rationale:

Providing direct access to topic ID metadata, including the memo and other relevant information, addresses a critical need for developers building on the Hedera network. This enhancement will facilitate a range of applications, from simple messaging systems to complex, multi-layered applications requiring detailed audit trails. The proposal supports the principles of transparency, efficiency, and developer friendliness that are essential to the Hedera ecosystem.

Backwards Compatibility:

This change is backwards compatible as it would entail the creation of a new API Endpoint. This ensures that existing applications will continue to operate without modification, while new and updated applications can take advantage of the enhanced metadata accessibility.

Security Implications:

The proposal does not introduce significant changes to the security posture of the Hedera API. Access controls and authentication mechanisms remain unchanged, ensuring that the introduction of additional metadata fields does not compromise the integrity or confidentiality of data within the Hedera network.

Citation

Please cite this document as: