aboutsummaryrefslogtreecommitdiffstats
path: root/docs/guides/federation/building-on-the-api.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/guides/federation/building-on-the-api.md')
-rw-r--r--docs/guides/federation/building-on-the-api.md22
1 files changed, 14 insertions, 8 deletions
diff --git a/docs/guides/federation/building-on-the-api.md b/docs/guides/federation/building-on-the-api.md
index 9f144be..45394ed 100644
--- a/docs/guides/federation/building-on-the-api.md
+++ b/docs/guides/federation/building-on-the-api.md
@@ -2,14 +2,17 @@
An application on a federated swarm reads what counts at a node and writes as a party.
This guide says how, through the client or with code of its own. The formats are the
-design's ([`federation.md`](../../federation.md), Events, The policy, What counts).
+design's ([`federation.md`](../../federation.md), [Events](../../federation.md#events),
+[The policy](../../federation.md#the-policy),
+[What counts](../../federation.md#what-counts)).
## Reading
`GET /events/counts` is what counts, as the node reads it now: the values at places
(`values`), the current version and its rules, each party's keys and nodes, the members
-([`writing-and-reading.md`](writing-and-reading.md), Reading). There is no stream of what
-counts: read it again when the store's heads change (`heads` in `GET /events`).
+([`writing-and-reading.md`](writing-and-reading.md),
+[Reading](writing-and-reading.md#reading)). There is no stream of what counts: read it
+again when the store's heads change (`heads` in `GET /events`).
What a node answers is its word: it may be behind, and an application that must not take
it on trust reads the events themselves (`GET /events/{id}`) and checks their signatures,
@@ -25,8 +28,9 @@ continuum-party --node http://tv:secret@localhost:3000 --key laptop.key \
```
It signs on the heads the node shows, records what it signed, and puts it; `again` signs
-anew what a move to a checkpoint refused ([`writing-and-reading.md`](writing-and-reading.md),
-After a move).
+anew what a move to a checkpoint refused
+([`writing-and-reading.md`](writing-and-reading.md),
+[After a move](writing-and-reading.md#after-a-move)).
## Writing with code of its own
@@ -41,11 +45,13 @@ sorts them:
* `deps`: the heads it read (`heads` in `GET /events`), each as 64 lower-case hex digits,
ascending, one at least.
-* `key`: the key it signs with, `ssh-ed25519`, a space, the base64 of its blob, no
- comment; one of the party's keys.
+* `key`: the key it signs with, its type (`ssh-ed25519` or `ecdsa-sha2-nistp256`), a
+ space, the base64 of its blob, no comment; one of the party's keys.
* `sig`: an SSH signature (`ssh-keygen -Y sign`, namespace `continuum-federation`, hashed
with `sha512`) over the JCS bytes of the object without `sig`: the SSHSIG blob, its
- reserved field empty, in base64, unarmored.
+ reserved field empty, in base64, unarmored. Of an ECDSA key, its `s` low, at most half
+ the curve's order: `ssh-keygen` makes a high one half the time, which no node takes;
+ sign again, or put the order less `s` in its place.
* The value is any JSON with integers only, from −2⁵³ to 2⁵³; the event up to 256 KiB.
Put its bytes as they are: