Skip to content

Watch batch output scripts instead of vtxo scripts #851

@altafan

Description

@altafan

Every time a batch is finalized, we start watching for all vtxo leaves, and we also do the same whenever an offchain tx is finalized.
The purpose is to ensure we detect unrolls, and to protect against fraud, but subscribing to the entire vtxo set is just a bit overkill.

We can instead go for an "incremental watch" approach here:

  • whenever a batch is finalized, we start watching for its output script until it shows up onchain, and we stop the watch as soon as it happens
  • if we swept, nothing left to do; otherwise, we start watching their children

By repeating these 2 steps we end up watching only the vtxos that are actually being unrolled instead of the entire trees and virtual mempool.

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