boltlabs-inc / tezos-contract

Multi-sig Smart Contract for zkChannels protocol
MIT License
3 stars 1 forks source link

Fix documentation on `revocation_lock` #64

Open indomitableSwan opened 3 years ago

indomitableSwan commented 3 years ago

The documentation was not updated appropriately when revocation_lock was changed from bytes to BLS12-381 scalar. It still says it is initialized to 0x00, when instead it is passed in as an argument during origination and is no longer type bytes. (Do we enforce anything about the initialized value? Does the merchant accept any value for this now?) @jakinyele @marsella @DariusParvin

marsella commented 3 years ago

In zeekoe, we pass 0x00 which according to our documentation is parsed as the scalar 0.

The invariant I decided on is that one should only access the revocation lock when they actually need it (that is, when the contract is in cust_close status), so it doesn't matter what it is initialized to. However, this invariant is not enforced at compile time / with types in zeekoe yet (see boltlabs-inc/zeekoe#199).

I cannot speak to whether the contract enforces anything about the initialized value.

DariusParvin commented 3 years ago

The documentation is correct in that pytezos parses 0x00 as the scalar 0. The contract itself doesn't enforce anything other than the value being a valid BLS12-381 scalar.

indomitableSwan commented 3 years ago

The documentation is correct in that pytezos parses 0x00 as the scalar 0. The contract itself doesn't enforce anything other than the value being a valid BLS12-381 scalar.

but the documentation isn't correct since it isn't necessarily 0x00 and it is now an argument that is passed in instead of an initialized value. Can you please fix? @DariusParvin