In the blockchain ecosystem, public and private keys serve as the unique identifiers and proof of ownership for users. Conflux operates across two distinct spaces: Core Space and eSpace, with eSpace being fully compatible with Ethereum. This article explores how Conflux Core Space and Ethereum generate critical private and public keys, along with the process of deriving user addresses.
Understanding Private and Public Keys
Private Keys
In both Conflux and Ethereum, a private key is a 64-character hexadecimal string.
Role in Blockchain:
- Private keys generate public keys and sign transactions to authenticate messages.
- Cryptographic signatures cannot be forged without access to the private key.
- Every blockchain transaction requires a digital signature from the private key.
Generation Process:
- A truly random 256-bit value is generated offline (pseudo-randomness is unsafe due to predictability).
- The value is hashed using a 256-bit algorithm (e.g., Keccak-256 or SHA-256) to produce a 256-bit binary number.
- The binary output is converted to a 64-character hexadecimal private key.
👉 Learn more about secure key generation
Public Keys
Public keys are derived from private keys using the Elliptic Curve Digital Signature Algorithm (ECDSA), specifically the secp256k1 curve.
Properties:
- The process is irreversible—public keys cannot reveal the private key.
- Used to verify signatures created by the private key.
Address Generation in Conflux eSpace and Ethereum
Conflux eSpace and Ethereum share the same address generation logic due to full compatibility.
Step-by-Step Process:
Private Key Generation:
- A 64-character hexadecimal string or a wallet mnemonic phrase (see FAQ for details).
Public Key via ECDSA:
- The private key is processed through ECDSA to yield a 128-character hexadecimal public key (130 characters with
04prefix for uncompressed format).
- The private key is processed through ECDSA to yield a 128-character hexadecimal public key (130 characters with
Hashing the Public Key:
Apply Keccak-256 hashing:
value = Keccak256(pubkey)- Retain the last 20 bytes (40 hexadecimal characters) as the account address (often prefixed with
0x).
Conflux Core Address Generation
Conflux Core uses a base32-encoded format (per CIP-37) to avoid confusion with Ethereum’s hexadecimal addresses.
Hex Address Calculation:
- A 20-byte hexadecimal string is derived from the Keccak-256 hash of the public key.
A type indicator (4-bit) prefixes the address:
0x1: Externally Owned Account (EOA).0x8: Contract address.0x0: Internal Conflux address.
- Combine the type (1 character) and the last 39 characters of the hashed public key (156 bits) to form a 40-character hex string.
Base32 Conversion:
- Format:
network_prefix:payload+checksum(e.g.,cfx:base32address). Steps:
- Append a version byte to the hex address (21-byte array).
- Encode right-to-left into base32.
- Compute checksum using network prefix and payload.
👉 Explore Conflux address standards
FAQ
1. Can I use the same private key for Conflux and Ethereum?
Yes, but only in Conflux eSpace. Core Space addresses differ due to distinct encoding methods.
2. What happens if I lose my private key?
You permanently lose access to the associated assets—no recovery is possible.
3. Why does Conflux Core use base32 addresses?
To prevent user confusion and erroneous transactions between Conflux Core and Ethereum networks.
4. Is it safe to generate keys online?
No. Always use offline methods to ensure security.
Key Takeaways
- Private keys must be generated offline using cryptographically secure randomness.
- Conflux eSpace mirrors Ethereum’s address logic, while Core Space employs base32 encoding.
- Address formats include network-specific prefixes (e.g.,
cfx:) for clarity.
For further reading on elliptic curve cryptography, see ECDSA Wikipedia.