on master help sign in
Merge pull request #728 from tinnus-napbus/update-jael-docs
5d31de1poprox
content/docs/arvo/jael/_index.md+20
@@ -5,3 +5,23 @@ sort_by = "weight"
5template = "sections/docs/chapters.html"
5template = "sections/docs/chapters.html"
6insert_anchor_links = "right"
6insert_anchor_links = "right"
7+++
7+++
8+
9+## [Overview](/docs/arvo/jael/jael)
10+
11+An overview of Jael, Urbit's security and encryption vane.
12+
13+## [API Reference](/docs/arvo/jael/tasks)
14+
15+The `task`s Jael takes and the `gift`s it returns.
16+
17+## [Scry Reference](/docs/arvo/jael/scry)
18+
19+The scry endpoints of Jael.
20+
21+## [Data Types](/docs/arvo/jael/data-types)
22+
23+Reference documentation of the various data types used by Jael.
24+
25+## [Examples](/docs/arvo/jael/examples)
26+
27+Practical examples of using Jael's `task`s.
content/docs/arvo/jael/data-types.mdnew file+243
@@ -0,0 +1,243 @@
1++++
2+title = "Data Types"
3+weight = 4
4+template = "doc.html"
5++++
6+
7+Jael's section in `lull.hoon` contains three ancillary cores with their own type definitions as well as Jael's general types.
8+
9+### `$public-keys-result`
10+
11+```hoon
12++$ public-keys-result
13+ $% [%full points=(map ship point)]
14+ [%diff who=ship =diff:point]
15+ [%breach who=ship]
16+ ==
17+```
18+
19+This is what Jael gives (in a [%public-keys](/docs/arvo/jael/tasks#public-keys) `gift`) to subcribers who are tracking public key information for a `set` of `ship`s.
20+
21+Typically the `%full` kind with a `map` of `ship`s to [$point:point](#pointpoint)s is given immediately upon subscription and contains all public key records for the ships in question. After the `%full`, a `%diff` (including a [$diff:point](#diffpoint)) will be given whenever a change (such as the sponsor or pubkey) has occurred for one of the ships being tracked, and a `%breach` will be given whenever a continuity breach for a tracked ship occurs.
22+
23+### `$seed`
24+
25+```hoon
26++$ seed [who=ship lyf=life key=ring sig=(unit oath:pki)]
27+```
28+
29+Private boot parameters. The `who` field is the name of the ship, `lyf` is the `life` (key revision number), `key` is the private key and `sig` is the signature of the parent ship if it's a moon, and `~` otherwise.
30+
31+### `$dawn-event`
32+
33+```hoon
34++$ dawn-event
35+ $: =seed
36+ spon=(list [=ship point:azimuth-types])
37+ czar=(map ship [=rift =life =pass])
38+ turf=(list turf)
39+ bloq=@ud
40+ node=(unit purl:eyre)
41+ ==
42+```
43+
44+Ship initialisation parameters.
45+
46+- [$seed](#seed) contains the private boot parameters.
47+- `spon` is a `list` of ships and their [$point](#pointpoint)s in the ship's sponsorship chain, all the way to the galaxy level.
48+- `czar` is a map from each galaxy's `@p` to its `rift`, `life`, and public key (`pass`).
49+- `turf` is a `list` of DNS suffixes used for galaxies, which is `urbit.org` by default.
50+- `bloq` is the number of the Ethereum block in which the ship registered its keys with the Azimuth smart contract.
51+- `node` is the URL of the Ethereum node used to monitor Azimuth.
52+
53+### `$source`
54+
55+```hoon
56++$ source (each ship term)
57+```
58+
59+Source of public key updates for Jael. If it's a `term` it's a Gall agent e.g `%azimuth-tracker`. If it's a `ship`, Jael will subscribe to that ship's Jael for updates - e.g. Jael will subscribe to the parent planet of moons for updates about the moons.
60+
61+### `$source-id`
62+
63+```hoon
64++$ source-id @udsourceid
65+```
66+
67+Numerical index for Jael to organise its `source`s. Jael assigns its `source-id`s sequentially, starting from `0`.
68+
69+### `$state-eth-node`
70+
71+```hoon
72++$ state-eth-node :: node config + meta
73+ $: top-source-id=source-id
74+ sources=(map source-id source)
75+ sources-reverse=(map source source-id)
76+ default-source=source-id
77+ ship-sources=(map ship source-id)
78+ ship-sources-reverse=(jug source-id ship)
79+ ==
80+```
81+
82+Jael's data about `source`s for PKI updates about ships.
83+
84+- `top-source-id` tracks the highest `source-id` so Jael can easily determine what the next `source-id` should be.
85+- `sources` is a `map` of [$source-id](#source-id)s to [$source](#source)s.
86+- `sources-reverse` the same as `sources` but in reverse.
87+- `default-source` is the default `source` to use (typically `0` - `%azimuth-tracker`).
88+- `ship-sources` is a `map` from `ship`s to `source-id`s and records where to get updates from for the ships in question. Typically these will map moons to their parent ships.
89+- `ship-sources-reverse` is the same as `ship-sources` but in reverse.
90+
91+## block
92+
93+Structures for Ethereum blocks.
94+
95+### `$hash:block`
96+
97+```hoon
98++$ hash @uxblockhash
99+```
100+
101+Ethereum block hash.
102+
103+### `$number:block`
104+
105+```hoon
106++$ number @udblocknumber
107+```
108+
109+Ethereum block number.
110+
111+### `$id:block`
112+
113+```hoon
114++$ id [=hash =number]
115+```
116+
117+Ethereum block identifier - contains both the [$hash:block](#hashblock) and [$number:block](#numberblock).
118+
119+### `$block:block`
120+
121+```hoon
122++$ block [=id =parent=hash]
123+```
124+
125+A reference to an Ethereum block - contains the [$id:block](#idblock) and the [$hash:block](#hashblock) of its parent for ordering purposes.
126+
127+## point
128+
129+Structures for points (Ship IDs in Azimuth).
130+
131+### `$point:point`
132+
133+```hoon
134++$ point
135+ $: =rift
136+ =life
137+ keys=(map life [crypto-suite=@ud =pass])
138+ sponsor=(unit @p)
139+ ==
140+```
141+
142+Public key data for a particular ship. The `rift` is the current continuity breach number and `life` is the current key revision number. The `keys` `map` contains the public key (`pass`) for each `life` up to the current one. The `sponsor` is the current sponsor of the ship in question, if it has one.
143+
144+### `$key-update:point`
145+
146+```hoon
147++$ key-update [=life crypto-suite=@ud =pass]
148+```
149+
150+An update to a ship's keys. The `life` is the key revision number, `crypt-suite` is a version number for the cryptographic suite used for keys in Azimuth, and `pass` is the public key itself.
151+
152+### `$diffs:point`
153+
154+```hoon
155++$ diffs (list diff)
156+```
157+
158+A list of invertible [$diff:point](#diffpoint)s.
159+
160+### `$diff:point`
161+
162+```hoon
163++$ diff
164+ $% [%rift from=rift to=rift]
165+ [%keys from=key-update to=key-update]
166+ [%spon from=(unit @p) to=(unit @p)]
167+ ==
168+```
169+
170+An invertible diff for public key (and related) changes to the state of an Azimuth point (ship ID).
171+
172+- `%rift` is a change to the `rift` (continuity breach number) that occurs when a ship undergoes a continuity breach.
173+- `%keys` is a change to a ship's `life` and public key, specified in the [$key-update:point](#key-updatepoint).
174+- `%spon` is a change to a ship's sponsor.
175+
176+The `from` and `to` field specify the old a new values respectively.
177+
178+### `$udiffs:point`
179+
180+```hoon
181++$ udiffs (list [=ship =udiff])
182+```
183+
184+A list of non-invertible [$udiff:point](#udiffpoint)s.
185+
186+### `$udiff:point`
187+
188+```hoon
189++$ udiff
190+ $: =id:block
191+ $% [%rift =rift]
192+ [%keys key-update]
193+ [%spon sponsor=(unit @p)]
194+ [%disavow ~]
195+ == ==
196+```
197+
198+A non-invertible diff for public key (and related) changes to the state of an Azimuth point (ship ID).
199+
200+The [$id:block](#idblock) contains the block number and block hash of the Ethereum block in which the change occurred. The next part specifies what changed, where:
201+
202+- `%rift` means the ship has undergone a continuity breach and therefore the `rift` (continuity revision number) has changed.
203+- `%keys` means the ship's `life` (key revision number) has changed, the [$key-update:point](#key-updatepoint) contains the new `life` and pubkeys.
204+- `%spon` means the ship's sponsor has changed.
205+- `%disavow` means a previous Ethereum block has been disavowed.
206+
207+A `udiff:point` can be converted to a [$diff:point](#diffpoint) with the `+udiff-to-diff:point` function.
208+
209+## pki
210+
211+This structure is mostly a holdover from prior versions of Jael and is unused apart from [$oath:pki](#oathpki).
212+
213+### `$hand:pki`
214+
215+```hoon
216++$ hand @uvH
217+```
218+
219+128-bit Hash.
220+
221+### `$mind:pki`
222+
223+```hoon
224++$ mind [who=ship lyf=life]
225+```
226+
227+Key identifier.
228+
229+### `$name:pki`
230+
231+```hoon
232++$ name (pair @ta @t)
233+```
234+
235+Name in both ASCII and Unicode.
236+
237+### `$oath:pki`
238+
239+```hoon
240++$ oath @
241+```
242+
243+Signature. This type is used in the [$seed](#seed) for moons as a signature from the moon's parent.
content/docs/arvo/jael/examples.mdnew file+251
@@ -0,0 +1,251 @@
1++++
2+title = "Examples"
3+weight = 5
4+template = "doc.html"
5++++
6+
7+This documents contains practical examples of a number of Jael's `task`s.
8+
9+General documentation of the `task`s demonstrated here can be found in the [API Reference](/docs/arvo/jael/tasks) document, and details of the data types mentioned can be found in the [Data Types](/docs/arvo/jael/data-types) document.
10+
11+## `%private-keys`
12+
13+Here we'll look at subscribing to private key updates from Jael. We'll use a thread to pass Jael a `%private-keys` `task`, take the `%private-keys` `gift` it returns, debug print it to the terminal and finally unsubscribe with a `%nuke` `task`.
14+
15+`sub-priv.hoon`
16+
17+```hoon
18+/- spider
19+/+ strandio
20+=, strand=strand:spider
21+=, card=card:agent:gall
22+^- thread:spider
23+|= arg=vase
24+=/ m (strand ,vase)
25+^- form:m
26+;< ~ bind:m (send-raw-card:strandio %pass /sub-priv %arvo %j %private-keys ~)
27+;< res=[=wire =sign-arvo] bind:m take-sign-arvo:strandio
28+?> ?=([%sub-priv ~] wire.res)
29+?> ?=([%jael *] sign-arvo.res)
30+~& +.sign-arvo.res
31+;< ~ bind:m (send-raw-card:strandio %pass /sub-priv %arvo %j %nuke ~)
32+(pure:m !>(~))
33+```
34+
35+Save the above thread in the `/ted` directory of your `%home` desk and `|commit %home`.
36+
37+Now let's run the thread:
38+
39+```
40+> -sub-priv
41+```
42+
43+You should see the `%private-key` `gift` it returns in the Dojo:
44+
45+```
46+[ %private-keys
47+ life=1
48+ vein
49+ { [ p=1
50+ q
51+ 1.729.646.917.183.337.[...truncated for brevity]
52+ ]
53+ }
54+]
55+```
56+
57+At this point our thread unsubscribes again with a `%nuke` `task` but without that it would send a new `%private-key` `gift` each time the private keys were changed.
58+
59+## `%public-keys` and `%nuke`
60+
61+Here we'll look at both subscribing and unsubscribing to updates of a ship's public keys in Jael. We'll subscribe by sending Jael a `%public-keys` `task`, take the `%public-keys` `gift` it responds with, print it to the terminal, scry for the `set` of `duct`s subscribed to the ship in question, print them to the terminal, and finally send Jael a `%nuke` `task` to unsubscribe.
62+
63+Here's a thread that performs these actions:
64+
65+`sub-pub.hoon`
66+
67+```hoon
68+/- spider
69+/+ strandio
70+=, strand=strand:spider
71+=, card=card:agent:gall
72+=>
73+|%
74++$ subs
75+ $: yen=(jug duct ship)
76+ ney=(jug ship duct)
77+ nel=(set duct)
78+ ==
79+--
80+^- thread:spider
81+|= arg=vase
82+=/ m (strand ,vase)
83+^- form:m
84+=/ =@p (need !<((unit @p) arg))
85+::
86+:: sub to public updates for specified ship
87+=/ c1=card [%pass /sub-pubkeys %arvo %j %public-keys (silt ~[p])]
88+;< ~ bind:m (send-raw-card:strandio c1)
89+::
90+:: take response from jael & print it
91+;< res=[=wire =sign-arvo] bind:m take-sign-arvo:strandio
92+?> ?=([%sub-pubkeys ~] wire.res)
93+?> ?=([%jael %public-keys *] sign-arvo.res)
94+~& +.sign-arvo.res
95+::
96+:: scry for tracking subs for specified ship in jael & print
97+;< =subs bind:m (scry:strandio ,subs /j/subscriptions/1)
98+=/ ducts=(set duct) (~(get ju ney.subs) p)
99+~& ducts
100+::
101+:: unsub from public updates for specified ships
102+=/ c2=card [%pass /sub-pubkeys %arvo %j %nuke (silt ~[p])]
103+;< ~ bind:m (send-raw-card:strandio c2)
104+(pure:m !>(~))
105+```
106+
107+Note this example was performed on a comet as a fake ship won't have the required information in Jael.
108+
109+Save the above thread in the `/ted` directory and `|commit %home`. The thread takes a `ship` as an argument, so we'll try to subscribe to pubkey updates for `~dopzod`. Let's run the thread:
110+
111+```
112+> -sub-pub ~dopzod
113+```
114+
115+It first passes a `%public-keys` `task` to Jael that looks like `[%public-keys (silt ~[~dopzod])]` in order to subscribe. Jael will immediately respond with a `%public-keys` `gift` that contains a `%full` [$public-keys-result](/docs/arvo/jael/data-types#public-keys-result). The `(map ship point)` contained will (for each ship specified in the `task`) include the current pubkeys for the ship's current life as well as previous keys for previous `life`s. It thus contains a complete record of keys up to the present for each ship. Our thread will print these out to the terminal like so:
116+
117+```
118+[ %public-keys
119+ public-keys-result
120+ [ %full
121+ points
122+ { [ p=~dopzod
123+ q
124+ [ rift=2
125+ life=3
126+ keys
127+ { [ p=1
128+ q
129+ [ crypto-suite=1
130+ pass
131+ 939.529.329.928[...truncated for brevity...]
132+ ]
133+ ]
134+ [ p=2
135+ q
136+ [ crypto-suite=1
137+ pass
138+ 2.215.774.809.906.200.376.0[...truncated for brevity...]
139+ ]
140+ ]
141+ [ p=3
142+ q
143+ [ crypto-suite=1
144+ pass
145+ 707.070.568.606.374.[...truncated for brevity...]
146+ ]
147+ ]
148+ }
149+ sponsor=~
150+ ]
151+ ]
152+ }
153+ ]
154+]
155+```
156+
157+Along with giving us the current information, Jael will also subscribe us to any future updates for the ships in question. Such updates will come as additional `%public-keys` `gift`s, but rather than a `%full` `public-keys-result`, they'll instead contain either a `%diff` or `%breach` `public-keys-result`, depending on what's happened to the ship in question. It's difficult to simulate such events for demonstrative purposes so an example is not included, but you can look at the [$public-keys-result](/docs/arvo/jael/data-types#public-keys-result) to get an idea.
158+
159+Jael maintains a `(jug duct ship)` and its reverse `(jug ship duct)` in its state to track subscriptions. If we do a [subscriptions](/docs/arvo/jael/scry#subscriptions) scry and filter the result for `~dopzod`, we can see the duct of our thread has now been added to the `~dopzod` `set`. Our thread does this, and will output something like:
160+
161+```
162+{~[/gall/use/spider/0w1.vGVi-/~sampel-palnet/thread/~.dojo_0v6.0hlak.dam1b.bcdou.ai7gq.19fi8/sub-pubkeys /dill //term/1]}
163+```
164+
165+At this point our thread will send a `%nuke` `task` like `[%nuke (silt ~[~dopzod])]` to cancel our subscription. Jael doesn't respond to it, but now, with our thread having finished and exited, we can again scry & filter for subscriptions to `~dopzod`:
166+
167+```
168+> =/(a .^([yen=(jug duct ship) ney=(jug ship duct) nel=(set duct)] %j /=subscriptions=/1) (~(get ju ney.a) ~dopzod))
169+~
170+```
171+
172+As you can see the `set` is now empty, so we know the `%nuke` succeeded and Jael will no longer send us pubkey updates for `~dopzod`. One thing to note about `%nuke` is that it _must_ come from the same `duct` as the original subscription. You can't unsubscribe another app, ship, thread or what have you, so if we'd tried `%nuke`ing the subscription from a separate thread it wouldn't have worked.
173+
174+## `%turf`
175+
176+Here we'll look at using a `%turf` `task` to get Jael's list of domains. Note on a fake ship the list will be empty, so you may with to run it on a comet or moon.
177+
178+Here's a simple thread that'll pass Jael a `%turf` `task`, take the `%turf` `gift` it sends back and print it to the terminal:
179+
180+`turf.hoon`
181+
182+```hoon
183+/- spider
184+/+ strandio
185+=, strand=strand:spider
186+^- thread:spider
187+|= arg=vase
188+=/ m (strand ,vase)
189+^- form:m
190+=/ =task:jael [%turf ~]
191+=/ =card:agent:gall [%pass /get-domains %arvo %j task]
192+;< ~ bind:m (send-raw-card:strandio card)
193+;< resp=[=wire =sign-arvo] bind:m take-sign-arvo:strandio
194+?> ?=([%get-domains ~] wire.resp)
195+?> ?=([%jael %turf *] sign-arvo.resp)
196+~& +.sign-arvo.resp
197+(pure:m !>(~))
198+```
199+
200+Save in in the `/ted` directory of your ship and `|commit %home`. Next, let's try running it:
201+
202+```
203+> -turf
204+[%turf turf=~[<|org urbit|>]]
205+```
206+
207+As you see, the `%turf` `gift` contains `urbit.org` as `~['org' 'urbit']`.
208+
209+## `%step`
210+
211+Here we'll look at changing the web login code with a `%step` task.
212+
213+First, let's see the current `step` with a `%step` scry:
214+
215+```
216+> .^(@ud %j /=step=/(scot %p our))
217+0
218+```
219+
220+...and the current code with the `+code` generator:
221+
222+```
223+> +code
224+lidlut-tabwed-pillex-ridrup
225+```
226+
227+Now, let's pass Jael a `%step` task by using `|pass` in the dojo:
228+
229+```
230+> |pass [%j %step ~]
231+```
232+
233+Jael will `pass` Eyre a `%code-changed` `task:eyre` to let Eyre know the code's changed so you'll see a message from Eyre in the terminal:
234+
235+```
236+eyre: code-changed: throwing away cookies and sessions
237+```
238+
239+Now let's again scry for the `step` and see that it's been incremented:
240+
241+```
242+> .^(@ud %j /=step=/(scot %p our))
243+1
244+```
245+
246+And finally, let's again run `+code` and see there's now a new web login code:
247+
248+```
249+> +code
250+raldev-topnul-mirnut-lablut
251+```
content/docs/arvo/jael/jael-api.mddeleted−393
@@ -1,393 +0,0 @@
1−+++
2−title = "API Reference"
3−weight = 10
4−template = "doc.html"
5−+++
6−
7−In this document we describe the public interface for Jael. Namely, we describe
8−each `task` that Jael can be `%pass`ed, and which `gift`(s) Jael can `%give` in return.
9−
10−
11−## Tasks
12−
13−### `%dawn`
14−
15−This `task` is called once per ship during the vane initialization
16−phase immediately following the beginning of the [adult
17−stage](/docs/arvo/overview#structural-interface-core). This `task` is `%pass`ed to Jael by Dill, as Dill is the first vane to be loaded for
18−technical reasons, though we consider Jael to be the true "first" vane. This
19−`task` is only used for ships that will join the Ames network - fake ships (i.e.
20−made with `./urbit -F zod`) use the `%fake` `task` instead.
21−
22−`%dawn` is used to perform a sequence of initialization tasks related to saving
23−information about Azimuth and the Ames network and booting other vanes for the first time. Upon
24−receipt of a `%dawn` `task`, Jael will:
25− - record the Ethereum block the public key is registered to,
26− - record the URL of the Ethereum node used,
27− - save the signature of the parent planet (if the ship is a moon),
28− - load the initial public and private keys for the ship,
29− - set the DNS suffix(es) used by the network (currently just `arvo.network`),
30− - save the public keys of all galaxies,
31− - set Jael to subscribe to `%azimuth-tracker`,
32− - `%slip` a `%init` `task` to Ames, Clay, Gall, Dill, and Eyre, and `%give` an `%init`
33−`gift` to Arvo, which then informs Unix that the initialization process has concluded.
34−
35−#### Accepts
36−
37−`%dawn` accepts a `dawn-event`:
38−
39−```hoon
40− +$ dawn-event
41− $: =seed
42− spon=(list [=ship point:azimuth-types])
43− czar=(map ship [=rift =life =pass])
44− turf=(list turf)
45− bloq=@ud
46− node=(unit purl:eyre)
47− ==
48−```
49−
50−The `seed` is `[who=ship lyf=life key=ring sig=(unit oath:pki)]`. `who` is the
51−`@p` of the ship running the `task`, `lyf` is the current ship key revision,
52−`key` is the ship's private key, and `sig` is the signature of the ship's parent
53−planet if the ship is moon and `[~]` otherwise.
54−
55−`spon` is a `list` of ships and their `point`s in the ship's sponsorship chain,
56−all the way to the galaxy level. `point:azimuth-types` contains all Azimuth
57−related data and can be found in `zuse.hoon`.
58−
59−`czar` is a map from each galaxy's `@p` to its `rift`, `life`, and public key (`pass`).
60−
61−`turf` is a `list` of DNS suffixes used by the Ames network, which for now is
62−just `arvo.network`.
63−
64−`bloq` is the number of the Ethereum block in which the ship registered its keys
65−with the Azimuth smart contract.
66−
67−`node` is the URL of the Ethereum node used to register the ship's keys with Azimuth.
68−
69−#### Returns
70−
71−Jael `%give`s an `%init` `gift` to Unix. This occurs after the Dill `%slip`
72−init.
73−
74−#### Slips
75−
76−Jael `%slip`s `%init` `task`s to each of Eyre, Dill, Gall, Clay, and Ames, in
77−that order.
78−
79−
80−### `%fake`
81−
82−This `task` is used instead of `%dawn` when creating a fake ship via the `-F`
83−flag when calling the Urbit binary. It performs a subset of the actions that
84−`%dawn` performs, modified to accommodate the fake ship.
85−
86−`%fake` endows the ship with a private key and a public key deterministically derived from the
87−ship's `@p`. It sets `fak.own.pki` to `%.y`, which is the bit that determines
88−whether or not a ship is fake. Other parts of the Jael state, such as the
89−sponsorship chain and galaxy public keys are left at their bunted values.
90−
91−#### Accepts
92−
93−```hoon
94−[=ship]
95−```
96−`ship` is the `@p` of the fake ship being created.
97−
98−#### Returns
99−
100−Jael `%give`s a `%init` `gift` to Unix.
101−
102−#### Slips
103−
104−In response to a `%fake` `task`, Jael `%slip`s a `%init` `task` to each of Eyre, Dill, Gall,
105−Clay, and Ames, in that order.
106−
107−
108−### `%listen`
109−
110−Sets the source that the public keys for a set of `ship`s should be obtained
111−from. This can either be a Gall app that communicates with an Ethereum node such
112−as `%azimuth-tracker`, as in the case for galaxies, stars,
113−and planets, or a ship, as in the case of a moon or comet.
114−
115−After setting the source, Jael will then subscribe to the source for updates on
116−public keys for the given ships.
117−
118−
119−#### Accepts
120−
121−```hoon
122−[whos=(set ship) =source]
123−```
124−
125−`whos` is the set of ships whose key data source is to be altered. `source` is
126−`(each ship term)`, where `term` will ultimately be treated as a handle for a
127−Gall app.
128−
129−A `%listen` `task` with empty `whos` will set the default source to `source`.
130−This is the source used for all ships unless otherwise specified.
131−
132−When the `source` is a `term`, Jael looks into its state to find what source has
133−been previously assigned to that `term` and will henceforth obtain public keys for
134−ships in `(set ship)` from there. In practice, this is always
135−`%azimuth-tracker`, but the ability to use other sources is present.
136−
137−When the `source` is a ship, Jael will obtain public keys for ships in `(set ship)` from
138−the given ship. By default, the `source` for a moon will be the planet that
139−spawned that moon, and the `source` for a comet will be the comet itself.
140−
141−#### Returns
142−
143−This `task` returns no `gift`s.
144−
145−#### Passes
146−
147−If the `source` is a `term`, Jael will `%pass` a `%deal` `task` to Gall asking to
148−`%watch` the app given by `source` at path `/`.
149−
150−If the `source` is a `ship`, Jael will `%pass` a `%plea` `task` to Ames wrapping
151−a `%public-keys` `task` intended for Jael on the `ship` specified by `source`.
152−
153−
154−### `%meet`
155−
156−This `task` is deprecated and does not perform any actions.
157−
158−#### Accepts
159−
160−```hoon
161−[=ship =life =pass]
162−```
163−
164−#### Returns
165−
166−This `task` returns no `gift`s.
167−
168−
169−### `%moon`
170−
171−This `task` sets the public keys of a moon.
172−
173−#### Accepts
174−
175−```hoon
176−[=ship =udiff:point]
177−```
178−
179−The `ship` is the `@p` of the moon. The `task` will be a no-op if the `@p` is not that
180−of a moon, or if the moon does not belong to the ship.
181−
182−`udiff:point` contains the new public keys to be stored for the moon.
183−
184−#### Returns
185−
186−This `task` returns no `gift`s.
187−
188−
189−### `%nuke`
190−
191−This `task` cancels subscriptions to Jael's state from a given set of `ship`s.
192−This `task` works differently depending on whether the `task` originated locally
193−or remotely.
194−
195−#### Accepts
196−
197−```hoon
198−[whos=(set ship)]
199−```
200−`whos` is the `set` of `ship`s from which subscriptions are to be canceled.
201−
202−#### Returns
203−
204−This `task` returns no `gift`s.
205−
206−
207−### `%plea`
208−
209−This `task` is `%pass`ed to Jael from Ames. `%plea`s are wrappers for `task`s
210−that originate from a remote source, as the `%plea` pattern
211−is used to extend the `%pass`/`%give` semantics over the Ames network. Jael
212−attempts to perform the `task` wrapped in the `%plea`.
213−
214−Jael accepts two kinds of `%plea`s: [`%nuke`](#nuke) and
215−[`%public-keys`](#public-keys) and will crash if passed anything else. See the
216−relevant entries to learn how Jael responds to these.
217−
218−#### Accepts
219−
220−```hoon
221−[=ship =plea:ames]
222−```
223−`ship` is the origin of the plea, and `plea:ames` is `[vane=@tas =path
224−payload=*]`. Here, `vane=%j`, `path` is the internal route on the receiving ship, and `payload` is either a `%nuke` or
225−a `%public-keys` `task`.
226−
227−#### Returns
228−
229−Jael `%give`s a `%done` `gift` in response to a `%plea` `task`.
230−
231−#### Passes
232−
233−Jael `%pass`es itself the wrapped `task`.
234−
235−
236−### `%private-keys`
237−
238−This `task` creates a subscription to the private keys kept by Jael.
239−
240−We note that there are two `+private-keys` arms in Jael - one located in the
241−`+feed` core and the other located in the `+feel` core. This `task` calls the
242−arm in the `+feed` core.
243−
244−#### Accepts
245−
246−```hoon
247−[~]
248−```
249−
250−#### Returns
251−
252−```hoon
253−[%private-keys =life vein=(map life ring)]
254−```
255−
256−In response to a `%private-keys` `task`, Jael `%give`s a `%private-keys` `gift`.
257−`life=@ud` is the current `life` of the ship, and `vein` is a `map` from
258−`life`s to `ring`s that keeps track of all `life`-`ring` pairs throughout the
259−history of the ship.
260−
261−
262−### `%public-keys`
263−
264−This `task` creates a subscription for the callee to a selection of the public
265−keys kept by Jael. This `task` can originate locally or remotely.
266−
267−#### Accepts
268−
269−```hoon
270−[ships=(set ship)]
271−```
272−`ships` is the `set` of `ship`s whos' public keys are being subscribed to.
273−
274−#### Returns
275−
276−```hoon
277−[%public-keys =public-keys-result]
278−```
279−If the `task` originated locally, Jael `%give`s a `%public-keys` `gift` in
280−response. If it originated remotely, Jael `%give`s a `%boon` `gift` to back
281−to Ames wrapping a `%public-keys` `gift`.
282−
283−A `$public-keys-result` is the following.
284−```hoon
285− +$ public-keys-result
286− $% [%full points=(map ship point)]
287− [%diff who=ship =diff:point]
288− [%breach who=ship]
289−```
290−The first time Jael receives a `%public-keys` `task` from a ship it will return
291−a `[%public-keys-result %full]` `gift`, which contains all information about ships and
292−their associated points that Jael knows. Subsequent updates will typically be
293−`[%public-keys-result %diff]`, which tells the caller what has changed
294−since last time they sent a `%public-keys` `task`, and `[%public-keys-result
295−%breach]`, which informs the caller of ship breaches.
296−
297−
298−### `%rekey`
299−
300−This `task` updates the ship's private keys.
301−
302−#### Accepts
303−
304−```hoon
305−[=life =ring]
306−```
307−
308−`life` is a `@ud` that is the new ship key revision number. `ring` is a `@` that is the new private key.
309−
310−#### Returns
311−
312−```hoon
313−[%private-keys =life vein=(map life ring)]
314−```
315−
316−In response to a `%rekey` `task`, Jael `%give`s a `%private-keys` `gift`. `life`
317−is the new `life` given in the original `task`, and `vein` is a `map` from
318−`life`s to `ring`s that keeps track of all `life`-`ring` pairs throughout the
319−history of the ship.
320−
321−
322−### `%trim`
323−
324−This `task` is sent by the interpreter in order to free up memory.
325− This `task` is empty for Jael, since it is not a good idea to forget your
326− private keys and other cryptographic data.
327−
328−#### Accepts
329−
330−```hoon
331−[p=@ud]
332−```
333−This argument is unused by Jael.
334−
335−#### Returns
336−
337−This task returns nothing.
338−
339−
340−
341−### `%turf`
342−
343−This `task` is a request for Jael to provide its list of `turf`s, e.g. DNS
344−suffixes for the Ames network. Currently `arvo.network` is the only `turf` in use.
345−
346−#### Accepts
347−
348−```hoon
349−[~]
350−```
351−
352−#### Returns
353−
354−```hoon
355−[%turn tuf.own.pki]
356−```
357−
358−Jael `%give`s a `%turf` `gift` in response to a `%turf` `task`. `tuf.own.pki` is
359−a `(list turf)`, which is Jael's list of `turf`s.
360−
361−
362−### `%vega`
363−
364−`%vega` is called whenever the kernel is updated. Jael currently does not do
365−anything in response to this.
366−
367−#### Accepts
368−
369−`%vega` takes no arguments.
370−
371−#### Returns
372−
373−This `task` returns no `gift`s.
374−
375−
376−
377−### `%wegh`
378−
379−This `task` is a request to Jael to produce a memory usage report.
380−
381−#### Accepts
382−
383−This `task` has no arguments.
384−
385−#### Returns
386−
387−In response to this `task,` Jael `%give`s a `%mass` `gift` containing Ames'
388−current memory usage.
389−
390−
391−
392−
393−
content/docs/arvo/jael/jael.mdnew file+25
@@ -0,0 +1,25 @@
1++++
2+title = "Overview"
3+weight = 1
4+template = "doc.html"
5++++
6+
7+Jael is the networking key infrastructure vane.
8+
9+The main purpose of Jael is keeping track of [Azimuth](/docs/azimuth/azimuth) related information. For each ship, this consists of its public keys, its key revision number (or `life`), its continuity breach number (or `rift`) (see [Life and Rift](/docs/azimuth/life-and-rift)), and who the sponsor of the ship is. It also handles the local ship's private keys, keeps track of galaxy domain prefixes, and performs some boot-related tasks.
10+
11+By default, Jael's primary source of information is the Gall agent `%azimuth-tracker`, which (using `%eth-watcher`) runs a thread that polls an Ethereum node for transactions in the Azimuth contract. It can also get updates from other ships on the network. This is always the case for moons, where it subscribes to the moon's parent's Jael for updates.
12+
13+The database of PKI information that Jael maintains is used by other vanes and agents for identity validation, encryption, decryption, and other cryptographic functions. In particular, Ames (the network vane) uses the information stored in Jael to encrypt packets it sends to other ships, and to decrypt & validate packets it receives from other ships.
14+
15+Jael has a few `task`s you can use to interact with it. In particular, its [%public-keys task](/docs/arvo/jael/tasks#public-keys) allows an agent or thread to subscribe for PKI updates for a `set` of `ship`s.
16+
17+## Sections
18+
19+[API Reference](/docs/arvo/jael/tasks) - The `task`s Jael takes and the `gift`s it returns.
20+
21+[Scry Reference](/docs/arvo/jael/scry) - The scry endpoints of Jael.
22+
23+[Data Types](/docs/arvo/jael/data-types) - Reference documentation of the various data types used by Jael.
24+
25+[Examples](/docs/arvo/jael/examples) - Practical examples of using Jael's `task`s.
content/docs/arvo/jael/scry.mdnew file+204
@@ -0,0 +1,204 @@
1++++
2+title = "Scry Reference"
3+weight = 3
4+template = "doc.html"
5++++
6+
7+Jael's scry endpoints never take a `care`. The particular endpoints are specified in the place of the desk in the path prefix, then additional arguments are specified in the path. Note this style of scry path is considered outdated, and may be changed in the future.
8+
9+## `%step`
10+
11+A `%step` scry gets the current web login code revision number. It takes your ship name as its `path` and the type returned is a `@ud`.
12+
13+### Example
14+
15+```
16+> .^(@ud %j /=step=/(scot %p our))
17+0
18+```
19+
20+## `%code`
21+
22+A `%code` scry gets the current web login code. It takes your ship name as its `path` and the type returned is a `@p`.
23+
24+### Example
25+
26+```
27+> .^(@p %j /=code=/(scot %p our))
28+~lidlut-tabwed-pillex-ridrup
29+```
30+
31+## `%life`
32+
33+A `%life` scry gets the current `life` (key revision number) of a ship if known, otherwise it crashes. It takes a ship as its `path` and the type returned is a `@ud`.
34+
35+### Example
36+
37+```
38+> .^(@ud %j /=life=/(scot %p our))
39+1
40+```
41+
42+## `%lyfe`
43+
44+A `%lyfe` scry gets the current unitized `life` (key revision number) of a ship if known, otherwise returns `~`. It takes a ship as its `path` and the type returned is a `(unit @ud)`.
45+
46+### Example
47+
48+```
49+> .^((unit @ud) %j /=lyfe=/(scot %p our))
50+[~ 1]
51+```
52+
53+## `%rift`
54+
55+A `%rift` scry gets the current `rift` (continuity number) of a ship if known, otherwise it crashes. It takes a ship as its `path` and the type returned is a `@ud`.
56+
57+### Example
58+
59+```
60+.^(@ud %j /=rift=/(scot %p our))
61+1
62+```
63+
64+## `%ryft`
65+
66+A `%ryft` scry gets the current unitized `rift` (continuity number) of a ship if known, otherwise it returns `~`. It takes a ship as its `path` and the type returned is a `(unit @ud)`.
67+
68+### Example
69+
70+```
71+> .^((unit @ud) %j /=ryft=/(scot %p our))
72+[~ 1]
73+```
74+
75+## `%vein`
76+
77+A `%vein` scry gets your ship's private key for the specified `life`. It takes a `life` `@ud` as its `path` and the type returned is a `ring`.
78+
79+### Example
80+
81+```
82+> .^(@uw %j /=vein=/1)
83+0w84.0MwlQ.y2Ly9.6HVmH.8SYwo.EvuLC.f5YRw.T2NzD.EHtjZ.gpHZb.J0Pu5.aTGVL.UugSA.EZ~E9.~PODC.cohVD.B1zWj.ZWnJ2
84+```
85+
86+## `%vile`
87+
88+A `%vile` scry gets your `jam`mmed private boot parameters at your ship's current `life`. It takes no additional arguments in its `path`. The type returned is a `@` which is a `jam`med [$seed](/docs/arvo/jael/data-types#seed).
89+
90+### Examples
91+
92+```
93+> .^(@ %j /=vile=)
94+73.825.716.773.695.891.582.219.653.213.376.682.408.892.852.624.025.387.720.465.884.094.267.975.202.807.896.467.150.282.384.122.104.470.678.155.055.914.950.319.747.613.107.324.566.157.366.237.078.063.363.527.599.682.750.233
95+```
96+
97+```
98+> ;;(seed:jael (cue .^(@ %j /=vile=)))
99+[ who=~zod
100+ lyf=1
101+ key
102+ 1.729.646.917.183.337.262.068.568.133.450.460.269.618.308.934.734.494.661.340.450.478.360.301.077.532.415.587.141.242.844.893.269.500.211.196.916.184.768.225.437.577.083.064.475.012.067.992.317.942.521.494.338
103+ sig=~
104+]
105+```
106+
107+## `%deed`
108+
109+A `%deed` scry gets the `life`, pubkey and maybe a signature if the ship in question is a comet. It takes the target ship and life as its `path` like `/~sampel-palnet/1` and the type returned is a `[life pass (unit @ux)]`.
110+
111+### Example
112+
113+```
114+> .^([life pass (unit @ux)] %j /=deed=/(scot %p our)/1)
115+[ 1
116+ 2.649.818.598.466.464.524.534.996.841.661.372.043.001.125.438.577.869.575.450.096.229.472.239.369.342.882.589.479.483.389.735.480.760.982.635.242.955.515.616.049.650.771.700.602.823.946.406.713.457.849.302.626
117+ ~
118+]
119+```
120+
121+## `%earl`
122+
123+A `%earl` scry deterministically derives a private key for a moon. Note this is a holdover from an old version of moon infrastructure, the current `|moon` generator doesn't use this and instead generates moon private keys non-deterministically. It takes the moon name and your ship's current `life` (not the moon's `life`) as its `path` like `/~doznec-dozzod-dozzod-dozzod/1`. The type returned is a [$seed](/docs/arvo/jael/data-types#seed), the `life` of the moon in the `lyf` field of the `seed` will always be `1`.
124+
125+### Example
126+
127+```
128+> .^(seed:jael %j /=earl=/~doznec-dozzod-dozzod-dozzod/1)
129+[ who=~doznec-dozzod-dozzod-dozzod
130+ lyf=1
131+ key
132+ 1.055.418.877.440.612.330.077.014.834.463.499.863.663.523.990.336.436.220.536.921.445.512.367.957.276.250.223.724.881.932.188.751.226.308.505.496.234.256.625.462.295.144.257.529.749.880.805.247.600.674.018.370
133+ sig=~
134+]
135+```
136+
137+## `%sein`
138+
139+A `%sein` scry gets the sponsor for the specified ship. This scry is used implicitly by `sein:title`. It takes the target ship as its `path` and the type returned is a `@p`.
140+
141+### Example
142+
143+```
144+> .^(@p %j /=sein=/~sampel-palnet)
145+~talpur
146+```
147+
148+## `%saxo`
149+
150+A `%saxo` scry gets the sponsorship chain for the target ship (including the target ship itself). For example, a `%saxo` scry for a planet will return the planet, its star and the star's galaxy. This scry is used implicitly by `saxo:title`. It takes the target ship as its `path` and the type returned is a `(list @p)`.
151+
152+### Example
153+
154+```
155+> .^((list @p) %j /=saxo=/~sampel-palnet)
156+~[~sampel-palnet ~talpur ~pur]
157+```
158+
159+## `%subscriptions`
160+
161+A `%subscriptions` scry gets the current state of subscriptions to public key updates (typically initiated with a [%public-keys task](/docs/arvo/jael/tasks#public-keys)). It takes a `life` as its `path` and returns a triple consisting of the following:
162+
163+```hoon
164+yen=(jug duct ship) :: trackers
165+ney=(jug ship duct) :: reverse trackers
166+nel=(set duct) :: trackers of all
167+```
168+
169+The `yen` `jug` maps subscribed `duct`s to the `ship`s they're tracking, and `ney` is just the inverse, mapping tracked `ship`s to subscribed `duct`s. The `nel` set contains `duct`s track all public key updates.
170+
171+### Example
172+
173+```
174+.^([yen=(jug duct ship) ney=(jug ship duct) nel=(set duct)] %j /=subscriptions=/1)
175+[yen={} ney={} nel={}]
176+```
177+
178+## `%sources`
179+
180+A `%sources` scry gets the current state of Jael's sources for PKI updates. It takes no additional arguments in its `path` and returns a [$state-eth-node](/docs/arvo/jael/data-types#state-eth-node).
181+
182+### Example
183+
184+```
185+> .^(state-eth-node:jael %j /=sources=)
186+[ top-source-id=0
187+ sources={}
188+ sources-reverse={}
189+ default-source=0
190+ ship-sources={}
191+ ship-sources-reverse={}
192+]
193+```
194+
195+## `%turf`
196+
197+A `%turf` scry gets the list of domain prefixes for galaxies. It takes no additional arguments in its `path`. It returns a `(list turf)`, where a `turf` is a TLD-first `(list @t)`, so `urbit.org` as a `turf` is `~['org' 'urbit']`.
198+
199+### Example
200+
201+```
202+> .^((list turf) %j /=turf=)
203+~[<|org urbit|>]
204+```
content/docs/arvo/jael/tasks.mdnew file+225
@@ -0,0 +1,225 @@
1++++
2+title = "API Reference"
3+weight = 2
4+template = "doc.html"
5++++
6+
7+This document details all the `task`s you may wish to send Jael, as well as the `gift`s you'll receive in response.
8+
9+You may also wish to reference the [Data Types](/docs/arvo/jael/data-types) document for details of the types referenced here, and the [Examples](/docs/arvo/jael/examples) document for practical examples of using these `task`s.
10+
11+## `%dawn`
12+
13+```hoon
14+[%dawn dawn-event]
15+```
16+
17+Boot from keys.
18+
19+This `task` is called once per ship during the vane initialization phase immediately following the beginning of the [adult stage](/docs/arvo/overview#structural-interface-core). This `task` is `%pass`ed to Jael by Dill, as Dill is the first vane to be loaded for technical reasons, though we consider Jael to be the true "first" vane. This `task` is only used for ships that will join the Ames network - fake ships (i.e. made with `./urbit -F zod`) use the [%fake](#fake) `task` instead.
20+
21+`%dawn` is used to perform a sequence of initialization tasks related to saving information about Azimuth and the Ames network and booting other vanes for the first time. Upon receipt of a `%dawn` `task`, Jael will:
22+
23+- record the Ethereum block the public key is registered to,
24+- record the URL of the Ethereum node used,
25+- save the signature of the parent planet (if the ship is a moon),
26+- load the initial public and private keys for the ship,
27+- set the DNS suffix(es) used by the network (currently just `urbit.org`),
28+- save the public keys of all galaxies,
29+- set Jael to subscribe to `%azimuth-tracker`,
30+- `%slip` a `%init` `task` to Ames, Clay, Gall, Dill, and Eyre, and `%give` an `%init`
31+ `gift` to Arvo, which then informs Unix that the initialization process has concluded.
32+
33+This `task` takes a [$dawn-event](/docs/arvo/jael/data-types#dawn-event) as its argument.
34+
35+You would not use this `task` manually.
36+
37+### Returns
38+
39+Jael `%give`s an `%init` `gift` to Unix. This occurs after the Dill `%slip` init.
40+
41+## `%fake`
42+
43+```hoon
44+[%fake =ship]
45+```
46+
47+Boot fake ship.
48+
49+This `task` is used instead of [%dawn](#dawn) when creating a fake ship via the `-F` flag when calling the Urbit binary. It performs a subset of the actions that `%dawn` performs, modified to accommodate the fake ship.
50+
51+`%fake` endows the ship with a private key and a public key deterministically derived from the ship's `@p`. It sets `fak.own.pki` to `%.y`, which is the bit that determines whether or not a ship is fake. Other parts of the Jael state, such as the sponsorship chain and galaxy public keys are left at their bunted values.
52+
53+The `ship` field specifies the `@p` of the fake ship being created.
54+
55+You would not use this `task` manually.
56+
57+### Returns
58+
59+Jael `%give`s a `%init` `gift` to Unix.
60+
61+## `%listen`
62+
63+```hoon
64+[%listen whos=(set ship) =source]
65+```
66+
67+Set Ethereum source.
68+
69+Sets the source that the public keys for a set of `ship`s should be obtained from. This can either be a Gall app that communicates with an Ethereum node such as `%azimuth-tracker`, as in the case of galaxies, stars, and planets, or a ship, as in the case of moons.
70+
71+`whos` is the set of ships whose key data source is to be monitored. The [$source](/docs/arvo/jael/data-types#source) is either a ship or the name of a Gall app to use as a source. A `%listen` `task` with empty `whos` will set the default source. When the `source` is a ship, Jael will obtain public keys for ships in `(set ship)` from the given ship. By default, the `source` for a moon will be the planet that spawned that moon.
72+
73+You are unlikely to use this `task` manually.
74+
75+### Returns
76+
77+Jael will not return any `gift`s in response to a `%listen` `task`.
78+
79+## `%meet`
80+
81+```hoon
82+[%meet =ship =life =pass]
83+```
84+
85+This `task` is deprecated and does not perform any actions.
86+
87+## `%moon`
88+
89+```hoon
90+[%moon =ship =udiff:point]
91+```
92+
93+Register moon keys or otherwise administer a moon.
94+
95+This is what is sent to Jael by `%hood` behind the scenes when you run `|moon`, `|moon-breach` or `|moon-cycle-keys`. The `ship` field is the moon's `@p`. The [$udiff:point](/docs/arvo/jael/data-types#udiffpoint) will contain the bunt of an [$id:block](/docs/arvo/jael/data-types#idblock) (since moons aren't registered in Azimuth) and one of the `udiff` actions depending on what you want to do.
96+
97+### Returns
98+
99+Jael does not return any `gift`s in response to a `%moon` `task`.
100+
101+## `%nuke`
102+
103+```hoon
104+[%nuke whos=(set ship)]
105+```
106+
107+Cancel subscription to public or private key updates.
108+
109+If you've subscribed to public or private key updates from Jael with a [%private-keys](#private-keys) or [%public-keys](#public-keys) `task`, you can unsubscribe and stop receiving updates with a `%nuke` `task`. The `(set ship)` is the `set` of `ship`s which you want to stop tracking. Jael organises subscriptions based on `duct`s, and will determine which subscription to cancel implicitly based on the `duct` the `%nuke` `task` came from. This means a `%nuke` `task` only works from the same thread or agent and on the same `path` as the original subscription request.
110+
111+To cancel a subscription to the ship's private keys you must leave `whos` empty like `[%nuke ~]`.
112+
113+### Returns
114+
115+Jael does not return a `gift` in response to a `%nuke` `task`.
116+
117+### Examples
118+
119+See the [%public-keys and %nuke](/docs/arvo/jael/examples#public-keys-and-nuke) section of the Examples document for an example of using `%nuke` to cancel a `%public-keys` subscription. See the thread in the [%private-keys](/docs/arvo/jael/examples#private-keys) example for cancelling a `%private-keys` subscription.
120+
121+## `%private-keys`
122+
123+```hoon
124+[%private-keys ~]
125+```
126+
127+Subscribe to private key updates.
128+
129+Subscribe to be notified of private key updates for the local ship. The subscription will continue until Jael receives a [%nuke](#nuke) `task` to cancel it.
130+
131+### Returns
132+
133+Jael responds to a `%private-keys` `task` with a `%private-keys` `gift` which looks like:
134+
135+```hoon
136+[%private-keys =life vein=(map life ring)]
137+```
138+
139+The `life` is the current life of the ship and the `vein` `map` contains the private key for each life up to (and including) the current one. Upon first subscribing, Jael will immediately respond with a `%private-keys` `gift`. Then, whenever the ship's private keys are changed, it'll send a new and updated `%private-keys` `gift`.
140+
141+### Example
142+
143+See the [%private-keys](/docs/arvo/jael/examples#private-keys) section of the Examples document for a practical example.
144+
145+## `%public-keys`
146+
147+```hoon
148+[%public-keys ships=(set ship)]
149+```
150+
151+Subscribe to public key (and related) updates from Jael.
152+
153+An agent or thread can subscribe to be notified of public key updates, sponsorship changes and continuity breaches for the `set` of `ship`s specified in the `ships` field. The subscription will continue until Jael receives a [%nuke](#nuke) `task` to cancel it.
154+
155+### Returns
156+
157+Jael responds to a `%public-keys` `task` with `%public-keys` `gift`s which look like:
158+
159+```hoon
160+[%public-keys =public-keys-result]
161+```
162+
163+The [$public-keys-result](/docs/arvo/jael/data-types#public-keys-result) contains whatever changes have occurred.
164+
165+Upon subscription, Jael will immeditely respond with a `%public-keys` `gift` containing a `%full` `public-keys-result` with the public key for each `life` up until the current one for each `ship` specified in the original `task`. After than, Jael will send a `%public-keys` `gift` with either a `%diff` or `%breach` `public-keys-result` each time a change occurs for any of the `ship`s to which you're subscribed.
166+
167+### Example
168+
169+See the [%public-keys and %nuke](/docs/arvo/jael/examples#public-keys-and-nuke) section of the Examples document for a practical example.
170+
171+## `%rekey`
172+
173+```hoon
174+[%rekey =life =ring]
175+```
176+
177+Update private keys.
178+
179+This is what is sent to Jael by `%hood` when you run `|rekey`, as you must after setting new Azimuth keys or running `|cycle-moon-keys` on a moon's parent. It will update your `life` (key revision number) and private keys. The `life` field is the new `life` (typically an increment of the current `life`) and the `ring` is a private key `@`.
180+
181+### Returns
182+
183+Jael does not return any `gift` in response to a `%rekey` `task`.
184+
185+## `%turf`
186+
187+```hoon
188+[%turf ~]
189+```
190+
191+View domains.
192+
193+The domains returned by a `%turf` `task` are used as the base for individual galaxy domain names (e.g. from `urbit.org` you get `zod.urbit.org`, `bus.urbit.org`, etc). Jael gets these from Azimuth, then Ames gets them from Jael and passes them to the runtime, which will perform the DNS lookups and give Ames back the galaxy IP addresses. A `%turf` task takes no additional arguments. You're unlikely to use this manually - if you want the current `turf`s you'd likely want to do a [turf scry](/docs/arvo/jael/scry#turf) instead.
194+
195+### Returns
196+
197+Jael will respond to a `%turf` `task` with a `%turf` `gift`, which looks like:
198+
199+```hoon
200+[%turf turf=(list turf)]
201+```
202+
203+The `turf` in the `(list turf)` is a domain as a `(list @t)`, TLD-first. The current default is `[['org' 'urbit' ~] ~]`.
204+
205+### Example
206+
207+See the [%turf section of the Examples document](/docs/arvo/jael/examples#turf) for a practical example.
208+
209+## `%step`
210+
211+```hoon
212+[%step ~]
213+```
214+
215+Reset web login code.
216+
217+Jael maintains a `step` value that represents the web login code revision number, and uses it to derive the code itself. It begins at `0` and is incremented each time the code is changed. When Jael updates the web login code, it sends Eyre a `%code-changed` `task:eyre` so that Eyre can throw away all of its current cookies and sessions. A `%step` task takes no additional argument.
218+
219+### Returns
220+
221+Jael does not return a `gift` in response to a `%step` `task`.
222+
223+### Example
224+
225+See the [%step](/docs/arvo/jael/examples#step) section of the Examples document for a practical example.