BlockPo / BlockPo-to-Tradelayer

Incubation Repo for the TradeLayer protocol, 0.2.0
http://www.tradelayer.org
Other
8 stars 8 forks source link

Transfer then Withdrawal Logic #427

Closed patrickdugan closed 3 years ago

patrickdugan commented 3 years ago

If Address A Commits to Channel X and then Channel X Transfers to Channel Y, then Address A should still have a claim on the Commit Reserve that was in Address B and transferred to C, via a withdrawal from Address A to C.

Another way to put this in terms of the data structures: The Transfer Tx needs to reflect which Commit Reserve is moving, either from funding Address A or the second, funding Address B. To make sure that a Transfer Tx is build correctly, a wallet app can check the Channel Info and assure that Address A is assigned the role of Address A, there is a possibility that the fuzziness around mempool timestamps could lead to ambiguity in which is A or B if both Commits are confirmed in the same block. So before building a Transfer the Channel_Info needs to be checked, then the tx is signed and cached or published. The new Channel, Channel Y, has as its Address A whichever funded it first, let's say it was another Transfer from Channel Z, or it could have been a Commit from any address. The Transfer from Channel X to Y is second and thus gets the position of Address B on Channel Y. But the single-sig address that originally funded Channel X, which we referred to as Address A, is the address fixed in position as funding Channel Y, and not the address of Channel X.