Skip to content
gronager edited this page Jan 24, 2012 · 2 revisions

What is a coin ? None of the classes in the satoshi bitcoin client carries the name Coin. However, one of the classes have all the characteristics of a coin, namely the COutPoint class.

The COutPoint class is defined by a hash and an index to a transaction, and you can, by looking up the transaction in the BlockChain determine its value. If you happen to be the owner of that coin, it also defines the quantum of bitcoins you can pay with. If you want to pay less, you will get a new coin in return.

In libCoin COutPoint has been relabeled to Coin as this is the atomic units when we count our assets and the unit we use in transactions. A Coin hence consists of a (transaction) hash and an index (formerly just n).

The CInPoint class is a Coin Reference, instead of a hash and an index it stores a Transaction pointer and an index. It is hence an internal entity. In libCoin it is labeled CoinRef.

The CTxIn and CTxOut has been relabeled to TxInput and TxOutput and the CTransaction class to Transaction. Further, they have been properly encapsulated.