# Validation rules
# Account validation
Account is valid then it is a valid Base58 string and the length of corresponding array is 26 bytes. Version of address (1st byte) is equal to 1. The network byte (2nd byte) is equal to network ID. The checksum of address (last 4 bytes) is correct.
# Transactions validation
# Transfer transaction
Transfer transaction is valid then:
- Recipient address is valid. If not, InvalidAddress validation result will be returned.
- Size of attachment is less than or equals MaxAttachementSize(140 bytes). In other case TooBigArray validation result will be returned.
- Transaction's amount is more than 0, otherwise NegativeAmount validation result is returned.
- Transaction's fee is positive, otherwise InsufficientFee validation result is returned.
- Adding fee to amount does not lead to Long overflow. In case of Long overflow OverflowError validation result will be returned.
- Transaction's signature is valid, otherwise InvalidSignature validation result is returned.
# Issue transaction
Issue transaction is valid then:
- Sender's address is valid. If not, InvalidAddress validation result will be returned.
- Quantity of asset is positive, otherwise NegativeAmount validation result is returned.
- Transaction's fee is more than or equals MinFee(100000000 wavelets = 1 Wave), in other case InsufficientFee validation result is returned.
- Size of description is less than or equals MaxDescriptionLength(1000 bytes), otherwise TooBigArray is returned.
- Size of name is more than or equals MinAssetNameLength and less or equals MaxAssetNameLength, in other case InvalidName validation result will be returned.
- Decimals is positive and less than or equals MaxDecimals, in other case TooBigArray is returned.
- Transaction's signature is valid, otherwise InvalidSignature validation result is returned.
# Reissue transaction
Reissue transaction is valid then:
- Sender's account is valid. Otherwise InvalidAddress validation result is returned.
- Quantity is positive, in other case NegativeAmount validation result will be returned.
- Transaction's fee is positive, in other case InsufficienFee result will be returned.
- Transaction's signature is valid, otherwise InvalidSignature validation result is returned.
# Block validations
Block is valid then:
- Block chain contains referenced block.
- Block's signature is valid.
- Block's consensus data is valid.
- Block's transactions are valid.
# Consensus data validation
Block's consensus data is valid then:
- Block creation time is no more than MaxTimeDrift(15 seconds) in future.
- Block's transactions are sorted. This rule works only after 1477958400000 on Testnet and 1479168000000 on Mainnet.
- Block chain contains parent block or block chain height is equal 1.
- Block's base target is valid.
- Block's generator signature is valid.
- Generator's balance is more than or equals MinimalEffectiveBalanceForGeneration(1000000000000 wavelets). This rule always works on Testnet and works only after 1479168000000 on Mainnet.
- Block's hit is less than calculated block's target.
- Voted features are sorted in ascending order and are not repeated.
# Transactions data validation
Block's transactions are valid then:
- Creation time of every transaction in block is less than block's creation time no more than on MaxTxAndBlockDiff(2 hours).
- All transactions are valid against state.
# Transaction validation against state
Transactions are valid then:
- Transaction is valid by transaction validation rules.
- Transaction creation time more than block's creation time no more than on MaxTimeForUnconfirmed(90 minutes). This limitation works always on Testnet and only after 1479168000000 on Mainnet.
- Application of transaction to accounts should not lead to temporary negative balance. This rule works after 1479168000000 on Mainnet and after 1477958400000 on Testnet.
- Changes made by transaction should be sorted by their amount. This rule works on both Mainnet and Testnet after 1479416400000.
- Application of transaction's amount to current balance should not lead to Long overflow.
- After application of all block's transactions affected balances should not be negative.
# Unconfirmed Transactions Pool validation
Transaction could be inserted in Unconfirmed Transactions Pool then:
- Transaction is valid by transaction validation rules.
- If transaction's fee is more than or equals minimum fee that was set by the owner of a node.
- There is a space for a new transaction if Unconfirmed Transactions Pool. By default the pool is limited by 1000 transactions.
- Unconfirmed Transactions Pool does not contain transaction with the same ID.
- Transaction created not later than MaxTimeForUncofimed(90 minutes) after the last block was created.
- Transaction creation time is no more than MaxTimeDrift(15 seconds) in future.
- Transaction is valid against state.