4

Is there a size limit on transaction metadata?

If there is a limit, is it varying or fixed size?

5

Here is an important note regarding Tx metadata:

There is no limit on the number of key-value pairs (except the overall transaction size limit) or on individual structured values. However, there is a limit on the size of text strings and byte strings within the structured values, which is implemented to mitigate the problem of unpleasant or illegal content being posted to the blockchain.


At the moment maxTxSize = 16384 bytes (including metadata).

P.S.

If we talk about the max number of characters in a 16 KB text file with UTF-8 encoding (8-bit), then this is 16384 characters, since each character weighs exactly 1 byte. This is more than enough, to describe transaction's body and add a reach metadata to it.

During Basho era the size of Tx might be increased up to 512 KB.

2
  • 1
    Clarifying: The 16384 bytes is inclusive of everything in the transaction, not just the metadata correct?
    – Frank C.
    Oct 15 at 10:20
  • 1
    Yes, exactly....
    – Andy Jazz
    Oct 15 at 10:28
1

Values change, so this is safe for the current parameters:

  $ cardano-cli query protocol-parameters --mainnet | jq .maxTxSize
  16384

But these are in flux, so you can try to be mindful of upcoming changes. Metadata is so versatile that if it didn't get larger there would probably be a way to deal with this, but it's in as much flux as many of the other pool parameters.

I don't know the best way to stay on top of these changes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.