Understanding Ethereum P2TR Addresses: Is a Compressed Public Key Enough?
The Ethereum messaging system has long been a topic of debate among developers and researchers. One of the most controversial topics is whether a compressed public key, known as a P2TR (Public-Key-Term Registry) address, fully corresponds to an Ethereum account balance, or whether it simply provides a more compact way to store it.
In this article, we will explore the concept of P2TR addresses and how they relate to compressed public keys. To understand the implications, let’s first understand what each component means:
- Public key: A unique string of characters used for cryptographic purposes such as authentication and encryption.
- Compressed public key (P2PR)
: A shortened version of a public key that reduces its size by removing certain characters, making it more suitable for storage in memory. The typical length is 32 bytes, but this can vary depending on the specific implementation.
- Public Key Term Register (P2TR) address: An Ethereum address consisting of a compressed public key that serves as both a unique identifier and a reference to the account balance.
Why do P2TR addresses exist?
Andreas Antonopoulos introduced the use of compressed public keys in 2015 to provide users with a more efficient way to store and manage Ethereum accounts. By compressing the public key, developers can reduce memory usage and make it easier to store large amounts of data.
P2TR addresses are designed to work with this compression scheme. When a user creates an account or sends funds, they receive a unique P2TR address that reflects both the public key and the balance. The compressed public key is stored with the account information, so users can retrieve it in subsequent account balance queries.
Are P2PR addresses enough?
Now let’s consider whether a packed public key (P2PR) address can fully represent an Ethereum account balance, or is it simply a compact storage solution. The answer lies in understanding that P2TR addresses are not just data storage targets; they provide a unique identifier and balance indicator.
A P2PR address is typically created by compressing a user’s public key using a cryptographic hash function, followed by additional operations to create a compressed signature (P2PS). This process not only creates the address, but also includes information about the account balance, such as the sender’s identity, transaction history, etc.
The compressed P2PR address itself is often only 32 bytes long, which, while it may seem “short” compared to other public key formats such as XPR (which can be up to 64 bytes), is valuable information that allows for efficient account balance queries. However, this compression does not reduce the total storage space to zero.
In fact, a P2TR address contains a compressed public key and additional metadata that identifies the sender, recipient, transaction history, etc. This metadata can be stored in a database or even transferred over the network if necessary.
Conclusion
While it is true that using compressed public keys can reduce storage requirements and potentially improve performance, P2PR addresses are not just “compressed public key” solutions. They offer a unique combination of encryption, compression, and metadata that allows users to efficiently manage Ethereum accounts and retrieve account balances.
In summary, the answer is no, an Ethereum address, like a P2TR address, is not just a compressed public key without any associated metadata. It is a compact storage solution and provides valuable information about account balance, identity, and transactions.