Skip to content

Remove is_buy flag from the protocolΒ #21

@cjdelisle

Description

@cjdelisle

Since buy of BTC/LTC is precisely the same as a sell of LTC/BTC, the protocol allows for two ways to express the same intent, which gives rise to potential bugs in implementation.

If the is_buy flag were removed and every operation were considered a buy, then there would be no way for implementations to not match BTC/LTC buys with LTC/BTC buys, which should obviously be matched.

The down-side of this is that in order to compute whether two orders match, you need to perform floating point division which might round incorrectly and cause you to try to make an invalid deal. But implementations should verify before performing a take that what they're requesting is what is being offered, which they already have the capability to do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    hardeningAll things to reduce edge cases and make the protocol less error pronehelp wantedExtra attention is neededquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions