Standard.md 2.58 KB
Newer Older
David Vorick's avatar
David Vorick committed
1 2 3
Standard Transaction Rules
==========================

4 5 6 7
Some transactions will not be accepted by miners unless they appear in a block.
This is equivalent to the 'IsStandard' function in Bitcoin. This file dictates
the rules for standard Sia transactions.

David Vorick's avatar
David Vorick committed
8 9
Transaction Size
----------------
10 11

Consensus rules limit the size of a block, but not the size of a transaction.
12
Standard rules however limit the size of a single transaction to 32kb.
13

14
A chain of dependent transactions cannot exceed 250kb.
David Vorick's avatar
David Vorick committed
15

David Vorick's avatar
David Vorick committed
16 17
Double Spend Rules
------------------
18 19 20 21 22

When two conflicting transactions are seen, the first transaction is the only
one that is kept. If the blockchain reorganizes, the transaction that is kept
is the transaction that was most recently in the blockchain. This is to
discourage double spending, and enforce that the first transaction seen is the
23 24
one that should be kept by the network. Other conflicts are thrown out.

25 26 27 28 29 30
Transactions are currently included into blocks using a first-come first-serve
algorithm. Eventually, transactions will be rejected if the fee does not meet a
certain minimum. For the near future, there are no plans to prioritize
transactions with substantially higher fees. Other mining software may take
alternative approaches.

31 32
File Contract Rules
-------------------
33

34 35 36 37 38 39
File Contracts that start in less than 10 blocks time are not accepted into the
transaction pool. This is because a file contract becomes invalid if it is not
accepted into the blockchain by the start block, and this might result in a
cascade of invalidated unconfirmed transactions, which may make it easier to
launch double spend attacks on zero confirmation outputs. 10 blocks is plenty
of time on the other hand for a file contract to make it into the blockchain.
40

David Vorick's avatar
David Vorick committed
41 42
Signature Algorithms
--------------------
43

David Vorick's avatar
David Vorick committed
44 45
Miners will reject transactions that have public keys using algorithms that the
miner does not understand.
46

David Vorick's avatar
David Vorick committed
47 48
Arbitrary Data Usage
--------------------
49 50 51 52 53 54 55 56 57 58 59 60 61

Arbitrary data can be used to make verifiable announcements, or to have other
protocols sit on top of Sia. The arbitrary data can also be used for soft
forks, and for protocol relevant information. Any arbitrary data is allowed by
consensus, but only certain arbitrary data is considered standard.

Arbitrary data that is prefixed by the string 'NonSia' is always allowed. This
indicates that the remaining data has no relevance to Sia protocol rules, and
never will.

Arbitrary data that is prefixed by the string 'HostAnnouncement' is allowed,
but only if the data within accurately decodes to the HostAnnouncement struct
found in modules/hostdb.go, and contains no extra information.