In order to buy or sell items with Bitcoin, you need to have a possibility to send and receive your funds from a specific location, kind of like sending and receiving mail through a mailbox. Sound’s complicated? Don’t worry, it is similar to sending an email.
Imagine, if you want to send Bitcoins to your friend, you would send your bitcoins from your Bitcoin address to your friend’s Bitcoin address. So, if you want to send and receive Bitcoins, you must have a specific combination of letters and numbers. It’s called a Bitcoin address.
The question is: have you ever wondered what all those combined letters and numbers mean?
Let’s take as an example a random Bitcoin address:
As you can notice it is a mix of numbers and letters beginning with the digit “1”. This is the string which users send to each other in order to send and receive Bitcoin. A Bitcoin address can represent a person or something else, like a payment script (P2SH). The Bitcoin address can also be represented with a QR Code in order to make it easier for users to copy paste the value. In case you’re wondering how this random string is generated, keep reading – you will find some interesting answers.
How the public or private key asymmetric cryptographic method works?
Public key cryptography is a mathematical foundation for computer and information security. It’s a pair of keys, a private and a public one. The private key is picked randomly and the public key is derived from the private. In Bitcoin, the public key is used to receive funds and the private key is used to sign transactions.
What about the Private key? The private key in Bitcoin is a random number picked between 1 and 2256. How the number is found in that range is up to the software developer. The only thing we have to take into consideration is that the source of randomness must have enough entropy for being unrepeatable and unpredictable.
How does this work for Bitcoin?
A Bitcoin user can make a transaction to another user in any amount of Bitcoin and “sign” this transaction with their own private key and give his or her public key as well. Now, this signature can be validated against the public key by anyone on the network without revealing the private key in order to check if the sender has the “right to spend” this amount of Bitcoin at that moment of time.
To sum up, what was mentioned, someone with the private key can sign a transaction uniquely and anyone with the public key can verify that the signature comes from someone that is the owner of the private key. Interesting fact: for both security and privacy reasons the signatures for a transaction are different every time but created from the same private key.
The relationship between the private and public key is based on a “one-way” mathematical function that is irreversible. This means that given an input you come up with an output and you cannot find the original input with the current output. Bitcoin uses the elliptic curves multiplication as the basis of its cryptography for generating secure public keys.