Skip to content

Better implementation for Payref #7571

@stringhandler

Description

@stringhandler

The current payref implementation is useful, but suffers from the following:

  1. It is only known after 5 blocks
  2. It is not resistant to reorgs more than 5 blocks.

Although we'd like to believe that reorgs of more than 5 blocks are not possible, we've seen from selfish mining attacks on Monero, that they are a possibility.

For example, if the payref is stored after 5 blocks, then a reorg happens. There is no way to find the output referenced by the payref.

This proposal aims to solve these, as well as allow for a use case where a reorg'ed payref can be used to find the new payref.

I suggest we make two new fields:

name calculated from notes
provisional_payref output_hash The plain has of the output. Note that each output has a payref. This is not different from the current implementation
mined_payref output_hash.block_hash Note that this is concatenated, not hashed together as the current implementation is

The downside of mined_payref is that it longer, but it allows a node to find the output by it's hash in the case it has been reorged out.

It should be noted that the provisional_payref is sufficient in all honest cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions