Skip to content

Latest commit

 

History

History
110 lines (74 loc) · 5.19 KB

L1.2 Blockchain Transaction.md

File metadata and controls

110 lines (74 loc) · 5.19 KB

L2 Blockchain Transaction

Blockchain Identity

A Bitcoin Wallet:

  • Private Key: A secret number that allows you to spend your bitcoin from your wallet. There are randomly generated number that your wallet creates. Wallet contains one or more these private keys and these should not be shared with anyone.
  • Public Key: A public key is derived from your private key and gives you a publicly shareable key that cannot be used to spend bitcoin, you can share with anyone, they can use it for send you bitcoin.
  • Wallet Address: A unique identifier for your wallet. Wallet Address is public to see for everyone, we use wallet address in the transaction details.

We can share our public key without worrying about the security of our private key. The private key has to been linked with a public key, so that the private key can track the public key.

Use ECDSA (Elliptic Curve Digital Signature Algorithm) algorithm:

We run SHA-256 and RIPEMD160, for generating Wallet address by public key, the 160 bit number is the Wallet Address:

We use BASE50CHECK algorithm to take the 0 or O, to get the shorter Base58 number Wallet Address.

The finally shareable wallet address is the one based on Base50 number.

Wallet Overview

Deterministic wallet

Hierarchical Deterministic wallet

Non-deterministic Wallet (random wallets) A wallet where private keys are generated from random numbers.

Deterministic Wallet A wallet where addresses, private keys, and public keys can be traced back to their original seed words.

Hierarchical Deterministic Wallet An advanced type of deterministic wallet that contains keys derived in a tree structure.

Wallet Types

Non-deterministic Wallet All the private keys are generated from random numbers, cannot be traced back to the original random numbers unless you backup it. All the private keys are randomly generated, that have no association with each other.

Deterministic Wallet All the private keys, and public keys can be traced back to the original seed. Nothing is random, they can be determined.

HD wallets came about in the Bitcoin Improvement Proposal 32 also known as BIP32 and that’s viewable online in the BIP32 GitHub repo. The Master Key needs strong backup.

Private Keys

A private key is just a 256-bit random number between 1 and 2^256.

Different Formats:

Def: Entropy Lack of order or predictability. It’s the degree of disorder or randomness in the system.

What’s the purpose of a Private Key Private keys generate Public Keys and Wallet Address that allow us to interact with the blockchain

What makes a Private Key secure? A Private Key is a 256-bit random number between 1 and 2^256

How to generate a Private Key?

  • Paper, pencil, coin, dice
  • OS with source of entropy or library with cryptographic secure number generator
  • Bitcoin address generating websites
  • Software wallets

Restoring Blockchain Identity

Ways to Restore a Wallet

  • Use a seed
  • Use a Private Key
    1. Import a Private Key
    2. Sweep a Private Key

Sign a Transaction

Signature Establishes proof of ownership for each transaction on the blockchain A valid transaction, the sender must sign it before sending the transaction by using his private key, with the private key, the sender can sign his transaction with his digital signature.

In Bitcoin, the transaction message is broadcasted to the chain as an unspent transaction output known as UTXO.

Each transaction input has a condition. The transaction input will need to be converted to an output which contains the condition to prove ownership using your private key.

With your private key, you can sign your transaction with your digital signature proving you own the address containing the transaction inputs.

To create a transaction output you need to have the sum of the input transactions which are equal to, or, greater than the value you are sending.