# Weijie Wu et al. - 0x Mesh Architecture Doc (Highlights) ![rw-book-cover|256](https://readwise-assets.s3.amazonaws.com/static/images/article3.5c705a01b476.png) ## Metadata **Review**:: [readwise.io](https://readwise.io/bookreview/26560541) **Source**:: #from/readwise **Zettel**:: #zettel/fleeting **Status**:: #x **Authors**:: [[Weijie Wu]], [[Alex Browne]], [[Peter Zeitz]], [[Fabio Berger]] **Full Title**:: 0x Mesh Architecture Doc **Category**:: #articles #readwise/articles **Category Icon**:: šŸ“° **Highlighted**:: [[2023-04-18]] **Created**:: [[2023-04-18]] ## Highlights > [!bot] Take-Aways > 1. The protocol uses 0x orders and an incentivization mechanism to encourage peer participation. > 2. There is a centralized introducer node that assigns unique IDs to peers and allows them to connect. This introduces a single point of failure. > 3. Orders have a minimum 1 minute and maximum 1 month expiration time. This limits order book size. > 4. The network topology uses random peer connections. Peers form neighborhood relationships at random. > 5. Peers aim to maintain between X and Y neighbor connections. They can disconnect from malicious or inactive neighbors. > 6. Peers have a pending order table size of M orders and local storage of K bytes. They store the highest reserve orders that fit. > 7. Peers share up to N orders with their connected neighbors, favoring higher ranked neighbors. > 8. Peers gain points for receiving valid orders from neighbors and lose points for receiving invalid data. Points impact neighbor ranking. > 9. The protocol incentivizes peers to share valuable data and build helpful neighborhood connections through the points system. > 10. There are parameters around order expiration, network topology, data sharing, and points that can be tuned to optimize the protocol. ### Objectives - We call a protocol ā€œincentive compatibleā€ if any rational peer will simply follow the protocol in order to achieve its own wellbeing (i.e., maximizing its own utility). ([PageĀ 1](zotero://open-pdf/library/items/SH88XG7X?page=0&annotation=NI3MR9B6)) ^510904540 ### System Components and Terminology - AnĀ introducer, which records a unique id for peers and allows them to bootstrap symmetric connections. ([PageĀ 2](zotero://open-pdf/library/items/SH88XG7X?page=1&annotation=BID3VK39)) ^510904542 Centralized peers registar. ### Our MVP choices #### Representation of orders and peers - All orders must be 0x orders that are fillable for a non-zero amount. ([PageĀ 5](zotero://open-pdf/library/items/SH88XG7X?page=4&annotation=E3KTP25G)) ^510904545 - An order must have an expiration time no sooner than 1 minute and no later than 1 month from the current UTC time. This helps to limit the size of the order book by not including orders that are unlikely to be filled. ([PageĀ 5](zotero://open-pdf/library/items/SH88XG7X?page=4&annotation=TCUYQ6T6)) ^510904546 #### System topology - We have elected to use a random strategy for building neighborhoods and finding peers. The probability that two peers recognize each other and form a neighborhood relationship is random, with no specific relationship to their identity, location, historical contribution, etc. ([PageĀ 5](zotero://open-pdf/library/items/SH88XG7X?page=4&annotation=FE69L96R)) ^510904548 #### Peer functions - We have only oneĀ introducer.Ā This helps make things simple, but does introduce a single point of failure. ([PageĀ 5](zotero://open-pdf/library/items/SH88XG7X?page=4&annotation=ZQNTBKUW)) ^510904550 - A peer would like to keep the total number of its neighbors between X and Y (where X and Y are two integers and X < Y). ([PageĀ 5](zotero://open-pdf/library/items/SH88XG7X?page=4&annotation=APA9VZIS)) ^510904551 - A peer will terminate a neighborhood relationship if (a) the neighbor isĀ announced by theĀ introducerĀ as sleeping, or (b) the neighbor is regarded as malicious, or (c) the neighbor's score (which will be explained later) is below some threshold for a continuous T seconds. ([PageĀ 6](zotero://open-pdf/library/items/SH88XG7X?page=5&annotation=B39DKG3Y)) ^510904552 - A peer can choose a size M for its pending table. In other words, a peer can store at most M pending orders during a particular time period. The value of M can be chosen over interval [Mmin, Mmax]. ([PageĀ 6](zotero://open-pdf/library/items/SH88XG7X?page=5&annotation=8R4ZTPCD)) ^510904553 - A peer has a size K bytes for its local storage. In other words, a peer can store any number of orders as long as they fit in K bytes on disk for any particular time point. ([PageĀ 6](zotero://open-pdf/library/items/SH88XG7X?page=5&annotation=CMW96J72)) ^510904554 - Store as many orders as possible starting from ones with the largest ā€œreserveā€ to lower ones, and discard the rest (when there is a tie, just randomly select one/some). Note that this may call the order deletion operation on existing orders. ([PageĀ 7](zotero://open-pdf/library/items/SH88XG7X?page=6&annotation=Y5ZTL2TM)) ^510904555 - A peer sets up a limit N on the maximal number of possible orders it shares with its beneficiaries within a given time period. ([PageĀ 7](zotero://open-pdf/library/items/SH88XG7X?page=6&annotation=VI2A6R7A)) ^510904556 - The peer broadcasts the selected orders to the following neighbors in the beneficiary set: 1) X_1 peers randomly selected from top X ranked neighbors, and 2) Y_1 peers randomly selected from the rest of Y neighbors. ([PageĀ 7](zotero://open-pdf/library/items/SH88XG7X?page=6&annotation=594RLKU6)) ^510904557 - This neighbor sends me an order, and I decided to put this order into my local storage: Add K1 points. ([PageĀ 8](zotero://open-pdf/library/items/SH88XG7X?page=7&annotation=9DBMZHBY)) ^510904558 Multiplying with the transaction fee rate. - This neighbor sends me something, and for whatever reason I don't think it is a meaningful order (e.g., syntax error, expired, settled, cancelled, or already in my local storage): Minus K2 points. ([PageĀ 8](zotero://open-pdf/library/items/SH88XG7X?page=7&annotation=NMNETPJQ)) ^510904559