BlockPo / BlockPo-to-Tradelayer

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

WithdrawalFromChannel tx #78

Closed patrickdugan closed 5 years ago

patrickdugan commented 5 years ago

Asks that previously committed property be released from its reserve state and returned to being available balance on the address from which the transaction is broadcast.

Parameters: property id, amount, vOut of reference multisig channel.

Protocol checks that the reference address was the reference address of a previous Commit tx, that the quantities involved are enough, and then looks for any PNL or trade transactions that have been confirmed on-chain. If there exist transactions, the functions used to estimate UPNL in cross margin and any RPNL are added up to consider the maximum the user can withdraw.

The tx must confirm for 7 blocks where no new valid transactions from the channel address are confirmed, in order to release funds. This both gives the channel counterparty a lot of time to react with any signed but unpublished transactions that would invalidate the requested sum, and also puts manipulation of this mechanism out of the reach of most re-org attacks.

patrickdugan commented 5 years ago

Withdraw Tx

santos177 commented 5 years ago

Completed with PR #90.