Skip to content

Order format which enables gossip #22

@cjdelisle

Description

@cjdelisle

The order id is nominally a UUID but since the originator of the order can make it up, this id can't be trusted to be unique. As long as there is a full mesh and everyone stores the originator of every order along with the order, this is irrelevant, but if one node can forward an order for another then it falls down.

In a gossip scenario, we should imagine that we want to have orders exist for some period of time and then timeout, unless re-created by their originator. The structure I would use is:

byte[64] signature;
byte[32] pubkey;
uint32 timestamp_secs; // drop if more than 3 hours old or 10 minutes in future
byte[] request_asset_id;
uint64 request_amount;
byte[] offer_asset_id;
uint64 offer_amount;
optional byte[64] replace_order_id;

And the order id would be defined as the hash of the wire encoded structure. Additionally use of two uint64s (request_amount and offer_amount) rather than a float64 (price) dodges the thorny issue of float rounding.

Finally, an order offering 0 for 0 can be defined as a withdrawal order and the use of replace_order_id can define what order is being withdrawn.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gossipThe post-full-mesh future of order gossip

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions