You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
18
18
19
19
## 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.
21
21
22
22
## 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.
24
24
25
25
## 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.
30
30
31
31
## 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:
33
33
34
34
### 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:
36
36
37
37
```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
40
40
/// @return responseCode The response code for the status of the request. SUCCESS is 22.
41
41
/// @return tokenAddress The created token's address
42
42
function createToken(
@@ -51,16 +51,16 @@ Add support for `KeyList` types within the token creation parameters:
51
51
(responseCode, tokenAddress) = success
52
52
? abi.decode(result, (int32, address))
53
53
: (HederaResponseCodes.UNKNOWN, address(0));
54
-
}
54
+
}
55
55
```
56
56
57
57
### 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:
59
59
60
60
```solidity
61
-
/// Operation to update token keys with KeyList support
61
+
/// Operation to update token keys with Threshold Key support
62
62
/// @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
64
64
/// @return responseCode The response code for the status of the request. SUCCESS is 22.
65
65
function updateTokenKeys(
66
66
address token,
@@ -82,19 +82,19 @@ Add support for `KeyList` types within `IHederaTokenService.TokenKey[]` in the `
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.
120
120
121
121
## 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.
123
123
124
124
## 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.
0 commit comments