Field "version" of a transaction in MultiversX

103 Views Asked by At

When you see the fields used in a transaction in the MultiversX blockchain, there is one called "version" and it's usually set to "1":

POST https://gateway.multiversx.com/transaction/send HTTP/1.1
Content-Type: application/json
{
    "version": 1,
    "chainId": "v1.0.141",
    "nonce": 42,
    "value": "100000000000000000",
    "receiver": "erd1...",
    "sender": "erd1...",
    "gasPrice": 1000000000,
    "gasLimit": 70000,
    "data": "food for cats",
    "signature": "..."
}

What's its meaning?

1

There are 1 best solutions below

0
On

The version field is used by the protocol to know how to process the given transaction. In theory, the protocol can process transactions in different ways if need be.

At the moment of writing this, there are 2 versions the transactions can be processed in, the difference between them impacting the mechanisms that derive and check the tx signature.

Basically, this is a way to easily add new mechanisms if future requires different things and you still want to maintain backwards compatibility.