When we compare a normal(web2) account signup to signup on blockchain(web3) one question comes to mind: how does the blockchain know this account is real or this accounts exists on the network?
I am going to talk specifically about Solana, but it may apply to the broader landscape in general
Key-Pair Creation
When we first create a key-pair in solana
solana-keygen new --outfile /tmp/broke-wallet.json --no-bip39-passphrase --force
We get,
From the image above, we can see that we get three things -
- Private Key, which is stored as a json file in the specific path
- Public key, which can be derived from the private key
- Seed Phrase, which can derive the private key.
Private Key and Public Key follow a one-to-one mapping, meaning we will always get the same public key from the private key. We cannot derive private key from our public key.
Our seed phrase can derive multiple private keys. This makes managing multiple wallets with single seed phrase possible.
Disclaimer: Never share your actual seed phrase and/or private key.
Answer
Now that we have created the key, let's go back to our original question, how does the blockchain know we exist?
The simple answer is it doesn't.
Private keys are created from random 256 bits, meaning there are 2^256 possible combinations (more than the atoms in a universe). So chances of two people having same private key is virtually zero.
The blockchain only knows about your wallet after its first incoming or outgoing transaction. In Solana, this is when the network explicitly allocates space on the ledger for our public key and deposits enough SOL to make the account "rent-exempt." Before this happens, our wallet isn't an active account on the ledger—it's just a mathematical possibility among 2^256 options.
Fun Fact
The json file which is created is a 64 byte array, where first 32 bytes are the private key and next 32 bytes are the public key.
Solana saves this in this format because whenever we sign a transaction on blockchain, we need both private key and public key and yes we can derive the public key on the spot with the help of private key, which is inefficient when our (Solana in this case) goal is to go as fast as possible while using as few compute units as possible.
Conclusion
This is the major architectural and philosophical difference between Web2 and Web3. On Web2, we(our identities) are row in centralized database. In Web3, we do not exist, till we do.

Top comments (0)