Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create hip-1021 #1021

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions HIP/hip-1021.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
hip: 1021
title: Improve Assignment of Auto-Renew Account ID for Topics
author: Michael Kantor (@kantorcodes)
type: Standards Track
category: Service
status: Draft
created: 2024-08-01
requested-by: TierBot
discussions-to: https://github.com/hashgraph/hedera-improvement-proposal/pull/1021
needs-council-approval: Yes
---

## Abstract

This HIP proposes a modification to the Hedera Consensus Service (HCS) to:
- Enable setting the `autoRenewAccountId` to the account creating a `TopicCreateTransaction` when an Admin Key is not present during Topic Creation.
- It ensures that for all existing topics with only a Submit Key and no `autoRenewAccountId`, the original `payer_account_id` of the topic is retroactively set as the `autoRenewAccountId`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not modify existing topics IMO:

  • We usually do not modify existing entities. A user may have left autoRenewAccount empty intentionally and disagrees with this change.
  • This would have to be initiated outside of the consensus node because the consensus node does not store the original payer_account_id.
  • It is unclear who should pay for these transactions.

- Automatically set the `autoRenewAccountId` to the `payer_account_id` of the Topic Id to prevent unintended user error.
Copy link
Contributor

@netopyr netopyr Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would I be able to leave this field empty intentionally?
Another solution could be to set this as a default in the SDKs. This would give me a similar experience, but I would still be able to clear the autoRenewAccountId.


## Motivation

Currently, when a Topic ID is created, the `autoRenewAccountId` is not automatically set to the account that initiated the transaction. Additionally:

- It is only possible to set this field when an Admin Key is generated with the Topic. For topics that are created with the intention of being more "immutable," this is a risk.
- Up until HIP-874 (https://github.com/hashgraph/hedera-improvement-proposal/pull/883/files), it was not easy to verify if a Topic was successfully created with an Autorenew Account Id, leading to more unexpected errors for users.

This proposal seeks to simplify the process for users by making the auto-renewal mechanism seamless, eliminating the need for manual setting of the `autoRenewAccountId`. This change will reduce the potential for errors and ensure that topics are automatically renewed by the account responsible for their creation. Moreover, this proposal aims to provide backward compatibility by setting the `autoRenewAccountId` for previously created topics to the `payer_account_id` of those topics.

## Rationale

The proposed change simplifies user interactions with HCS and ensures consistency in managing topic renewals. Automatically associating the `autoRenewAccountId` with the topic `payer_account_id` account reduces complexity and the risk of unexpected topic expirations due to missing auto-renewal settings. For existing topics, retroactively setting the `autoRenewAccountId` to the `payer_account_id` ensures a uniform approach to topic management, especially when rent is enabled. At present, due to the inability to set an `autoRenewAccountId` on Topics without a Submit Key.

## Specification

### Automatic Setting of autoRenewAccountId

When a new Topic ID is created, the `autoRenewAccountId` shall be automatically set to the account ID that creates the transaction, providing additional flexibility for when an Admin Key is not set.

### Backwards Compatibility

For all topics created before this proposal is implemented, the `autoRenewAccountId` shall be set to the original `payer_account_id` of the topic. This change shall be applied if and when rent is enabled for these topics.
This retroactive setting shall not require any action from the original topic creators and shall be handled by the Hedera network.

### Transaction Changes

The current implementation allows for the `autoRenewAccountId` to be specified during topic creation only when an Admin Key is present. This proposal does not remove this capability but adds an automatic default to the transaction creator's account if not explicitly set, and the capability to set an `autoRenewAccountId` when only the Submit Key is present during creation.

## Backwards Compatibility

This proposal ensures backwards compatibility by defaulting the `autoRenewAccountId` to the original `payer_account_id` for all existing topics. This approach preserves the integrity of previously created topics and aligns future topic renewals with their original creators.

## Implementation

The Hedera node software will be updated to support automatic assignment of the `autoRenewAccountId` during the topic creation process.
A migration process will be implemented to update the `autoRenewAccountId` for all existing topics to their the `payer_account_id`.

## Drawbacks

The primary drawback is the automatic nature of this feature, which may limit flexibility for users who wish to set a different `autoRenewAccountId`. However, this drawback is mitigated by allowing users to change the `autoRenewAccountId` post-creation if necessary.

## Alternatives

- **Future Rent Logic Adjustments:** If rent is enabled for TopicId Entities and a Topic Id was created before this HIP, rent would be charged to the `payer_account_id` of the Topic Id when an Autorenew Account Id was not present.
- **No Retroactive Changes:** Implement the automatic setting of `autoRenewAccountId` only for new topics without making retroactive changes. This alternative would lead to inconsistent handling of auto-renewal across topics.