Alert Source Print Discuss
🔰 Final Standards Track: Core

PIP-3: Removing sequence field from transactions


Authors Mostafa Sedaghat Joo (@b00f)
Discussion View Discussion PIP-3
Created 2023-08-23

Abstract

This document proposes to remove the Sequence field from the transactions.

Motivation

The Sequence in Pactus is similar to the nonce in Ethereum. It stops replay attacks by increasing the sequence number in the sender’s account when a transaction is confirmed. If the same transaction is replayed, it can be detected and rejected. However, the sequence field makes it hard to implement the scheduled transactions.

This document proposes to remove the sequence field from transactions without compromising security.

Specification

To detect a replayed transaction, we can check if it has already been confirmed. This involves looking up confirmed transactions and checking for any with the same ID or hash. If a matching transaction is found, it means the transaction is replayed and should be rejected.

Light client implementation

A light client does not need to store all transaction IDs to verify new transactions. Since Pactus transactions have a limited lifespan1, the light client can avoid keeping all transaction records. For instance, with the current consensus parameters, storing the transactions for a single day is sufficient to detect replay attacks.

References


Copyright

Copyright and related rights waived via CC0.