PIP-4: Indexing Public Keys
Authors | Kayhan Alizadeh [me@kehiy.net] |
---|---|
Discussion | View Discussion PIP-4 |
Category | Core |
Created | 2023-08-27 |
Table of Contents
Abstract
This document proposes the removal of the PublicKey from transactions if it is already known.
Motivation
Removing known public keys from transactions could reduce the size of the blockchain.
Specification
To be able to reconstruct a transaction from the raw data, a new field named Flags
will be added to the transaction.
The Flags
field is one byte, and if the first bit of the Flags
is set to 1
,
it indicates that the public key is known and excluded from the transaction.
Once a transaction is committed for the first time, its public key can be indexed by the associated address. If the same signer broadcasts another transaction, the public key can be safely removed from the transaction as it is already known and indexed by the signer’s address.
Transaction ID
The Flags
field will be excluded from the hash data, and the hash computes only from the Header and Payload data.
Security Considerations
The proposed change has security implications that need to be considered.
An adversary can change the value of the Flags
in two ways:
-
If the public key is not indexed or unknown yet, they can change the first bit of the
Flags
to1
. In this case, an honest node receiving this transaction cannot validate the transaction because it doesn’t have the public key, and the transaction will be invalid. -
If the public key is indexed or known before, they can change the first bit of the
Flags
to0
. Because theFlags
is set to0
, it means the public key is included in the transaction. In this case, the public key is redundant data.
Copyright
Copyright and related rights waived via CC0.