Ethereum: Why don’t P2PK scripts have their own addresses?
In the world of cryptocurrency and blockchain technology, addresses play a crucial role in assigning tokens to specific wallets and locking scripts. In this article, we’ll look at why Ethereum’s public key (P2PK) script doesn’t have its own address.
What is a ScriptPubKey?
Before we dive into the reasons why P2PK scripts don’t have their own addresses, let’s quickly take a look at what a ScriptPubKey is. A ScriptPubKey is a digital signature that represents a user’s public key and allows them to interact with smart contracts on the Ethereum blockchain.
Why can’t P2PK scripts have their own addresses?

If P2PK scripts didn’t have their own addresses, it would be more convenient for users to manage multiple accounts, each with its own wallet. However, this approach has several drawbacks:
- Scalability: The separate addresses for P2PK scripts mean that each user will need a unique wallet for each transaction, which can lead to scalability issues.
- Security: With multiple addresses, it is more difficult to manage and secure multiple wallets, as there is a higher risk of someone hacking one wallet to access the others.
- User Experience: The separate addresses for P2PK scripts mean that users have to remember multiple wallets, which can be inconvenient and time-consuming.
Leaders and ScriptDecodes
To understand why P2PK scripts do not have their own addresses, let’s look at how leading characters map to script decodes. In Ethereum, the leading character in the address determines which script it points to.
Here are some examples:
0x: Points to the default public key (1)
0x...: Points to the given P2PK script
0x...: Points to the given ScriptPubKey
To decode a leading character, you need to know what it points to. This is where wallet logic comes in.
Wallet Logic and ScriptDecodes
In Ethereum wallets, the ScriptDecoded function takes an address as input and returns the corresponding P2PK script or ScriptPubKey. It does this by parsing the first characters of the address.
Here is an example:
function getScript(address: string) public view return (byte memory) {
// Get the main characters
bytes32 leading characters = keccak256(address);
// Decode leading characters into scriptdecode
byte memory scriptDecode = abi.encodePacked(leadingChars);
return scriptDecode;
}
In this example, the “getScript” function takes an address as input and returns the corresponding P2PK script or ScriptPubKey.
Conclusion
While separate addresses for P2PK scripts may seem convenient, it is actually a complex problem and several factors contribute to the design. Understanding how leading characters map to scriptdecode in Ethereum wallets can help us understand the complexity of managing multiple accounts and transactions on the blockchain.