Читать книгу Cryptocurrency All-in-One For Dummies - Peter Kent, Kiana Danial - Страница 49

How a wallet works

Оглавление

Crypto wallets don’t actually store the cryptocurrency itself; rather, they store the cryptocurrency’s private and public keys. These keys are something like the PIN code you use to access your bank account.

No two wallet addresses are ever the same. They’re something like fingerprints. This distinction means that there is a very low chance that somebody else can get your funds by mistake. Also, you have no limit to the number of wallet addresses you can create.

To give you an example of what a cryptocurrency address looks like, here is the wallet address believed to belong to the creator of Bitcoin, Satoshi Nakamoto!

1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

As you can see, it uses a combination of numbers and letters, both uppercase and lowercase. Don’t worry; as long as you have a safe and secure wallet, you don’t have to memorize your crypto wallet address. You can also consider printing your keys and storing them somewhere safe that you won’t forget about.

A private key is a unique individual password to your individual crypto wallet address. A public key then adds an extra layer of security and ensures that your wallet can’t be hacked. Here is a quick example of what the keys look like:

 Private key: 03bf350d2821375158a608b51e3e898e507fe47f2d2e8c774de4a9a7edecf74eda

 Public key: 99b1ebcfc11a13df5161aba8160460fe1601d541

These addresses look completely different to the eye, but the software technology knows that the two keys are specifically linked to each other. That proves that you’re the owner of the coins and allows you to transfer funds whenever you want.

Addresses in Ethereum (see Book 4 for more about Ethereum) take up the last (rightmost) 20 bytes of the hash of the owner’s public key. To calculate an address, just calculate the Keccak-256 hash of a public key, and then copy the rightmost 20 bytes. The resulting value is the address for that account’s public key. The code to calculate an address from a public key looks like this:

addr = right(keccak256(pubkey),20)

When someone sends you any type of cryptocurrency, they are essentially signing off ownership of those cryptos to your wallet’s address. For you to be able to spend those cryptos and unlock the funds, the private key stored in your wallet must match the public address the currency is assigned to. If the public and private keys match, the balance in your wallet increases, and the sender’s balance decreases accordingly. No exchange of real coins actually occurs. The transaction is signified merely by a transaction record on the blockchain and a change in balance in your cryptocurrency wallet. Cryptocurrencies rely on blockchain technology, which you can learn about in Book 2.

Cryptocurrency All-in-One For Dummies

Подняться наверх