Basic classes for pruned version of transaction output list support
authoralexhz <balthazar@yandex.ru>
Wed, 15 Jan 2014 13:28:24 +0000 (13:28 +0000)
committeralexhz <balthazar@yandex.ru>
Wed, 15 Jan 2014 13:28:24 +0000 (13:28 +0000)
commitda3091720a7bec81d6b903a608c3d247b67822e4
tree6ded46e202501373e75cf26a1887d43c97731520
parentb8b636c64f4b611daf4dd9b6cfaf6d6102ac7121
Basic classes for pruned version of transaction output list support

== CCoins: pruned list of transaction outputs ==

The CCoins class represents a pruned set of transaction outputs from
a given transaction. It only retains information about its height in
the block chain, whether it was a coinbase transaction, and its
unspent outputs (script + amount).

It has a custom serializer that has very low redundancy.

== Compact serialization for scripts ==

Special serializers for script which detect common cases and encode
them much more efficiently. 3 special cases are defined:
* Pay to pubkey hash (encoded as 21 bytes)
* Pay to script hash (encoded as 21 bytes)
* Pay to pubkey starting with 0x02, 0x03 or 0x04 (encoded as 33 bytes)

Other scripts up to 121 bytes require 1 byte + script length. Above
that, scripts up to 16505 bytes require 2 bytes + script length.

== Compact serialization for amounts ==

Special serializer/deserializer for amount values. It is optimized for
values which have few non-zero digits in decimal representation. Most
amounts currently in the txout set take only 1 or 2 bytes to
represent.
src/key.cpp
src/key.h
src/main.cpp
src/main.h
src/script.cpp
src/script.h