Replies: 1 comment 4 replies
-
Hey @Nana-EC I finally got around to drafting this HIP idea. It's a relatively simple improvement that could provide significant benefits for developers. I'd greatly appreciate your feedback when you have a moment. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Abstract
This proposal suggests extending the Hedera EVM to support signature verification and public key retrieval within smart contracts. This would be achieved by introducing a new precompiled contract that implements the signature verification algorithm for the ED25519 key system and a method to retrieve the public key associated with a given accountId.
Motivation
The Hedera EVM implementation lacks the ability to easily verify ED25519 signatures within smart contracts and retrieve the public key of an accountId, limiting the type of applications that can be built on top of it. This proposal aims to overcome these limitations, enabling a new class of applications on Hedera.
Rationale
Adding a ED25519 signature verification mechanism and public key retrieval function, akin to Ethereum's EIP-665, would enable contracts to verify off-chain actions, enforce cryptographic commitments, implement meta-transaction patterns, and much more. This function could be realized as a new precompiled contract in the Hedera EVM, similar to Ethereum's approach. The ability to retrieve the public key for a given accountId is also essential in cases where a single ED25519 public key can be associated with multiple accountIds.
User Stories
As a dApp developer, I want to create a token contract with a permit function(such as an EIP-2612 token i.e. ERC20 Permit) that allows token owners to approve spenders via signed messages, reducing the need for multiple transactions.
This would also enable all other applications that make use of
ecrecover
to now also verify ED25519 signatures(albeit with few modifications).Specification
Extended ERC20 Permit Example
Backwards Compatibility
This proposal should not introduce any backwards compatibility issues. Existing contracts will continue to operate as they do now, and the new functionality will be available for new contracts or updated versions of existing ones.
Security Implications
The introduction of signature verification and public key retrieval must be handled carefully. The implementation of the ED25519 signature verification algorithm must be secure, and contracts using it must be careful to correctly handle the public key and accountId.
References
EIP-665: Add precompiled contract for Ed25519 signature verification - https://eips.ethereum.org/EIPS/eip-665
EIP-712: Ethereum typed structured data hashing and signing - https://eips.ethereum.org/EIPS/eip-712
EIP-2612: permit – 712-signed approvals - https://eips.ethereum.org/EIPS/eip-2612
Beta Was this translation helpful? Give feedback.
All reactions