You are on page 1of 12

3/12/21

Address and Address Derivation

• Blockchain Addresses are an important concept in


cryptocurrencies and blockchains.

• We will look into


– What addresses are, how they are created and what the
differences between different kind of addresses on
different blockchains
Address
What Are Addresses on Blockchains? Blockchain Address 101?

• In the early days of Bitcoin, it was possible to send


payments to an IP-address like 104.25.248.32 (which is
blockgeeks.com). This was planned to be a convenient method to use
Bitcoins without dealing with unhandy public keys and addresses.
• However, after the Bitcoin, developers realized that this way of
sending coins could be subject to serious man- in-the-middle-attacks,
the option was disabled and did never come back.
• This story of Bitcoin’s early days seems to have mostly historic
values. But it demonstrates what an address is: It is not
something special or something set in stone. It is just a
placeholder to accept and send blockchain transactions. Like an
IBAN or SWIFT address.

• The address itself doesn’t matter, nor does its format. The only
thing matters are that the address serves its purpose – to
enable payments to an entity which has a unique information.
Usually, a private key, to exclusively access the funds. The
address is nothing but a secure identifier.
• In SWIFT or IBAN, numbers are assigned by central authorities like
banks, blockchain addresses exist.
• Every blockchain address possible already existed, long before a
wallet found it.
• The reason is that blockchain addresses are the result of a
mathematical operation.

The Public Key: Where the Blockchain Address Generation


begins

• After Pay to IP had been abandoned in Bitcoin, P2PKH became the


new standard format for bitcoin addresses.

• A standard P2PKH address has something like 34 signs and starts with
a 1. P2PKH is the abbreviation of “Pay To Public Key Hash.” This means
that you Pay to a hash of a public key.
Every wallet software you use can easily create a P2PKH addres.
It is no rocket science, but a combination of several non-exceptional cryptographic
operations.

WALLET
Cryptocurrency Wallet Guide: A Step-By-Step Tutorial - Blockgeeks

• First, your wallet collects entropy and uses it to generate an ECDSA private key.

• In cryptography, the Elliptic Curve Digital Signature Algorithm (ECDSA) offers a


variant of the Digital Signature Algorithm (DSA) which uses
elliptic curve cryptography.

• ECDSA is the cryptographic algorithm in the core of bitcoin addresses. It is an


asymmetric signature algorithm, which means that you can sign messages with
the PRIVATE key and verify the signature with the PUBLIC key.

• With ECDSA you can give the world easily the information to prove that you – and
only you – are the author of a message by signing it. It’s very similar to physically
signing a letter.
• So, after creating the private key with entropy, the wallet derives the
public key from it.

• It does so by picking some random coordinates on a certain elliptic


curve and doing some calculations.

• What matters is, which this public key is all you need to send and collect
payments. In the early days, the public key was used to receive funds.

• But very soon the concept was extended. The public key is not only very
long and unhandy – around 65 characters – but can also be subject to
typing errors.

• Further, exposing it can also set you on risks if ECDSA is ever broken, for
example by quantum computing. This is why the bitcoin developers
created a method to derive an address from the public key.
Creating the Bitcoin Blockchain address

• To create the address your wallet pushes the public key through a series of
cryptographic algorithms. Roughly speaking this is what happens:

• The software hashes the public key with SHA 256 and the result with RIPEMD-160.

• Then it adds the bytes 00 as a prefix in the beginning of the resulting string – this is
the reason why P2PKH addresses start with a “1” – and four checksum-bytes at the
end.

• The four checksum bytes are generated by hashing the result twice with SHA 256
and taking the first four bytes.

• Then your wallet converts the result into a base58 string.


And voilá: we have the bitcoin address we know and we love.

• You don’t need to understand the cryptographic details. What’s important is that
the address represents a public key in a better readable way and adds a checksum
• Whenever you paste an address in your bitcoin wallet, it checks
the prefix and calculates the checksum.

• If it doesn’t match, it rejects the address. This makes it


impossible to send funds to a wrong address due to a typing
error.

• If you have the private key for an address, only you can sign a
transaction with cryptocurrency token assigned to this address
– while everybody who knows your address can verify the
validity of your signature.

• This simple process – signing a transaction, verifying the


signature – is more or less everything a cryptocurrency
transaction does.
• But bitcoin has more advanced addresses: the so-called P2SH addresses. This
abbreviation stands for “Pay to Script Hash”.
• It means that you don’t pay to the hash of a public key, but to the hash of a
script.
• To sign a transaction you don’t have to provide the signature matching a certain
public key, but a script matching a certain hash.

• This kind of addresses enable more flexible methods to verify yourself, for
example, those that are used in multisig-addresses, in which two parties
provide information which sums up to the needed script.

• These addresses use the prefix 05, which is the reason why they start with a
“3”.

• However, it needs another guide to completely describe the magic of P2SH


addresses.

• Here we focus on addresses itself and leave bitcoin to have a look, how
other cryptocurrencies create addresses.

You might also like