Understanding Ethereum P2TR Addresses: Is a Compressed Public Key Enough?
The Ethereum public key system has long been a subject of debate among developers and researchers. One of the most contentious topics is whether a compressed public key, known as a P2TR (Public-Key-Term Registry) address, fully represents the balance of an Ethereum account, or simply offers a more compact way to store it.
In this article, we will delve into 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 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 Registry (P2TR) address: An Ethereum address created from a compressed public key, which is both a unique identifier and an indicator of the account balance.
Why do P2TR addresses exist?
The use of compressed public keys was introduced in 2015 by Andreas Antonopoulos to provide users with a more efficient way to store and manage their 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 their public key and balance. The compressed public key is stored with the account information, so users can retrieve it when they later query their account balance.
Are P2PR addresses enough?
Now let’s examine whether a compressed public key (P2PR) address can fully represent an Ethereum account balance, or simply offer a compact storage solution. The answer lies in understanding that P2TR addresses do more than just store data; they provide a unique identifier and balance indicator.
A P2PR address is typically created by hashing a user’s public key with a cryptographic hash function, followed by additional operations to generate 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), contains valuable information that allows for efficient account queries. balance. However, this compression does not reduce the total storage footprint to zero.
In fact, a P2TR address effectively includes 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 transmitted 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 additional metadata that allows users to efficiently manage their Ethereum accounts and retrieve account balances.
In summary, the answer is no, an Ethereum address such as a P2TR address is not simply a compressed public key without the accompanying metadata. It is a compact storage solution and provides valuable information about account balance, identity, and transactions.