RGB-WG / rgb-core

RGB Core Library: consensus validation for private & scalable client-validated smart contracts on Bitcoin & Lightning
https://spec.rgb.tech
Apache License 2.0
207 stars 52 forks source link

Refactor types for ordering global state in contract history data #169

Closed dr-orlovsky closed 1 year ago

dr-orlovsky commented 1 year ago

This is the most minimalistic solution to the problem at the consensus level.

The way it will work is the following: we now guarantee that all 0-heights are considered as the latest updates to the state.

During the validation, all mempool-based global state is ignored (it is not accessible to the VM the same way "mined" global state is; instead VM uses special procedure to access the global state from the currently validated terminal state transition).

For the lightning channel updates (or in any state channels), we do not send or validate consignments - instead, each party constructs state transitions and keeps it OUTSIDE of RGB stash (in LNP node) - alongside history of signatures for bitcoin tx. Thus, these state transitions are never validated with a consensus code/RGB Core.

So I think we should not go further and this is sufficient solution

dr-orlovsky commented 1 year ago

Should be used alongside