Skip to content
CryptoManiac edited this page Jan 29, 2014 · 17 revisions

A transaction is a signed section of data that is broadcast to the network and collected into blocks. It typically references previous transaction(s) and dedicates a certain number of novacoins from it to one or more new public key(s).

Currently there are a few transaction types possible.

User operation

This transactions are typically used to redeem novacoins from unspent inputs. It generally references unspent input(s) and creates a new output(s) with specified value(s) an destination(s).

Coinbase

Coinbase have a single input, and this input has a "coinbase" parameter instead of a scriptSig. The data in "coinbase" can be anything; it isn't used. Novacoin puts the current compact-format target and the arbitrary-precision "extraNonce" number there, which increments every time the Nonce field in the block header overflows. The extranonce contributes to enlarge the domain for the proof of work function.

This transactions are used to reward the proof-of-work miners. Proof-of-stake blocks have the coinbase transaction too, but with empty output.

There are three destination types allowed for user and coinbase transactions:

  • Public key (Pay-to-Pubkey);
  • Public key hash (Pay-to-PubkeyHash);
  • Script hash (Pay-to-ScriptHash).

Besides that, coinbase transactions are alowed to use the NULL destination type.

Coinstake

This transactions are used to provide a suitable proof for proof-of-stake block header. This type is similar to user transactions, but with some differences.

  • First input of this transaction is required to satisfy a current proof-of-stake difficulty.
  • It's allowed to generate new coins through paying negative fee.
  • A destination of the second output must be Pay-to-Pubkey.
General format of a transaction
Field Type sizeof Description
Version unsigned int 4 Currently 1
Timestamp unsigned int 4 Transaction timestamp
Inputs count variable int 1 - 9 -
Inputs array TxIn[] inputs set size Inputs array or coinbase property
Outputs count variable int 1 - 9 -
Outputs array TxOut[] outputs set size Array of output structures
Lock time unsigned int 4 block height or timestamp when transaction is final