Public-key (or asymmetric) cryptography, which is crucial for safe transactions and communications in decentralized systems, includes a public key as a basic element in blockchain.
What is a Blockchain Public Key?

- A private key is used to generate a public key, which is a cryptographic code. Like a bank account number or email address, it is intended to be publicly shared.
- There are a lot of letters and digits in it. Whereas the Blockchain Public Key for Ethereum is 64 bytes (128 characters in hexadecimal format), the public key for Bitcoin can be either uncompressed (65 bytes) or crushed (33 bytes).
Relationship with Private Keys
Public keys and private keys are always found in a distinct pair. Together, they create this pair through asymmetric cryptography.
- One uses the private key for decryption and the public key for encryption.
- It is necessary to keep the private key confidential, but the public key can be freely disseminated.
- The fact that figuring out the private key from the Blockchain Public Key is computationally hard or virtually impossible is a critical security feature. Security depends on this one-way derivation.
- If you lose your private key, you will no longer be able to access your blockchain funds. Nonetheless, the private key can be used to reconstruct the Blockchain Public Key in the event that it is lost.
How Blockchain Public Keys are Created
A Blockchain Public Key and a private key are uniquely generated for each bitcoin user upon receiving a transaction.
- Usually, a random generator generates the private key.
- Once this private key is known, a one-way hashing algorithm, like an elliptical curve function, is used to determine the public key.
- Keccak-256 (SHA3) for Ethereum and the Elliptic Curve Digital Signature Algorithm (ECDSA) for Bitcoin are two specific algorithms utilized for this.
How Public Keys are Used in Blockchain
On a blockchain, Blockchain Public Keys are necessary for several secure operations:
Receiving Funds/Assets: A user’s account is identified to the world by their public keys or the public addresses that are generated from them. Your Blockchain Public Key, also known as your public address, is used by others to safely give you cryptocurrency.
Digital Signatures and Verification:
- Public keys are used to confirm that transactions are legitimate.
- If a user’s private key is used to sign a transaction, anyone having the matching public key can decrypt the signature to confirm its integrity and authenticity.
- This procedure verifies the private key’s ownership without disclosing any of its specifics. The sender cannot retract the message because it offers non-repudiation.
Address Derivation: Public addresses, also known as wallet addresses, are created using public keys and are used to transmit cryptocurrency.
- The public address is formed by compressing and shortening a lengthy string of letters and numbers known as a public key.
- Despite their frequent confusion, a public key and a public address are not the same thing. On blockchains, the public key’s main job is to create a public address, which is what is broadcast to the network. For instance, the public key is hashed using SHA256 and RIPEMD160 by Bitcoin, which then incorporates the hash into the Bitcoin address. Ethereum prefixes the public address with ‘0x’ and utilises the final 20 bytes of the public key.
Encryption: By encrypting communications or transactions meant for the owner of the matching private key, public keys can guarantee that only the intended recipient can access the data.
Decentralized Identity: In decentralized systems, public-key cryptography serves as the basis for managing participants’ digital identities, taking the place of conventional username/password authentication.
Key Properties and Considerations
Public Verifiability: Anyone can use public keys to confirm that transactions and the state of the system are correct.
Pseudo-anonymity: Users can create several public-private key pairs and addresses on permissionless blockchain networks, providing a certain level of pseudo-anonymity. For every transaction, users can create a new key pair to increase privacy.
Security Reliance: Cryptocurrency and decentralized assets are only secure if their owners protect their private keys, even when public keys are open.
Efficiency vs. Speed: In general, symmetric key cryptography is faster and requires fewer resources than asymmetric key encryption, which uses public keys. Data is frequently encrypted using symmetric keys, which are subsequently encrypted using asymmetric-key cryptography, in order to counteract this.
Risks: Public key encryption is more secure than symmetric encryption for key distribution and authentication, but it has drawbacks, including poor key algorithms, mishandled keys, private key loss, and vulnerability to Man-in-the-Middle (MitM) attacks in the event that security certificates or public keys are compromised. By employing robust algorithms, suitable key lengths, regular key rotation, and digital certificate verification, these might be lessened.