rskip | title | description | status | purpose | author | layer | complexity | created |
---|---|---|---|---|---|---|---|---|
212 |
HW-compatible Transaction Versioning System |
Draft |
Sca |
SDL (@sergiodemianlerner) |
Core |
1 |
2021-01 |
RSKIP | 212 |
---|---|
Title | HW-compatible Transaction Versioning System |
Created | JAN-2021 |
Author | SDL |
Purpose | Sca |
Layer | Core |
Complexity | 1 |
Status | Draft |
This RSKIP proposes the addition of a version field to transactions maintaining high compatibility with existent hardware wallets, and requiring minimum changes from software wallets.
Many features, like ephemeral calldata, multi-signed transactions and LTCP transaction compression require adding more information to transactions. However currently RSK transactions do not have a way to indicate a new transaction format is being used. We propose a transaction format that embeds a version field in the current nonce field, keeping maximum compatibility with wallets, specially hardware wallets.
Currently the transaction contains the following fields, stored using RLP:
- nonce
- gasPrice
- gasLimit
- ReceiveAddress
- value
- data
- v
- r
- s
When serialized, each field begins with an RLP identifier that indicates if the item is an element or a list of elements. This format will be called version 0.
For version 1, the constant (1<<32) is added to the nonce, and the field is renamed nonceAndVersion, to avoid confusion. As most transactions have nonces below 256, the change implies adding 3 zero bytes of padding to the serialized format, which results in approximately a 3% overhead.
The encoded nonceAndVersion must be masked with (1<<32)-1 for the extraction of the nonce value.
The only version value accepted is 1. Following RSKIPs can define additional versions.
This change was selected because it doesn't break compatibility of most hardware wallets. Another (cleaner) method would be adding a version field to the transaction RLP list, which doesn't bring any overhead, but requires parsing the whole RLP encoded transaction before the version can be detected.
This change is a hard-fork and therefore all full nodes must be updated.
TBD
TBD
Copyright and related rights waived via CC0.