Skip to content

Commit

Permalink
update (just) the Dilation abilities section
Browse files Browse the repository at this point in the history
semantic newlines; document what the implementation does; versions are integers
  • Loading branch information
meejah committed Apr 25, 2023
1 parent 6403aac commit 7ad5cc3
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions dilation-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,36 @@ messages are used to open/use/close the application-visible subchannels.

## Capability discovery

The Wormhole protocol includes a `versions` message sent immediately after
the shared PAKE key is established. This also serves as a key-confirmation
message, allowing each side to confirm that the other side knows the right
key. The body of the `versions` message is a JSON-formatted string with keys
that are available for learning the abilities of the peer. Dilation is
signaled by a key named `can-dilate`, whose value is a list of strings. Any
version present in both side's lists is eligible for use.
The Wormhole protocol includes a `versions` message sent immediately after the shared PAKE key is established.
This also serves as a key-confirmation message, allowing each side to confirm that the other side knows the right key.
The body of the `versions` message is a JSON-formatted string with keys that are available for learning the abilities of the peer.
Dilation is signaled by a key named `can-dilate`, whose value is a list of strings.
Any version present in both side's lists is eligible for use.

The connection abilities are communicated similarly to Transit, in a `dilation-abilities` key.
Currently supported: `direct-tcp-v1`, `tor-tcp-v1` and `relay-v1`.
These have similar meaning as in Transit (referring to the ability to make a direct connection, a connection via Tor and a connection via the Transit Relay respectively)
See :ref:`transit.md` for more details.

For example:

```
{
"can-dilate": [1]
"dilation-abilities": [
{"type": "direct-tcp-v1"},
{"type": "relay-v1"},
]
}
```

When considering the `"can-dilate"` list, implementations take the intersection (of both peers) and SHOULD select the "best" version in that intersection.
Usually "best" means "newest" (i.e. biggest number) but implementations MAY have other ways of deciding what is best.
The version selected is communicated in the `please` message with `"use-version"` key.
Both sides MUST use the version selected by the Leader (see next section).

Currently there is only one version: `1`.


## Leaders and Followers

Expand Down

0 comments on commit 7ad5cc3

Please sign in to comment.