Bitcoin: Difference between revisions

From Leo's Notes
This page was last edited on 23 September 2015, at 06:18.
removed old miner information
hashes and addresses
Line 9: Line 9:


For detailed information, read the Bitcoin paper or one of the many sites out there.
For detailed information, read the Bitcoin paper or one of the many sites out there.
== Hashes & Encoding ==
=== Hash160 (Transactions) ===
Transaction numbers are represented using Hash160 of the public key. That is:
TransactionID = Hash160 = RIPEMD160(SHA256(PubKey))
It is outputted as a 160-bit value in hex (64 characters long). For example:
49123c475ef78814414f1318eff0a349bcbafd182d8b3e110684152ee0e44081
=== Hash ===
Hashes in Bitcoin are done using two rounds of SHA256.
Hash = SHA256(SHA256(X))
=== Base58Check ===
Base58Check is used to generate Bitcoin addresses.


== Address / Keys ==
== Address / Keys ==
An address consists of a public / private key pair.  
A Bitcoin address is a 160-bit hash of theh ECDSA public/private keypair.
 
=== Generating An Address ===
# Take a 160-bit value as the private key.
# Generate a public key with it
# Hash = SHA256(PublicKey)
# Hash160 = RIPEMD160(Hash)
# BaseAddress = 0 + RIPEMD160(Hash160)
# Check = SHA256(SHA256(BaseAddress))
# FinalAddress = BaseAddress + (first 8 bytes of Check)
# Address = Base58Check(FinalAddress)
 
See Also: https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses


=== Brain Wallets ===
=== Brain Wallets ===

Revision as of 06:18, 23 September 2015

Bitcoin is a proof of work cryptocurrency.

This article covers some specific aspects of the Bitcoin protocol.

My Bitcoin Address is: 1HDp1gU3rgrRNKqrKorz8uWCpHUNdyGqXm

Overview

Bitcoin is a decentralized protocol that operates in an untrusted peer to peer environment while still being a reliable method to exchange credits (bitcoins) between people.

For detailed information, read the Bitcoin paper or one of the many sites out there.

Hashes & Encoding

Hash160 (Transactions)

Transaction numbers are represented using Hash160 of the public key. That is:

TransactionID = Hash160 = RIPEMD160(SHA256(PubKey))

It is outputted as a 160-bit value in hex (64 characters long). For example:

49123c475ef78814414f1318eff0a349bcbafd182d8b3e110684152ee0e44081

Hash

Hashes in Bitcoin are done using two rounds of SHA256.

Hash = SHA256(SHA256(X))

Base58Check

Base58Check is used to generate Bitcoin addresses.

Address / Keys

A Bitcoin address is a 160-bit hash of theh ECDSA public/private keypair.

Generating An Address

  1. Take a 160-bit value as the private key.
  2. Generate a public key with it
  3. Hash = SHA256(PublicKey)
  4. Hash160 = RIPEMD160(Hash)
  5. BaseAddress = 0 + RIPEMD160(Hash160)
  6. Check = SHA256(SHA256(BaseAddress))
  7. FinalAddress = BaseAddress + (first 8 bytes of Check)
  8. Address = Base58Check(FinalAddress)

See Also: https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses

Brain Wallets

A brain wallet allows for the generation of the public/private key pair using a passphrase. It is accomplished by:

  1. Converting a pass phrase into a private key
    • PrivateKey = SHA256(PassPhrase)
  2. Generate a public key using the private key
    • PublicKey = privateToPublic(PrivateKey)
  3. Generate the bitcoin address
    • Hash = SHA256(PublicKey)
    • Hash160 = RIPEMD160(Hash) (used by transactions)
    • Address = Base58Check(Hash160)

The publickey can either be uncompressed or compressed. A compressed public key is simply a truncated key where the missing parts can be recomputed.