size > MAX_TRANSACTION_SIZE. The size of a transaction is calculated as the sum of the sizes of its static and dynamic parts, as determined by canonical serialization.
No inputs are of type InputType.Coin or InputType.Message with input.dataLength == 0
More than one output is of type OutputType.Change for any asset ID in the input set
Any output is of type OutputType.Change for any asset ID not in the input set
More than one input of type InputType.Coin for any Coin ID in the input set
More than one input of type InputType.Contract for any Contract ID in the input set
More than one input of type InputType.Message for any Message ID in the input set
When serializing a transaction, fields are serialized as follows (with inner structs serialized recursively):
uint8, uint16, uint32, uint64: big-endian right-aligned to 8 bytes.
byte[32]: as-is.
byte[]: as-is, with padding zeroes aligned to 8 bytes.
When deserializing a transaction, the reverse is done. If there are insufficient bytes or too many bytes, the transaction is invalid.
Given helper max_gas() returns the maximum gas that the transaction can use.
Given helper len() that returns the number of bytes of a field.
Given helper count_ones() that returns the number of ones in the binary representation of a field.
Given helper count_variants() that returns the number of variants in an enum.
Given helper sum_variants() that sums all variants of an enum.
Transaction is invalid if:
More than one output is of type OutputType.Change with identical asset_id fields.
Note: when signing a transaction, receiptsRoot is set to zero.
Note: when verifying a predicate, receiptsRoot is initialized to zero.
Note: when executing a script, receiptsRoot is initialized to zero.
The receipts root receiptsRoot is the root of the binary Merkle tree of receipts. If there are no receipts, its value is set to the root of the empty tree, i.e. 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.
Given helper max_gas() returns the maximum gas that the transaction can use.
Given helper count_ones() that returns the number of ones in the binary representation of a field.
Given helper count_variants() that returns the number of variants in an enum.
Given helper sum_variants() that sums all variants of an enum.
Transaction is invalid if:
Any input is of type InputType.Contract or InputType.Message where input.dataLength > 0
Any output is of type OutputType.Contract or OutputType.Variable or OutputType.Message
More than one output is of type OutputType.Change with asset_id of zero
Any output is of type OutputType.Change with non-zero asset_id
It does not have exactly one output of type OutputType.ContractCreated
The transaction is created by the block producer and is not signed. Since it is not usable outside of block creation or execution, all fields must be fully set upon creation without any zeroing.
This means that the transaction ID must also include the correct txPointer value, not zeroed out.