boltlabs-inc / zeekoe

Zero-knowledge layer-2 payment channels
MIT License
24 stars 1 forks source link

Update protocol to wait for merchant to announce when it has funded the channel #303

Closed marsella closed 3 years ago

marsella commented 3 years ago

Right now, the CustomerVerifyMerchantFunding part of the Establish protocol assumes that when the customer verifies funding, they will wait some specified amount of time before giving up on the funding existing. However, the Tezos API is currently implemented to check the funding at a specific point in time and immediately fail if it does not exist.

The protocol should account for this behavior by having the merchant tell the customer when they have finished funding the channel. Then the customer can check whether the funding exists. This is how the other side MerchantVerifyCustomerFunding works.

pub type CustomerVerifyMerchantFunding {
    recv ContractFunded;
    ChooseAbort<Activate, Error>;
}

This is a bug, but it hasn't been triggered yet because (at time of posting issue) we do not allow merchant-funded channels.