Skip to content

Commit f7767dc

Browse files
mgarbsNeurone
authored andcommitted
update KeyList to Threshold Key verbage
1 parent 6ad1c06 commit f7767dc

File tree

1 file changed

+27
-26
lines changed

1 file changed

+27
-26
lines changed

HIP/hip-1069.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
---
22
hip: 1069
3-
title: Enable KeyList Support in HTS Token Creation and Update Operations
3+
title: Enable Threshold Key Support in HTS Token Creation and Update Operations
44
author: Michael Garber <@michael.garber>
55
working-group: Giuseppe Bertone <@giuseppebertone>, Nikolaos Kamarinakis <@nikolaoskamarinakis>
66
requested-by: Axelar
77
type: Standards Track
88
category: Service
99
needs-council-approval: Yes
10-
status: Draft
10+
status: Review
1111
created: 2024-10-31
1212
discussions-to: https://github.com/hashgraph/hedera-improvement-proposal/discussions/1069
13-
updated: 2024-10-31
13+
updated: 2024-01-16
1414
---
1515

1616
## Abstract
17-
This HIP proposes an enhancement to the Hedera Token Service (HTS) precompile functions to support **KeyLists** in both token creation and key updates. Although KeyLists are supported within the SDK, they cannot currently be set through the HTS precompiles, which limits their usability in smart contracts for token management. Enabling KeyList support within the HTS precompiles would allow token keys managed by KeyLists to be set during creation and updated on-chain, adding significant flexibility for contract-based token operations.
17+
This HIP proposes an enhancement to the Hedera Token Service (HTS) precompile functions to support **Threshold Keys** in both token creation and key updates. Although Threshold Keys are supported within the SDK, they cannot currently be set through the HTS precompiles, which limits their usability in smart contracts for token management. Enabling Threshold Key support (with threshold=1) within the HTS precompiles would allow token keys managed by multiple administrators to be set during creation and updated on-chain, adding significant flexibility for contract-based token operations.
1818

1919
## Motivation
20-
The Hedera SDK allows setting KeyLists for token keys, which is a useful feature for multi-signature setups and threshold-based authorizations. However, the HTS precompile functions do not currently support KeyLists, making it impossible to create or update token keys with multiple signatories directly on-chain. This limitation creates a gap in functionality, especially for projects that rely heavily on multi-signature control within contract environments, such as Axelar's cross-chain integrations.
20+
The Hedera SDK allows setting Threshold Keys for token keys, which is a useful feature for administrative setups where multiple potential administrators need equal permissions. However, the HTS precompile functions do not currently support Threshold Keys, making it impossible to create or update token keys with multiple potential administrators directly on-chain. This limitation creates a gap in functionality, especially for projects that require flexible administrative control within contract environments, such as Axelar's cross-chain integrations.
2121

2222
## Rationale
23-
Supporting KeyLists directly within the token creation and update precompiles aligns with Hedera's goal of providing flexible, decentralized token management. By allowing contract-based applications to set KeyLists during token creation and subsequent updates, developers can enhance security and improve token access controls within contract-managed tokens, without needing to rely on external SDK calls or workarounds.
23+
Supporting Threshold Keys (threshold=1) directly within the token creation and update precompiles aligns with Hedera's goal of providing flexible, decentralized token management. By allowing contract-based applications to set Threshold Keys during token creation and subsequent updates, developers can implement multiple administrator scenarios where any one of the specified administrators can perform operations. This simplifies administrative control without needing to rely on external SDK calls or workarounds. Due to Ethereum's lack of native multi-signature transaction support, this implementation focuses on threshold=1 scenarios, which covers the primary use case of allowing multiple potential administrators with equal permissions.
2424

2525
## User Stories
26-
1. **As a developer** managing a cross-chain bridge, I want to create tokens with KeyLists and update token keys through HTS precompiles, allowing multiple signatories to authorize operations.
27-
2. **As a DApp creator**, I want to create tokens with a `KeyList` as the supply key and update it as needed, using a threshold mechanism to ensure decentralized control over supply adjustments.
28-
3. **As a DAO member**, I want to both create and update token keys on-chain using a `KeyList` to allow multi-signature voting for key management.
29-
4. **As a protocol developer**, I want to initialize tokens with KeyLists during creation to establish proper governance controls from the start.
26+
1. **As a developer** managing a cross-chain bridge, I want to create tokens with Threshold Keys and update token keys through HTS precompiles, allowing multiple potential administrators to authorize operations.
27+
2. **As a DApp creator**, I want to create tokens with a Threshold Key as the supply key and update it as needed, enabling multiple administrators to have equal permission to adjust supply.
28+
3. **As a DAO member**, I want to both create and update token keys on-chain using a Threshold Key to allow any approved administrator to manage key operations.
29+
4. **As a protocol developer**, I want to initialize tokens with Threshold Keys during creation to establish flexible administrative controls from the start, where any designated administrator can perform operations.
3030

3131
## Specification
32-
The following updates are proposed to the HTS precompile functions:
32+
The following updates are proposed to the HTS precompile functions to support Threshold Keys with threshold=1:
3333

3434
### Updated Token Creation Function
35-
Add support for `KeyList` types within the token creation parameters:
35+
Add support for Threshold Key types within the token creation parameters:
3636

3737
```solidity
38-
/// Operation to create a token with KeyList support
39-
/// @param token The token creation parameters, including KeyLists for multi-key support
38+
/// Operation to create a token with Threshold Key support
39+
/// @param token The token creation parameters, including Threshold Keys for multi-admin support
4040
/// @return responseCode The response code for the status of the request. SUCCESS is 22.
4141
/// @return tokenAddress The created token's address
4242
function createToken(
@@ -51,16 +51,16 @@ Add support for `KeyList` types within the token creation parameters:
5151
(responseCode, tokenAddress) = success
5252
? abi.decode(result, (int32, address))
5353
: (HederaResponseCodes.UNKNOWN, address(0));
54-
}
54+
}
5555
```
5656

5757
### Updated `updateTokenKeys` Precompile Function
58-
Add support for `KeyList` types within `IHederaTokenService.TokenKey[]` in the `updateTokenKeys` function:
58+
Add support for Threshold Key types within `IHederaTokenService.TokenKey[]` in the `updateTokenKeys` function:
5959

6060
```solidity
61-
/// Operation to update token keys with KeyList support
61+
/// Operation to update token keys with Threshold Key support
6262
/// @param token The token address
63-
/// @param keys The token keys, including KeyLists for multi-key support
63+
/// @param keys The token keys, including Threshold Keys for multi-admin support
6464
/// @return responseCode The response code for the status of the request. SUCCESS is 22.
6565
function updateTokenKeys(
6666
address token,
@@ -82,19 +82,19 @@ Add support for `KeyList` types within `IHederaTokenService.TokenKey[]` in the `
8282
Example Usage for both operations:
8383

8484
```solidity
85-
// KeyList definition
85+
// Threshold Key definition (threshold=1)
8686
IHederaTokenService.TokenKey memory key = IHederaTokenService.TokenKey({
8787
keyType: KeyType.SUPPLY,
88-
key: KeyList({
88+
key: ThresholdKey({
8989
keys: [
9090
Key(KeyType.ECDSA_SECP256K1, ecdsaPublicKey1),
9191
Key(KeyType.CONTRACT_ID, contractId2)
9292
],
93-
threshold: 2
93+
threshold: 1 // Any one administrator can perform operations
9494
})
9595
});
9696
97-
// Creation with KeyList
97+
// Creation with Threshold Key
9898
IHederaTokenService.HederaToken memory tokenParams = IHederaTokenService.HederaToken({
9999
name: "Example Token",
100100
symbol: "EXT",
@@ -105,7 +105,7 @@ Example Usage for both operations:
105105
106106
(int responseCode, address tokenAddress) = IHederaTokenService.createToken(tokenParams);
107107
108-
// Updating with KeyList
108+
// Updating with Threshold Key
109109
IHederaTokenService.updateTokenKeys(tokenAddress, [key]);
110110
```
111111

@@ -116,13 +116,14 @@ No foreseen issues
116116
TBD
117117

118118
## How to Teach This
119-
This enhancement should be documented in the Hedera developer documentation, with examples on how to set KeyLists for token keys during both creation and updates using the HTS precompiles.
119+
This enhancement should be documented in the Hedera developer documentation, with examples on how to set Threshold Keys (threshold=1) for token keys during both creation and updates using the HTS precompiles, emphasizing the use case of enabling multiple potential administrators with equal permissions.
120120

121121
## Reference Implementation
122-
A reference implementation should mirror the specification given within the Hedera SDK to allow developers to use KeyLists within HTS precompiles for both token creation and updates, ensuring compatibility with both contract-based and SDK token operations.
122+
A reference implementation should mirror the specification given within the Hedera SDK to allow developers to use Threshold Keys within HTS precompiles for both token creation and updates, ensuring compatibility with both contract-based and SDK token operations.
123123

124124
## Rejected Ideas
125-
External SDK Workarounds: Using SDK calls outside of the smart contract was considered but found impractical for fully on-chain applications.
125+
1. External SDK Workarounds: Using SDK calls outside of the smart contract was considered but found impractical for fully on-chain applications.
126+
2. Support for Threshold Keys with threshold > 1: Due to Ethereum's lack of native multi-signature transaction support, implementing thresholds greater than 1 was deemed technically infeasible.
126127

127128
## Open Issues
128129
1.

0 commit comments

Comments
 (0)