2.3.1 Relay and copies

Each site must have each order, because each site calculates the same sequence and executes the same list. This page tells how orders go between the sites, and what occurs with copies.

Step 1: the client sends

You sign an order one time. It is a message of 256 bytes. It contains your account, a nonce and the order. The nonce is a counter that makes each order unique.

Your client sends the same bytes to two or three doors. The default of the official client is more than one door. If one door delays or drops your order, another door delivers it.

Step 2: each door forwards

A card that receives an order from a client is a door for that order. It stamps the order and forwards the packet to all other sites, without a wait. It also broadcasts its observation: the hash of the order and its wire stamp, with a signature.

A card that receives the order from another door does not forward it again. It only stamps it and broadcasts its observation.

Number of copies

For one order that the client sends to two doors, on six sites:

Location Copies that arrive Which copy counts
Each of the two doors 1 from the client, 1 from the other door The first copy that arrives
Each of the four other sites 2, one from each door The first copy that arrives

Each card broadcasts one observation for each order. An order has six observations, one from each site.

The client sends one order to two doors. Each door forwards it one time to the other sites. Each site keeps the first copy and drops the second.
Figure 5. Two doors, one forward each, six stamps. Loop of 5 seconds.

When a site receives a second copy

Each card identifies an order by the hash of its 256 bytes. The same bytes always give the same hash. A card identifies a copy immediately.

  • The first copy gives the stamp. The card ignores the other copies.
  • The card rejects a copy that arrives after the order is in the canonical order. The matcher also rejects it, because the ledger used its nonce before.

An order never executes two times. The ledger uses each nonce one time only. Because of this, it is always safe to send an order again.

If a site is not available

Each card keeps a queue of records for each other site. If a site is not available for a long time, its queue becomes full. Then the card discards the records that do not fit and marks a gap. When the site comes back, it loads a snapshot and reads the records that it did not receive. The chain continues with the other sites.

results matching ""

    No results matching ""