Tuesday 25 September 2018

UTXO: Unspent Transaction Output

UTXO is geek-speak for “unspent transaction output.” Unspent transaction outputs are important because fully validating nodes use them to figure out whether or not transactions are valid– all inputs to a transaction must be in the UTXO database for it to be valid.

From <https://www.google.com/search?q=UTXO&oq=UTXO+&aqs=chrome..69i57j0l5.3565j0j7&sourceid=chrome&ie=UTF-8>


UTXO
  1. Unique identifier of the transaction
  2. Position of this UTXO in transaction output list
  3. Value or Amount
  4. Optional script

Transaction contains
  1. Reference number of current transaction
  2. Reference to one or more input UTXO
  3. Reference to one or more output UTXO newly generated
  4. Total input amount and output amount

Transaction hashes contain
  1. Hash of the current block
  2. Hash of previous block
  3. Hash of next block
  4. Merkle root hash of the block



Double spending problem
The risk that a digital currency can be spent twice. Double-spending is a potential problem unique to digital currencies because digital information can be reproduced relatively easily.


Bitcoin solution
We propose a solution to the double-spending problem using a peer-to-peer network. The network timestamps transactions by hashing them into an ongoing chain of hash-based proof-of-work, forming a record that cannot be changed without redoing the proof-of-work.


The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power

As long as a majority of CPU power is controlled by nodes that are not cooperating to attack the network, they'll generate the longest chain and outpace attackers.

the chain stitches that data into encrypted blocks that can never be modified and scatters the pieces across a worldwide network of distributed computers or "nodes.

From <https://www.pcmag.com/article/351486/blockchain-the-invisible-technology-thats-changing-the-wor>


Basic operations: what Miners do?

  1. Validation of Transactions
  2. Gathering transactions for a block
  3. Broadcasting valid transactions and blocks
  4. Consensus of next block creation / acceptance
  5. Chaining blocks


Transaction 0 Index  0 of the confirmed block
  1. Created by the miner of the block
  2. Does not have input UTXO
  3. Only has output UTXO (special UTXO)
  4. It generates Coinbase transaction (miner's fee)
  5. Miner fee - 12.5 BTC

A standard transaction output can be unlocked with the private key associated with the receiving address. Addresses and their associated public/private key pairs will be covered later in the series. For now, we are concerned with the output amount only.

From <https://www.ccn.com/bitcoin-transaction-really-works/>

Sunday 9 September 2018

Blockchain basics

→ Blockchain is a decentralized, incorruptible digital ledger that can record transactions (like, but not limited to, financial transactions) directly among peers without having involvement of a third party or centralized system. 

As an analogy, it can be thought of as a distributed database that maintains a shared list of records. These records are called blocks. Each encrypted block holds the history of blocks that came before it, with timestamped transaction data which chain the blocks together and hence termed as blockchain.

The blockchain is also called public ledger because it is openly available for everyone to read.

Its main characteristics are:

  1. Decentralized peer to peer network
  2. Establishing trust among unknown peers
  3. Recording the transaction in immutable, distributed ledger
How is trust achieved?
  1. Validate, Verify and confirm transactions
  2. Record the transactions in a distributed ledger of blocks
  3. Create a tamper-proof chain of blocks
  4. Implement a consensus protocol for agreement on the block to be added in the chain


Distributed Ledger

In its simplest form, a distributed ledger is a database held and updated independently by each participant (or node) in a large network. The distribution is unique: records are not communicated to various nodes by a central authority but are instead independently constructed and held by every node. That is, every single node on the network processes every transaction, coming to its own conclusions and then voting on those conclusions to make certain the majority agree with the conclusions.
Once there is this consensus, the distributed ledger has been updated, and all nodes maintain their own identical copy of the ledger. This architecture allows for a new dexterity as a system of record that goes beyond being a simple database.


From <https://www.coindesk.com/information/what-is-a-distributed-ledger/