Skip to content

Commit

Permalink
Specify max transaction size
Browse files Browse the repository at this point in the history
  • Loading branch information
bvrooman committed Oct 17, 2023
1 parent 822f13a commit 621a39b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tx-format/transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ Transaction is invalid if:
- More than one input of type `InputType.Coin` for any [Coin ID](../identifiers/utxo-id.md#coin-id) in the input set
- More than one input of type `InputType.Contract` for any [Contract ID](../identifiers/utxo-id.md#contract-id) in the input set
- More than one input of type `InputType.Message` for any [Message ID](../identifiers/utxo-id.md#message-id) in the input set
- The size of the transaction, in bytes, exceeds the maximum transaction size as specified in the consensus parameters. The size of a transaction is calculated as the sum of the sizes its static and dynamic parts as determined by canonical serialization.

When serializing a transaction, fields are serialized as follows (with inner structs serialized recursively):

1. `uint8`, `uint16`, `uint32`, `uint64`: big-endian right-aligned to 8 bytes.
1. `byte[32]`: as-is.
1. `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.
When deserializing a transaction, the reverse is done. If ,there are insufficient bytes or too many bytes, the transaction is invalid.

## TransactionScript

Expand Down

0 comments on commit 621a39b

Please sign in to comment.