on master help sign in
Merge pull request #1084 from urbit/l2-docs

Layer 2 and Azimuth docs

commitc31885bd61210b422664fde0bd4e7e5c817ddc5b authorpoprox <51337059+drbeefsupreme@users.noreply.github.com> dateTue 9 Nov 2021, 12:55 (5 years ago) parent3b21c8b48558a5
25 files changed+2677−392
content/docs/azimuth/_index.md+26−7 content/docs/azimuth/advanced-azimuth-tools.md+82−25 content/docs/azimuth/azimuth-eth.md+158 content/docs/azimuth/azimuth.md+126−137 content/docs/azimuth/ecliptic.md+436 content/docs/azimuth/flow.md+232 content/docs/azimuth/hd-wallet.md+137 content/docs/azimuth/l2/_index.md+35 content/docs/azimuth/l2/bytestring.md+201 content/docs/azimuth/l2/l2-actions.md+183 content/docs/azimuth/l2/layer2-api.md+14 content/docs/azimuth/l2/layer2.md+425 content/docs/azimuth/l2/roller.md+66 content/docs/azimuth/life-and-rift.md+7−5 content/docs/glossary/azimuth.md+27−6 content/docs/glossary/hdwallet.md+2−1 content/docs/glossary/proxies.md+6−1 content/docs/glossary/rollups.md+30 content/faq.md+9−154 content/using/id/_index.md+26 content/using/id/hd-wallet.md+164 content/using/id/l2-star.md+41 content/using/id/overview.md+187−55 content/using/id/proxies.md+56 content/using/id/using-bridge.md+1−1
content/docs/azimuth/_index.md+26−7
@@ -6,17 +6,36 @@ template = "sections/docs/chapters.html"
66insert_anchor_links = "right"
77+++
88
9−
10−## [Azimuth](/docs/azimuth/azimuth)
9+### [Azimuth](/docs/azimuth/azimuth)
1110
1211An overview of the Ethereum-based public key infrastructure utilized by Urbit.
1312
14−## [Life and Rift](/docs/azimuth/azimuth)
13+### [Urbit HD Wallet](/docs/azimuth/hd-wallet)
14+
15+Azimuth has its own optional hierarchical deterministic wallet system, often
16+referred to as a "master ticket".
17+
18+### [Data Flow](/docs/azimuth/flow)
19+
20+Diagrams and explanations of how data flows between Bridge and the various
21+components inside Urbit involved with layer 2.
22+
23+### [Azimuth.eth](/docs/azimuth/azimuth-eth)
1524
16−An explanation of how Azimuth keeps track of the most recent set of networking
17−keys necessary to communicate with a ship.
25+A description of the `azimuth.eth` smart contract, which is the data store for
26+Azimuth.
1827
19−## [Advanced Azimuth Tools](/docs/azimuth/advanced-azimuth-tools)
28+### [Ecliptic.eth](/docs/azimuth/ecliptic)
2029
21−Expert-level tooling for generating, signing, and sending Azimuth-related
30+A description of the `ecliptic.eth` smart contract, which is the business logic
31+for `azimuth.eth`. This includes an overview of all function calls available.
32+
33+### [Advanced Azimuth Tools](/docs/azimuth/advanced-azimuth-tools)
34+
35+Expert-level tooling for generating, signing, and sending layer 1 Azimuth-related
2236transactions from within Urbit itself.
37+
38+### [Life and Rift](/docs/azimuth/azimuth)
39+
40+An explanation of how Azimuth indexes networking keys and breaches to keep track
41+of the most recent set of networking keys necessary to communicate with a ship.
content/docs/azimuth/advanced-azimuth-tools.md+82−25
@@ -1,19 +1,43 @@
11+++
22title = "Advanced Azimuth Tools"
3−weight = 4
3+weight = 7
44template = "doc.html"
55+++
66
7−This document outlines some advanced techniques for generating, signing, and sending Azimuth-related transactions from within Urbit itself. It's strongly discouraged to do this unless you're very confident as Azimuth transactions are permanent and will cost ETH to complete. However, until you upload a signed transaction to the blockchain no transaction will take place so it's safe to explore these tools. It will also be very helpful to have at least a rudimentary understanding of Hoon in order to read and modify parts of the code.
8−
9−First you will want to [boot a fakezod](https://urbit.org/using/develop/#creating-a-development-ship). You can do this with your live running ship but at this time this will need you to modify the code so it's best to do this on a ship you can make mistakes on.
10−
11−Be sure to have mounted your home desk so you can easily edit files on it.
12−The first edit that will probably need to be made is in [`app/claz.hoon`](https://github.com/urbit/urbit/blob/85435e9a81e105809d5d381b5d34fae1d4daa3b8/pkg/arvo/app/claz.hoon#L14). The listed url will need to be changed to a valid Ethereum endpoint. infura.io provides an Ethereum API that you can use.
13−
14−The second change that may potentially be needed is to modify the [gas limit](https://github.com/urbit/urbit/blob/85435e9a81e105809d5d381b5d34fae1d4daa3b8/pkg/arvo/app/claz.hoon#L179). This number here is the maximum number of gas units that will be used. In future this will be configurable but for now you may need to change this manually. For a guide to what to set it to you can use the [constants in bridge](https://github.com/urbit/bridge/blob/29f4a14869489481a950a1af53f583d751897444/src/lib/constants.js#L23) as a guide based on what action you are going to be performing. The maximum cost of your transaction will be the maximum gas units multiplied by the gwei you're going to set later. You'll need at least this much in your account.
15−
16−Once you have made these changes be sure to run `|commit %home` to get them into your ship.
7+This document outlines some advanced techniques for generating, signing, and
8+sending Azimuth-related transactions from within Urbit itself. It's strongly
9+discouraged to do this unless you're very confident as Azimuth transactions are
10+permanent and will cost ETH to complete. However, until you upload a signed
11+transaction to the blockchain no transaction will take place so it's safe to
12+explore these tools. It will also be very helpful to have at least a rudimentary
13+understanding of Hoon in order to read and modify parts of the code.
14+
15+These tools are currently only available for layer 1 transactions. Tooling for
16+layer 2 transactions is forthcoming.
17+
18+First you will want to [boot a
19+fakezod](https://urbit.org/using/develop/#creating-a-development-ship). You can
20+do this with your live running ship but at this time this will need you to
21+modify the code so it's best to do this on a ship you can make mistakes on.
22+
23+Be sure to have mounted your home desk so you can easily edit files on it. The
24+first edit that will probably need to be made is in
25+[`app/claz.hoon`](https://github.com/urbit/urbit/blob/85435e9a81e105809d5d381b5d34fae1d4daa3b8/pkg/arvo/app/claz.hoon#L14).
26+The listed url will need to be changed to a valid Ethereum endpoint. infura.io
27+provides an Ethereum API that you can use.
28+
29+The second change that may potentially be needed is to modify the [gas
30+limit](https://github.com/urbit/urbit/blob/85435e9a81e105809d5d381b5d34fae1d4daa3b8/pkg/arvo/app/claz.hoon#L179).
31+This number here is the maximum number of gas units that will be used. In future
32+this will be configurable but for now you may need to change this manually. For
33+a guide to what to set it to you can use the [constants in
34+bridge](https://github.com/urbit/bridge/blob/29f4a14869489481a950a1af53f583d751897444/src/lib/constants.js#L23)
35+as a guide based on what action you are going to be performing. The maximum cost
36+of your transaction will be the maximum gas units multiplied by the gwei you're
37+going to set later. You'll need at least this much in your account.
38+
39+Once you have made these changes be sure to run `|commit %home` to get them into
40+your ship.
1741
1842Next run `|start %claz` after which you'll be able to generate transactions.
1943
@@ -21,27 +45,45 @@ Next run `|start %claz` after which you'll be able to generate transactions.
2145:claz [%generate %/spawn/eth-txs %mainnet author %single %spawn ~ship to]
2246```
2347
24−Here we have an example of generating a transaction to spawn a ship. Something to note is that for this to be successful you'll need to actually have the right to spawn the ship in question. Let's break down the command.
48+Here we have an example of generating a transaction to spawn a ship. Something
49+to note is that for this to be successful you'll need to actually have the right
50+to spawn the ship in question. Let's break down the command.
2551
2652
2753`%generate` is how all commands to `claz` are going to start.
2854
2955`%/spawn/eth-txs` is simply the path for the output file
3056
31−`%mainnet` specifies which network this is going to sent out on. Other options are possible including the test-net `%ropsten`.
57+`%mainnet` specifies which network this is going to sent out on. Other options
58+are possible including the test-net `%ropsten`.
3259
33−`author` here is an Ethereum address that is issuing the transaction. It will need to be written in `@ux` notation, e.g. `0x3b17.d097.d9dd.711e.4ef8.517a.bbf1.8b2b.a643.81fe`.
60+`author` here is an Ethereum address that is issuing the transaction. It will
61+need to be written in `@ux` notation, e.g.
62+`0x3b17.d097.d9dd.711e.4ef8.517a.bbf1.8b2b.a643.81fe`.
3463
35−`%single` specifies what kind of batch that will be created. If you are going to do multiple transactions you will need to either set this to `%more` followed by a _list_ of batches, or generate the next transaction after having submitted the previous one to the blockchain.
64+`%single` specifies what kind of batch that will be created. If you are going to
65+do multiple transactions you will need to either set this to `%more` followed by
66+a _list_ of batches, or generate the next transaction after having submitted the
67+previous one to the blockchain.
3668
37−`[%spawn ~ship to]` is the transaction we want to issue. The arguments are will vary based on the transaction. `~ship` will be the ship to be spawned. `to` is the Ethereum address to spawn the ship to.
69+`[%spawn ~ship to]` is the transaction we want to issue. The arguments are will
70+vary based on the transaction. `~ship` will be the ship to be spawned. `to` is
71+the Ethereum address to spawn the ship to.
3872
39−You will want to read [`/sur/claz.hoon`](https://github.com/urbit/urbit/blob/85435e9a81e105809d5d381b5d34fae1d4daa3b8/pkg/arvo/sur/claz.hoon).
40−This will contain more details about the various kinds of transactions you can perform particularly `++call`
73+You will want to read
74+[`/sur/claz.hoon`](https://github.com/urbit/urbit/blob/85435e9a81e105809d5d381b5d34fae1d4daa3b8/pkg/arvo/sur/claz.hoon).
75+This will contain more details about the various kinds of transactions you can
76+perform particularly `++call`
4177
42−After running this command you should find a csv file at the output path you specified. You can examine this file to learn how they are constructed. You are able to modify the nonces, gas limit and price without changing the functionality of the transaction but it's not important for this guide.
78+After running this command you should find a csv file at the output path you
79+specified. You can examine this file to learn how they are constructed. You are
80+able to modify the nonces, gas limit and price without changing the
81+functionality of the transaction but it's not important for this guide.
4382
44−This file can now be signed and uploaded. At this point, you can transfer this file to an airgapped machine which has your keys, if you want. If you choose to do that you will need to download the `urbit` binary as well as the most recent pill file or a copy of the fakezod pier you have already booted.
83+This file can now be signed and uploaded. At this point, you can transfer this
84+file to an airgapped machine which has your keys, if you want. If you choose to
85+do that you will need to download the `urbit` binary as well as the most recent
86+pill file or a copy of the fakezod pier you have already booted.
4587
4688For this guide, we'll continue on the same ship.
4789
@@ -53,16 +95,31 @@ Run `|start %eth-sender` and then you can use it to sign the transaction file.
5395
5496Let's break this down again.
5597
56−`%sign` is the action we are going to perform here. `eth-sender` can also be used to submit batches of transactions to the network in various ways, but details on that are outside of the scope of this guide.
98+`%sign` is the action we are going to perform here. `eth-sender` can also be
99+used to submit batches of transactions to the network in various ways, but
100+details on that are outside of the scope of this guide.
57101
58102`%/spawn-signed/txt` is the path to the output file.
59103
60−`%/spawn/eth-txs` is the path to the transaction file we generated earlier. It will need to be accessible so don't forget to `|commit %home` if you moved it to a different pier.
104+`%/spawn/eth-txs` is the path to the transaction file we generated earlier. It
105+will need to be accessible so don't forget to `|commit %home` if you moved it to
106+a different pier.
61107
62−`%/mykey/txt` is the path to your private key file. It should contain your private key beginning with 0x and followed by a hex string with no dots, and where capital letters are fine. This file is most likely the reason you will want to use an airgapped machine so that your private key never touches a networked computer. Opsec is left to the reader.
108+`%/mykey/txt` is the path to your private key file. It should contain your
109+private key beginning with 0x and followed by a hex string with no dots, and
110+where capital letters are fine. This file is most likely the reason you will
111+want to use an airgapped machine so that your private key never touches a
112+networked computer. Opsec is left to the reader.
63113
64−`~[40 80]` is a list of gas prices, in gwei; a signed transaction file will be created for each one listed. Here we just specify 40 and 80 gwei. You may want to adjust this list based on current Ethereum network traffic and your time preference for the transactions.
114+`~[40 80]` is a list of gas prices, in gwei; a signed transaction file will be
115+created for each one listed. Here we just specify 40 and 80 gwei. You may want
116+to adjust this list based on current Ethereum network traffic and your time
117+preference for the transactions.
65118
66119Now you should have one file in your pier for each gwei costs.
67120
68−To actually transmit the transaction, paste the contents of one of these files into https://etherscan.io/pushTx or whatever other transmission system you would like to use. **This is the action that will actually cost you ETH and perform the transaction on the network. Only do this step if you want to actually perform the action.**
121+To actually transmit the transaction, paste the contents of one of these files
122+into https://etherscan.io/pushTx or whatever other transmission system you would
123+like to use. **This is the action that will actually cost you ETH and perform
124+the transaction on the network. Only do this step if you want to actually
125+perform the action.**
content/docs/azimuth/azimuth-eth.mdnew file+158
@@ -0,0 +1,158 @@
1++++
2+title = "Azimuth.eth"
3+weight = 5
4+template = "doc.html"
5++++
6+
7+[Azimuth.eth](https://etherscan.io/address/azimuth.eth) is used for storing all
8+data related to Azimuth points and their ownership, and should be considered to
9+be the ledger for Azimuth. This contract is just a data store - it only contains
10+the bare minimum of business logic. See [Ecliptic.eth](/docs/azimuth/ecliptic)
11+for the contract containing the business logic for this ledger. `Azimuth.eth`
12+cannot be modified directly by [galaxy vote](/docs/glossary/upgrade) - they are
13+only eligible to modify the Ecliptic.
14+
15+## Global state {#global}
16+
17+The global state of `Azimuth.eth` is given by the following.
18+
19+```solidity
20+ // points: per point, general network-relevant point state
21+ //
22+ mapping(uint32 => Point) public points;
23+
24+ // rights: per point, on-chain ownership and permissions
25+ //
26+ mapping(uint32 => Deed) public rights;
27+
28+ // operators: per owner, per address, has the right to transfer ownership
29+ // of all the owner's points (ERC721)
30+ //
31+ mapping(address => mapping(address => bool)) public operators;
32+
33+ // dnsDomains: base domains for contacting galaxies
34+ //
35+ // dnsDomains[0] is primary, the others are used as fallbacks
36+ //
37+ string[3] public dnsDomains;
38+```
39+
40+Urbit ID's are formalized as [ERC-721 non-fungible
41+tokens](https://eips.ethereum.org/EIPS/eip-721) and are indexed by a number
42+between `0` and `2^32-1`, e.g. a `uint32`. There are two data structures
43+associated to a given `uint32`: a `Point` and a `Deed`.
44+
45+## `Point`s {#points}
46+
47+A `Point` contains data about networking keys and sponsorship status, arranged
48+in the following `struct`:
49+
50+```solidity
51+ struct Point
52+ {
53+ // encryptionKey: (curve25519) encryption public key, or 0 for none
54+ //
55+ bytes32 encryptionKey;
56+ //
57+ // authenticationKey: (ed25519) authentication public key, or 0 for none
58+ //
59+ bytes32 authenticationKey;
60+ //
61+ // spawned: for stars and galaxies, all :active children
62+ //
63+ uint32[] spawned;
64+ //
65+ // hasSponsor: true if the sponsor still supports the point
66+ //
67+ bool hasSponsor;
68+
69+ // active: whether point can be linked
70+ //
71+ // false: point belongs to prefix, cannot be configured or linked
72+ // true: point no longer belongs to prefix, can be configured and linked
73+ //
74+ bool active;
75+
76+ // escapeRequested: true if the point has requested to change sponsors
77+ //
78+ bool escapeRequested;
79+
80+ // sponsor: the point that supports this one on the network, or,
81+ // if :hasSponsor is false, the last point that supported it.
82+ // (by default, the point's half-width prefix)
83+ //
84+ uint32 sponsor;
85+
86+ // escapeRequestedTo: if :escapeRequested is true, new sponsor requested
87+ //
88+ uint32 escapeRequestedTo;
89+
90+ // cryptoSuiteVersion: version of the crypto suite used for the pubkeys
91+ //
92+ uint32 cryptoSuiteVersion;
93+
94+ // keyRevisionNumber: incremented every time the public keys change
95+ //
96+ uint32 keyRevisionNumber;
97+
98+ // continuityNumber: incremented to indicate network-side state loss
99+ //
100+ uint32 continuityNumber;
101+ }
102+```
103+
104+## `Deed`s {#deeds}
105+
106+A `Deed` says which Ethereum address owns a given `Point` as well as several
107+[proxies](/docs/using/id/proxies) for that `Point`.
108+
109+```solidity
110+struct Deed
111+ {
112+ // owner: address that owns this point
113+ //
114+ address owner;
115+
116+ // managementProxy: 0, or another address with the right to perform
117+ // low-impact, managerial operations on this point
118+ //
119+ address managementProxy;
120+
121+ // spawnProxy: 0, or another address with the right to spawn children
122+ // of this point
123+ //
124+ address spawnProxy;
125+
126+ // votingProxy: 0, or another address with the right to vote as this point
127+ //
128+ address votingProxy;
129+
130+ // transferProxy: 0, or another address with the right to transfer
131+ // ownership of this point
132+ //
133+ address transferProxy;
134+ }
135+```
136+
137+## Other state {#other}
138+
139+Finally, each Ethereum address may set for itself a number of `operators`, as
140+defined and required by the [ERC-721
141+standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-721/).
142+These are for third party brokers/wallets/auctioneers/etc such as
143+[OpenSea](http://opensea.io), which facilitate exchange of ERC-721 tokens.
144+
145+`Azimuth.eth` also contains some other state—`dnsDomains`—which are domain names by
146+which the IP address of a galaxy may be looked up, e.g. `zod.urbit.org` resolves
147+to `35.247.119.159`. This is used for bootstrapping the network from DNS. Three
148+domains may be listed here, but as of today they are all `urbit.org`. This may
149+only be updated by the owner of Ecliptic, but arguably each galaxy ought to be
150+able to set its own domain name and so we do not expect this to remain the case
151+forever.
152+
153+All data in this ledger is stored and processed locally on your ship by the
154+[`%azimuth` Gall agent](/docs/azimuth/flow#azimuth), including [layer
155+2](/docs/azimuth/l2/layer2) data. Because state transitions resulting from layer 2
156+transactions are not included in this ledger, in general the local store will
157+differ from what is kept in `Azimuth.eth`.
158+
content/docs/azimuth/azimuth.md+126−137
@@ -5,145 +5,134 @@ template = "doc.html"
55aliases = ["/docs/learn/azimuth"]
66+++
77
8−Azimuth is a general-purpose public-key infrastructure (PKI) on the Ethereum blockchain, used as a platform for _Urbit identities_. You need such an identity to use the Arvo network.
8+Azimuth is a general-purpose public-key infrastructure (PKI) on the Ethereum
9+blockchain, used as a platform for _Urbit identities_. You need such an identity
10+to use the Arvo network.
911
10−The primary way to interact with Azimuth is through our [Bridge](https://github.com/urbit/bridge) application and the node libraries that it depends on, [azimuth-js](https://github.com/urbit/azimuth-js) and [urbit-key-generation](https://github.com/urbit/urbit-key-generation). Take a look at the source and play around, or see [Getting Started](/getting-started/).
12+The primary way to interact with Azimuth is through
13+[Bridge](https://github.com/urbit/bridge) and the node libraries that it depends
14+on, [azimuth-js](https://github.com/urbit/azimuth-js) and
15+[urbit-key-generation](https://github.com/urbit/urbit-key-generation). Take a
16+look at the source and play around, or see [Getting Started](/getting-started/).
1117
1218## Arvo vs. Azimuth
1319
14−Urbit is a project, not a single computer system. It has multiple components: Arvo, the operating system; and Azimuth, the identity system. Let's compare them.
20+Urbit is a project, not a single computer system. It has multiple components:
21+Arvo, the operating system, and Azimuth, the identity system. Let's compare
22+them.
23+
24+**Arvo** is an operating system that provides the software for a personal
25+server. These personal servers together constitute the peer-to-peer Arvo
26+network. To make this network work on the social level, Arvo is built to work
27+with a system of scarce and immutable identities.
28+
29+**Azimuth** is the public-key infrastructure built to be a system of scarce and
30+immutable identities. It consists of a suite of [smart contracts on the Ethereum
31+blockchain](https://github.com/urbit/azimuth) as well as [several
32+apps](/docs/azimuth/flow) run locally on your urbit. Togeter, they determine
33+which Ethereum addresses own which Urbit ID's as well as the public keys needed
34+to communicate with those ID's. All identity-related operations, such as
35+transfers, are governed by Azimuth. Azimuth isn't built strictly for Arvo -- the
36+smart contracts on Ethereum are sufficient to be used as a generalized identity
37+system for other projects. Azimuth is considered to be the technical
38+nomenclature for the PKI, while Urbit ID is the common nomenclature.
39+
40+These otherwise-parallel systems meet when you want to connect to the Arvo
41+network. Your Arvo personal server, called your _ship_, needs to be able to
42+prove cryptographically that it is who it says it is. This proof comes in the
43+form of a keyfile, derived from your identity, that you use to start your ship.
44+
45+A metaphor might help illustrate the relationship between these two systems: the
46+Arvo network is the neighborhood that you live in; Azimuth is the bank vault
47+that stores the deed to your house.
48+
49+## Smart contracts
50+
51+Azimuth consists of the following smart contracts:
52+
53+ - [Azimuth.eth](https://etherscan.io/address/azimuth.eth)
54+ `0x223c067f8cf28ae173ee5cafea60ca44c335fecb`: contains all on-chain state for
55+ Azimuth. Most notably, ownership and public keys. Can't be modified directly,
56+ you must use the Ecliptic.
57+ - [Ecliptic.eth](https://etherscan.io/address/ecliptic.eth):
58+ `0x9ef27de616154FF8B38893C59522b69c7Ba8A81c ` is used as an interface for
59+ interacting with your points on-chain. Allows you to configure keys, transfer
60+ ownership, etc.
61+ - [Polls](https://etherscan.io/address/0x7fecab617c868bb5996d99d95200d2fa708218e4):
62+ `0x7fecab617c868bb5996d99d95200d2fa708218e4` registers votes by the Galactic
63+ Senate on proposals. These can be either static documents or Ecliptic
64+ upgrades.
65+ - [Linear Star
66+ Release](https://etherscan.io/address/0x86cd9cd0992f04231751e3761de45cecea5d1801):
67+ facilitates the release of blocks of stars to their owners over a period of
68+ time.
69+ - [Conditional Star
70+ Release](https://etherscan.io/address/0x8c241098c3d3498fe1261421633fd57986d74aea):
71+ `0x8c241098c3d3498fe1261421633fd57986d74aea` facilitates the release of
72+ blocks of stars to their owners based on milestones.
73+ - [Claims](https://etherscan.io/address/0xe7e7f69b34d7d9bd8d61fb22c33b22708947971a):
74+ `0xe7e7f69b34d7d9bd8d61fb22c33b22708947971a` allows point owners to make
75+ claims about (for example) their identity, and associate that with their
76+ point.
77+ - [Censures](https://etherscan.io/address/0x325f68d32bdee6ed86e7235ff2480e2a433d6189):
78+ `0x325f68d32bdee6ed86e7235ff2480e2a433d6189` simple reputation management,
79+ allowing galaxies and stars to flag points for negative reputation.
80+ - [Delegated
81+ Sending](https://etherscan.io/address/0xf6b461fe1ad4bd2ce25b23fe0aff2ac19b3dfa76):
82+ enables network-effect like distributing of planets.
83+
84+Walkthroughs of some of the smart contracts are linked to [below](#other).
85+
86+## Naive rollups
87+
88+In 2021, Tlon introduced a new system to Azimuth intended to reduce gas costs
89+for working with Urbit ID and friction associated with using cryptocurrency in
90+general called **naive rollups**, often referred to as **layer 2** or L2. This system
91+allows batches of Azimuth transactions to be submitted together as a single
92+transaction using an Urbit node known as a "roller". The PKI state transitions
93+resulting from these transactions are computed locally by your urbit rather than
94+by the [Ethereum Virtual Machine](https://ethereum.org/en/developers/docs/evm/).
95+
96+Due to the dramatically reduced cost, Tlon offers their own roller that is free
97+for ordinary public use. This enables new users to get started with a permanent
98+Azimuth identity without any prior knowledge of Ethereum, cryptocurrency, or
99+blockchains. However, anybody can run a roller, and even using your own ship as
100+a roller to submit single transactions results in significant savings.
101+
102+A casual overview of the naive rollups system can be found on the
103+[blog](/blog/rollups). Developers are encouraged to read our Layer 2
104+documentation, starting with the [Layer 2 Overview](/docs/azimuth/l2/layer2).
105+
106+## Other resources {#other}
107+
108+### [Urbit HD Wallet](/docs/azimuth/hd-wallet)
109+
110+Azimuth has its own optional hierarchical deterministic wallet system, often
111+referred to as a "master ticket".
112+
113+### [Data Flow](/docs/azimuth/flow)
114+
115+Diagrams and explanations of how data flows between Bridge and the various
116+components inside Urbit involved with Azimuth and L2.
117+
118+### [Azimuth.eth](/docs/azimuth/azimuth-eth)
119+
120+A description of the `azimuth.eth` smart contract, which is the data store for
121+Azimuth.
122+
123+### [Ecliptic.eth](/docs/azimuth/ecliptic)
124+
125+A description of the `ecliptic.eth` smart contract, which is the business logic
126+for `azimuth.eth`. This includes an overview of all function calls available.
127+
128+### [Advanced Azimuth Tools](/docs/azimuth/advanced-azimuth-tools)
129+
130+Expert-level tooling for generating, signing, and sending layer 1 Azimuth
131+transactions from within Urbit itself.
132+
133+### [Life and Rift](/docs/azimuth/azimuth)
134+
135+An explanation of how Azimuth indexes networking keys revisions and breaches to
136+keep track of the most recent set of networking keys necessary to communicate
137+with a ship.
15138
16−**Arvo** is an operating system that provides the software for a personal server. These personal servers together constitute the peer-to-peer Arvo network. To make this network work on the social level, Arvo is built to work with a system of scarce and immutable identities.
17−
18−**Azimuth** is the public-key infrastructure built to be such a system. A suite of smart-contracts on the Ethereum blockchain, Azimuth determines which Ethereum addresses own which Azimuth identities, called _Urbit identities_, or just _identities_. All identity-related operations, such as transfers, are governed at this layer. But Azimuth isn't built strictly for Arvo -- it could be used as a generalized identity system for other projects.
19−
20−These otherwise-parallel systems meet when you want to connect to the Arvo network. Your Arvo personal server, called your _ship_, needs to be able to prove cryptographically that it is who it says it is. This proof comes in the form of a keyfile, derived from your identity, that you use to start your ship.
21−
22−A metaphor might help illustrate the relationship between these two systems: the Arvo network is the neighborhood that you live in; Azimuth is the bank vault that stores the deed to your house.
23−
24−## The Urbit HD Wallet
25−
26−Owners of Urbit identities need safeguards that allow for the use of Urbit without jeopardizing cryptographic ownership of their assets. Toward this end, we created the **Urbit Hierarchical Deterministic (HD) Wallet** for the storage of identities. The Urbit HD Wallet is not one key-pair, but a system of related key-pairs that each have distinct powers, from setting networking keys for communicating in the Arvo network to transferring ownership of identities.
27−
28−The Urbit HD Wallet's derivation paths have a hierarchical structure, so that
29−keys with different powers can be physically separated. A "master ticket" can
30−[re-derive the entire wallet](#hd-wallet-generation) in case of loss. The
31−encryption and authentication keys that identities ships use to sign messages
32−within the network are also derived from the wallet.
33−
34−Another HD wallet option you may wish to utilize to store your Urbit are hardware
35−wallets such as Trezor or Ledger. We compare this method to the Urbit HD wallet
36−[below](#hardware-hd-wallet).
37−
38−Urbit HD wallets are composed of the following items, which are each assigned to their own individual Ethereum key-pairs.
39−
40−### Master Ticket
41−
42−Think of your master ticket like a very high-value password. The master ticket is the secret code from which all of your other keys are derived. Technically, your master ticket is seed entropy. You should never share it with anyone, and store it very securely. This ticket can derive all of your other keys: your ownership key and all of the related proxies.
43−
44−### Ownership Address
45−
46−An ownership address has all rights over the assets deeded to it. These rights are on-chain actions described and implemented in [Ecliptic](/docs/glossary/ecliptic), Azimuth's suite of governing smart-contracts.
47−
48−### Proxies
49−
50−Proxy addresses allow you to execute non-ownership related actions like spawning child identities, voting, and setting networking keys without jeopardizing the keys you've designated with ownership rights. Setting proxy rights is optional, but it is recommended for on-chain actions you will execute more frequently.
51−
52−- **Management Proxy**
53−
54− Can configure or set Arvo networking keys and conduct sponsorship related
55− operations.
56−
57−- **Voting Proxy**
58−
59− Galaxies only. Galaxies are the part of the [Galactic Senate](/docs/glossary/senate), and this means
60− they can cast votes on new proposals including changes to Ecliptic.
61−
62−- **Spawn Proxy**
63−
64− For stars and galaxies only. Can create new child identities.
65−
66−### HD wallet generation
67−
68−Your Urbit HD wallet is generated from a `@q` seed called `T`, which looks
69−something like `~sampel-ticket-bucbel-sipnem`. This is the string known as your
70−"Master Ticket" that you input into Bridge to sign in. This is put through a
71−series of algorithms that ultimately generate your keys and the Ethereum addresses at which they are stored.
72−
73−![](https://media.urbit.org/fora/proposals/UP-8.jpg)
74−
75−First, your `@q` is converted into a numeric value `E` as an intermediary step
76−by adding [salt](<https://en.wikipedia.org/wiki/Salt_(cryptography)>). Then by
77−adding additional salts, `E` is converted into a set of BIP39 seed phrases -
78−these are 24 word mnemonic sequences used to generate Ethereum wallets. You end up
79−with one seed phrase for each proxy associated with your ship, and these seed
80−phrases are then used to generate Ethereum wallets.
81−
82−One of the wallets will store your Azimuth point, an [ERC-721](#erc-721) token,
83−which will be known as your ownership address. Bridge then automatically uses
84−your ownership address to assign the other proxies to the other wallets
85−generated.
86−
87−### ERC-721
88−
89−Most Ethereum tokens use the ERC-20 standard for smart contracts. Urbit identities
90−are, however, essentially different from most Ethereum tokens, due to identities not
91−being fungible. Since any two stars will handle social-networking realities in a
92−different way, they will carry a different reputation.
93−
94−The ERC-721 standard, having been made specifically to provide a smart-contract
95−interface for non-fungible assets, serves our needs well. This is the standard
96−that we use for deeding Urbit identities.
97−
98−Identities, and all of their blockchain operations, are governed by Ecliptic. Ecliptic is an Ethereum smart-contract that governs identity state and the
99−ownership, spawn, management, and voting rights affiliated with your identities.
100−
101−For the technical implementation details, take a look at Azimuth's
102−[Github repository](https://github.com/urbit/azimuth).
103−
104−## Hardware HD wallet
105−
106−You may also store your Urbit using a hardware HD wallet such as a Trezor or
107−Ledger. This option is used instead of a master ticket - it is a totally
108−separate process from that outlined above. How hardware wallets work are
109−outside of the scope of this document, but here we explain how you may utilize
110−your hardware wallet in a similar fashion to the Urbit HD wallet.
111−
112−A hardware HD wallet is generated from a seed phrase that should be thought of
113−as analogous to the `@q` `T` used to generate the Urbit HD wallet in the above
114−diagram. This seed phrase is a human readable sequence of words that may be used
115−to generate private keys to a near-limitless number of wallets created by adding
116−salt. Some hardware
117−wallets also allow an additional passphrase to go into the generation of these
118−wallets. The seed phrase and passphrase should be considered equal in
119−value to the master ticket `T`- never share these with anyone!
120−
121−In order to use your hardware wallet as your Urbit wallet, you first need to
122−generate a set of addresses on which you would like to store your Azimuth point
123−and proxies. Consult your wallet vendor on how to do this. Then login to Bridge
124−using your current method (likely a master ticket) and transfer ownership to the
125−wallet address you generated on your hardware wallet for ownership.
126−
127−Next, login to Bridge using your hardware wallet. While Bridge supports Trezor
128−and Ledger natively, this may require using Metamask as an intermediary anyways,
129−depending on which firmware you are running. Then [accept the
130−transfer](/using/id/using-bridge#accept-your-transfer). Your Azimuth
131−point is now stored on your hardware wallet.
132−
133−To finish the process, use Bridge to set your management, voting, and spawn
134−proxies to the other addresses you generated as applicable. You are now using
135−your hardware HD wallet in an analogous fashion to the Urbit HD wallet.
136−
137−## Heightened security practices
138−
139−A common security pattern is to have "hot" and "cold" wallets. For higher value
140−points such as stars and galaxies, you may consider having your ownership
141−address live on a "cold" wallet that never touches an
142−internet-connected computer, and the various proxies on a "hot" wallet that is
143−permitted to connect to internet-connected devices. This could be accomplished
144−with multiple hardware wallets, a combination of paper and hardware wallet, a
145−hardware cold wallet and Metamask hot wallet, etc.
146−
147−One tool useful for this setup is `claz`, located at `app/claz.hoon`. `claz` is
148−used for making and signing Bridge transactions from an offline computer. A
149−guide to using `claz` is forthcoming.
content/docs/azimuth/ecliptic.mdnew file+436
@@ -0,0 +1,436 @@
1++++
2+title = "Ecliptic.eth"
3+weight = 6
4+template = "doc.html"
5++++
6+
7+[Ecliptic.eth](https://etherscan.io/address/ecliptic.eth) holds the business
8+logic for the ledger kept by `Azimuth.eth`. It may be modified by [galaxy
9+vote](/docs/glossary/upgrade). This determines things such as what the various
10+proxies are capable of, how keys are changed, or verifying that a request is
11+valid.
12+
13+`Ecliptic.eth` uses external contracts such as
14+[Azimuth.eth](/docs/azimuth/azimuth-eth) and
15+[Polls](https://github.com/urbit/azimuth/blob/master/contracts/Polls.sol) for
16+data storage so that it can easily be replaced in case the logic needs to be
17+changed without affecting the data. These data contracts are owned by
18+`Ecliptic.eth`, and this ownership is passed to the new Ecliptic contract
19+whenever it is replaced. Thus it is advised for clients to not store Ecliptic's
20+contract address directly, but instead ask the `Azimuth.eth` contract for its
21+`owner` attribute to ensure that transactions are sent to the latest Ecliptic
22+contract. Alternatively, the [ENS](https://ens.domains/) name `Ecliptic.eth`
23+will always resolve to the latest Ecliptic.
24+
25+You can read about [Urbit's first
26+upgrade](https://github.com/urbit/azimuth/pull/35) to Ecliptic, which occurred
27+in the summer of 2021, [here](https://urbit.org/blog/first-contract). The
28+[second](https://github.com/urbit/azimuth/pull/43) occurred later in the year
29+and consisted of several small modifications to ready the PKI for the
30+introduction of [naive rollups](/docs/azimuth/l2/layer2).
31+
32+`Ecliptic.eth` implements the [ERC-721](https://eips.ethereum.org/EIPS/eip-721)
33+interface for non-fungible tokens, as well as the
34+[ERC-165](https://eips.ethereum.org/EIPS/eip-165) standard for interface
35+detection.
36+
37+There are currently [28 functions](#write) which may be called to write to
38+the Ecliptic, and [17 functions](#read) to read data from the Ecliptic. Many of these
39+have a corresponding [layer 2 action](/docs/azimuth/l2/l2-actions), and/or can be
40+performed using [Bridge](/using/id/using-bridge). We note these facts where
41+applicable.
42+
43+## Write functions {#write}
44+
45+Here we briefly describe each function in `Ecliptic.eth` which allows one to write
46+data to Ethereum. These can be called using
47+[Etherscan](https://etherscan.io/address/ecliptic.eth#writeContract), but
48+the most common functions may be called from within Bridge.
49+
50+We only document here the write functions specific to `Ecliptic.eth` and not the
51+standard functions that are part of the ERC-721 or ERC-165 interfaces.
52+
53+### `Point`s interface
54+
55+These functions are available to each owner of a
56+[`Point`](/docs/azimuth/azimuth-eth#points), and a subset of them are available
57+to its [proxies](#proxies). All of these actions may be performed from Bridge.
58+
59+#### `configureKeys`
60+
61+```solidity
62+ function configureKeys(uint32 _point,
63+ bytes32 _encryptionKey,
64+ bytes32 _authenticationKey,
65+ uint32 _cryptoSuiteVersion,
66+ bool _discontinuous)
67+```
68+
69+Configure `_point` with network public keys `_encryptionKey`,
70+`_authenticationKey`, and corresponding `_cryptoSuiteVersion`, incrementing the
71+`Point`'s [`keyRevisionNumber`](/docs/azimuth/azimuth-eth#points) if the keys
72+have changed and `continuityNumber` number if `_discontinuous` is set to true
73+(see [Life and Rift](/docs/azimuth/life-and-rift)).
74+
75+Corresponds to the layer 2 `%configure-keys` action.
76+
77+#### `spawn`
78+
79+```solidity
80+ function spawn(uint32 _point, address _target)
81+```
82+
83+Spawn `_point`, then either give, or allow `_target` to take, ownership of `_point`.
84+
85+If `_target` is the `:msg.sender`, `_target` owns the `_point` right away.
86+otherwise, `_target` becomes the transfer proxy of `_point`.
87+
88+Requirements:
89+ - `_point` must not be active
90+ - `_point` must not be a planet with a galaxy prefix
91+ - `_point`'s prefix must be linked and under its spawn limit
92+ - `:msg.sender` must be either the owner of `_point`'s prefix, or an authorized spawn proxy for it
93+
94+Corresponds to the layer 2 `%spawn` action.
95+
96+#### `transferPoint`
97+
98+```solidity
99+ function transferPoint(uint32 _point, address _target, bool _reset)
100+```
101+
102+Transfer `_point` to `_target`, clearing all permissions data and keys if
103+`_reset` is true. `_reset` set to makes this transaction a
104+[breach](/using/id/guide-to-breaches), and thus this action increments the
105+[`continuityNumber`](/docs/azimuth/azimuth-eth#points) of `_point`, and usually
106+the `keyRevisionNumber` as well (see [Life and
107+Rift](/docs/azimuth/life-and-rift)).
108+
109+Requirements:
110+ - `:msg.sender` must be either `_point`'s current owner, authorized to transfer
111+ `_point`, or authorized to transfer the current owner's points (i.e. is
112+ listed as an ERC-721 operator in [`operators`](/docs/azimuth/azimuth-eth#other)).
113+ - `_target` must not be the zero address.
114+
115+Corresponds to the layer 2 `%transfer-point` action.
116+
117+#### `escape`
118+
119+```solidity
120+ function escape(uint32 _point, uint32 _sponsor)
121+```
122+
123+Request escape as `_point` to `_sponsor`.
124+
125+If an escape request is already active, this overwrites the existing request.
126+
127+Requirements:
128+ - `:msg.sender` must be the owner or manager of `_point`,
129+ - `_point` must be able to escape to `_sponsor` as per to `canEscapeTo()`
130+
131+ Corresponds to the layer 2 `%escape` action.
132+
133+#### `cancelEscape`
134+
135+```solidity
136+ function cancelEscape(uint32 _point)
137+```
138+
139+Cancel the currently set escape for `_point`.
140+
141+Corresponds to the layer 2 `%cancel-escape` action.
142+
143+#### `adopt`
144+
145+```solidity
146+ function adopt(uint32 _point)
147+```
148+
149+As the relevant sponsor, accept the `_point`.
150+
151+Requirements:
152+ - `:msg.sender` must be the owner or management proxy
153+ of `_point`'s requested sponsor
154+
155+Corresponds to the layer 2 `%adopt` action.
156+
157+#### `reject`
158+
159+```solidity
160+ function reject(uint32 _point)
161+```
162+
163+As the relevant sponsor, deny the `_point`'s `adopt` request.
164+
165+Requirements:
166+ - `:msg.sender` must be the owner or management proxy
167+ of `_point`'s requested sponsor
168+
169+Corresponds to the layer 2 `%reject` action.
170+
171+#### `detach`
172+
173+```solidity
174+ function detach(uint32 _point)
175+```
176+
177+As the `_sponsor`, stop sponsoring the `_point`.
178+
179+Requirements:
180+ - `:msg.sender` must be the owner or management proxy
181+ of `_point`'s current sponsor
182+
183+Corresponds to the layer 2 `%detach` action.
184+
185+Unlike all other layer 1 actions, layer 1 sponsors may use a layer 1 `detach` on
186+a layer 2 sponsee. See the [Layer 2](/docs/azimuth/l2/layer2#sponsorship)
187+section for more detail. The detach action available in Bridge is a layer 2
188+action, so a layer 1 detach must be done
189+[manually](https://etherscan.io/address/ecliptic.eth#writeContract).
190+
191+### Proxy management {#proxies}
192+
193+These functions are used to manage the various
194+[proxies](/docs/using/id/proxies). All of these actions may be performed from Bridge.
195+
196+#### `setManagementProxy`
197+
198+```solidity
199+ function setManagementProxy(uint32 _point, address _manager)
200+```
201+
202+Configure the management proxy for `_point`.
203+
204+The management proxy may perform "reversible" operations on
205+behalf of the owner. This includes public key configuration and
206+operations relating to sponsorship.
207+
208+Requirements:
209+ - `:msg.sender` must be either `_point`'s current owner or the management proxy.
210+
211+Corresponds to the layer 2 `%set-management-proxy` action.
212+
213+#### `setSpawnProxy`
214+
215+```solidity
216+ function setSpawnProxy(uint16 _prefix, address _spawnProxy)
217+```
218+
219+Give `_spawnProxy` the right to spawn points with the prefix `_prefix` using the
220+`spawn` function.
221+
222+Requirements:
223+ - `:msg.sender` must be either `_point`'s current owner or the spawn proxy.
224+
225+Corresponds to the layer 2 `%set-spawn-proxy` action.
226+
227+#### `setVotingProxy`
228+
229+```solidity
230+ function setVotingProxy(uint8 _galaxy, address _voter)
231+```
232+
233+Configure the voting proxy for `_galaxy`.
234+
235+The voting proxy is allowed to start polls and cast votes on the point's behalf.
236+
237+Requirements:
238+ - `:msg.sender` must be either `_point`'s current owner or the voting proxy.
239+
240+There is no corresponding layer 2 action since voting must occur on layer 1.
241+
242+#### `setTransferProxy`
243+
244+```solidity
245+ function setTransferProxy(uint32 _point, address _transferProxy)
246+```
247+
248+Give `_transferProxy` the right to transfer `_point`.
249+
250+Requirements:
251+ - `:msg.sender` must be either `_point`'s current owner, an operator for the
252+ current owner, or the transfer proxy.
253+
254+Corresponds to the layer 2 `%set-transfer-proxy` action.
255+
256+### Poll actions
257+
258+Most of these are functions only available to galaxies. They are related to
259+[voting](/docs/glossary/voting). As voting does not occur on layer 2, there are
260+no corresponding layer 2 actions for poll actions.
261+
262+Upgrade and document polls last for 30 days, or once a majority is achieved,
263+whichever comes first. If a majority (129) of yes or no votes is achieved, the
264+final vote cast in favor of the winning option also triggers `updateUpgradePoll`
265+or `updateDocumentPoll` as appropriate. Otherwise, if a quorum of 64 votes is
266+achieved, with a majority voting for yes, and the 30 day voting period has
267+expired, then _any_ Ethereum address may call `updateUpgradePoll` or
268+`updateDocumentPoll` as appropriate.
269+
270+#### `startUpgradePoll`
271+
272+```solidity
273+ function startUpgradePoll(uint8 _galaxy, EclipticBase _proposal)
274+```
275+
276+As `_galaxy`, start a poll for the Ecliptic upgrade `_proposal`.
277+
278+Requirements:
279+ - `:msg.sender` must be the owner or voting proxy of `_galaxy`,
280+ - the `_proposal` must expect to be upgraded from this specific
281+ contract, as indicated by its `previousEcliptic` attribute.
282+
283+This action must be performed manually - it is not available in Bridge.
284+
285+#### `startDocumentPoll`
286+
287+```solidity
288+ function startDocumentPoll(uint8 _galaxy, bytes32 _proposal)
289+```
290+
291+As `_galaxy`, start a poll for the `_proposal`. Document polls last for 30 days,
292+or once a majority is achieved, whichever comes first.
293+
294+The `_proposal` argument is the keccak-256 hash of any arbitrary
295+document or string of text.
296+
297+This action must be performed manually - it is not available in Bridge.
298+
299+#### `castUpgradeVote`
300+
301+```solidity
302+ function castUpgradeVote(uint8 _galaxy,
303+ EclipticBase _proposal,
304+ bool _vote)
305+```
306+
307+As `_galaxy`, cast a `_vote` on the Ecliptic upgrade `_proposal`.
308+
309+`_vote` is true when in favor of the proposal, false otherwise.
310+
311+This action may be performed from Bridge.
312+
313+#### `castDocumentVote`
314+
315+```solidity
316+ function castDocumentVote(uint8 _galaxy, bytes32 _proposal, bool _vote)
317+```
318+
319+As `_galaxy`, cast a `_vote` on the `_proposal`.
320+
321+`_vote` is true when in favor of the proposal, false otherwise.
322+
323+This action may be performed from Bridge.
324+
325+#### `updateUpgradePoll`
326+
327+```solidity
328+ function updateUpgradePoll(EclipticBase _proposal)
329+```
330+
331+Check whether the `_proposal` has achieved majority, upgrading to it if it has.
332+Any Ethereum address may call this function.
333+
334+This action eiher occurs as part of a vote that achieves a majority, or must be
335+performed manually. It is not available in Bridge.
336+
337+#### `updateDocumentPoll`
338+
339+```solidity
340+ function updateDocumentPoll(bytes32 _proposal)
341+```
342+
343+Check whether the `_proposal` has achieved majority. Any Ethereum address may
344+call this function.
345+
346+This action eiher occurs as part of a vote that achieves a majority, or must be
347+performed manually. It is not available in Bridge.
348+
349+### Contract owner operations
350+
351+The following functions may only be performed by the owner of the contract.
352+There are only two such functions, one of which is to spawn galaxies. As all
353+galaxies have already been spawned, it is no longer of any use. Thus only
354+`setDnsDomains` is relevant today.
355+
356+#### `createGalaxy`
357+
358+```solidity
359+ function createGalaxy(uint8 _galaxy, address _target)
360+```
361+
362+Grant `_target` ownership of the `_galaxy` and register it for voting. Galaxies
363+are given by a `uint8`, and since all 256 galaxies have already been spawned,
364+this function has no valid arguments.
365+
366+#### `setDnsDomains`
367+
368+```solidity
369+ function setDnsDomains(string _primary, string _secondary, string _tertiary)
370+```
371+
372+Sets 3 DNS domains by which galaxy IP addresses may be looked up as part of the
373+bootstrap process to get on the network. Currently, all three domains are `urbit.org`.
374+
375+## Read functions {#read}
376+
377+Here we briefly describe each function in the Ecliptic which allows one to read
378+data from the contract. These can be called using
379+[Etherscan](https://etherscan.io/address/ecliptic.eth#readContract).
380+
381+We only document here the read functions specific to Ecliptic and not the
382+standard functions that are part of the ERC-721 or ERC-165 interfaces.
383+
384+#### `depositAddress`
385+
386+This returns the deposit address for [layer 2](/docs/azimuth/l2/layer2), which is
387+`0x1111111111111111111111111111111111111111`. Ships sent to this address are
388+controlled on layer 2 instead of via Ecliptic.
389+
390+#### `canEscapeTo`
391+
392+```solidity
393+ function canEscapeTo(uint32 _point, uint32 _sponsor)
394+```
395+
396+Returns a `bool` that is true if `_point` could try to escape to `_sponsor`.
397+
398+#### `azimuth`
399+
400+Returns the address of the [Azimuth.eth](/docs/azimuth/azimuth-eth) contract: `0x223c067f8cf28ae173ee5cafea60ca44c335fecb`.
401+
402+#### `claims`
403+
404+Returns the address of the
405+[Claims](https://etherscan.io/address/0xe7e7f69b34d7d9bd8d61fb22c33b22708947971a)
406+contract: `0x1df4ea30e0b1359c9692a161c5f30cd1a6b64ebf`.
407+
408+#### `polls`
409+
410+Returns the address of the
411+[Polls](https://etherscan.io/address/0x7fecab617c868bb5996d99d95200d2fa708218e4)
412+contract: `0x7fecab617c868bb5996d99d95200d2fa708218e4`.
413+
414+#### `previousEcliptic`
415+
416+Returns the address of the previous Ecliptic address.
417+
418+#### `getSpawnLimit`
419+
420+```solidity
421+ function getSpawnLimit(uint32 _point, uint256 _time)
422+```
423+
424+Returns a `uint32` that is the total number of children the `_point` is allowed
425+to spawn at `_time`.
426+
427+There is no limit for galaxies. Instead, for most galaxies, all stars have
428+already been spawned and placed into one of the lockup contracts: [Linear Star
429+Release](https://etherscan.io/address/0x86cd9cd0992f04231751e3761de45cecea5d1801)
430+and [Conditional Star
431+Release](https://etherscan.io/address/0x8c241098c3d3498fe1261421633fd57986d74aea).
432+
433+Beginning in 2019, stars may spawn at most 1024 planets. This limit doubles
434+every subsequent year until the maximum is reached. However, this limit is not
435+currently implemented on [Layer 2](/docs/azimuth/l2/layer2).
436+
content/docs/azimuth/flow.mdnew file+232
@@ -0,0 +1,232 @@
1++++
2+title = "Azimuth Data Flow"
3+weight = 4
4+template = "doc.html"
5++++
6+
7+This document summarizes the various components involved with Azimuth and
8+how they communicate with each other. This also constitutes an explanation for
9+how Urbit implements the data flow of naive rollups.
10+
11+## Bridge
12+
13+The primary way in which users interact with Azimuth is via
14+[Bridge](https://bridge.urbit.org). Bridge is responsible for collecting
15+transactions from users, signing them, and forwarding them to a roller via an
16+HTTP API.
17+
18+## Azimuth
19+
20+Azimuth was originally defined as a set of smart contracts on Ethereum that
21+defines the [state](/docs/azimuth/azimuth-eth) and [business
22+logic](/docs/azimuth/ecliptic) of the PKI for layer 1. With the introduction of
23+naive rollups, this has also come to include the set of components used for
24+dealing with the PKI within Urbit, as now the complete PKI state is stored
25+offchain (though this state is derived entirely from on-chain data). The
26+following sections outline what each component is responsible for and how it
27+communicates with the others.
28+
29+The Gall agents involved with Azimuth are summarized as follows:
30+ - [`%azimuth`](#azimuth) - obtains and holds PKI state.
31+ - [`%azimuth-rpc`](#azimuth-rpc) - JSON RPC-API for `%azimuth`.
32+ - [`%eth-watcher`](#eth-watcher) - Ethereum event log collector.
33+ - [`%roller`](#roller) - submits batches of L2 transactions to Ethereum.
34+ - [`%roller-rpc`](#roller-rpc) - JSON RPC-API for `%roller`.
35+
36+The transaction processing library is [`/lib/naive.hoon`](#naive).
37+
38+### Gall agents
39+
40+#### `%azimuth` {#azimuth}
41+
42+`%azimuth`, located at `/app/azimuth.hoon`, is a Gall agent and thread handler
43+responsible for finding Azimuth transactions gathered by `%eth-watcher`,
44+keeping track of the PKI state, and exposing that data via scries.
45+
46+The following diagram illustrates `%azimuth`'s and `%eth-watcher`'s role in the system.
47+
48+![Azimuth components](https://media.urbit.org/docs/layer2/l2-azimuth-azimuth.svg)
49+
50+The state held by `%azimuth` is the following.
51+
52+```hoon
53+++ app-state
54+ $: %3
55+ url=@ta
56+ whos=(set ship)
57+ nas=^state:naive
58+ own=owners
59+ logs=(list =event-log:rpc:ethereum)
60+ ==
61+```
62+
63+`whos` is the set of ships currently known by Azimuth. `nas` is the PKI state,
64+as defined in [`naive.hoon`](#naive). `own` is a `jug` of Ethereum addresses and
65+the set of ships owned by that address. `logs` is a list of all Azimuth-related
66+Ethereum event logs known by the ship.
67+
68+Scries can be inferred from the `+on-peek` arm:
69+
70+```hoon
71+++ on-peek
72+ |= =path
73+ ^- (unit (unit cage))
74+ ?+ path (on-peek:def path)
75+ [%x %logs ~] ``noun+!>(logs.state)
76+ [%x %nas ~] ``noun+!>(nas.state)
77+ [%x %dns ~] ``noun+!>(dns.nas.state)
78+ [%x %own ~] ``noun+!>(own.state)
79+ ==
80+```
81+
82+#### `%azimuth-rpc` {#azimuth-rpc}
83+
84+`%azimuth-rpc`, located at `app/azimuth-rpc.hoon`, is a JSON RPC-API for getting
85+`point` and `dns` data from the Azimuth PKI state kept by `%azimuth`.
86+
87+#### `%eth-watcher` {#eth-watcher}
88+
89+`%eth-watcher`, located at `/app/eth-watcher.hoon`, is responsible for listening
90+to an Ethereum node and collecting event logs from it. It is general-purpose and
91+not particular to Azimuth. It sends collected transactions to `+on-agent` in
92+`%azimuth`, which then obtains the resulting PKI state transitions by passing them to
93+[`naive.hoon`](#naive).
94+
95+[![Eth-watcher](https://media.urbit.org/docs/layer2/roller-agents.png)](https://media.urbit.org/docs/layer2/roller-agents.png)
96+
97+#### `%roller` {#roller}
98+
99+`%roller`, stored at `/app/roller.hoon`, is a Gall agent responsible for
100+collecting and submitting batches of layer 2 transactions to the Ethereum
101+blockchain. Among other things, it keeps
102+track of a list of pending transactions to be sent, transactions it has sent
103+that are awaiting confirmation, history of transactions sent organized by
104+Ethereum address, and when the next batch of transactions will be sent. See also
105+[Rollers](/docs/azimuth/l2/roller) for more information on the roller.
106+
107+The following diagram illustrates how the roller interacts with Bridge and
108+Ethereum at a high level.
109+
110+[![High level overview](https://media.urbit.org/docs/layer2/l2-high.png)](https://media.urbit.org/docs/layer2/l2-high.png)
111+
112+The relationship between the roller and other agents is outlined in the
113+following diagram.
114+
115+[![Roller](https://media.urbit.org/docs/layer2/roller-agents.png)](https://media.urbit.org/docs/layer2/roller-agents.png)
116+
117+`%roller` has a number of scries available, intended primarily to
118+display data to the end user in Bridge. They can be inferred from the `+on-peek`
119+arm:
120+
121+```hoon
122+ ++ on-peek
123+ |= =path
124+ ^- (unit (unit cage))
125+ |^
126+ ?+ path ~
127+ [%x %pending ~] ``noun+!>(pending)
128+ [%x %pending @ ~] (pending-by i.t.t.path)
129+ [%x %tx @ %status ~] (status i.t.t.path)
130+ [%x %history @ ~] (history i.t.t.path)
131+ [%x %nonce @ @ ~] (nonce i.t.t.path i.t.t.t.path)
132+ [%x %spawned @ ~] (spawned i.t.t.path)
133+ [%x %next-batch ~] ``atom+!>(next-batch)
134+ [%x %point @ ~] (point i.t.t.path)
135+ [%x %points @ ~] (points i.t.t.path)
136+ [%x %config ~] config
137+ [%x %chain-id ~] ``atom+!>(chain-id)
138+ ==
139+```
140+
141+This app is not responsible for communicating with Bridge via HTTP. Instead, that is
142+handled by `%roller-rpc`. The scries are also communicated to Bridge via
143+`%roller-rpc`.
144+
145+#### `%roller-rpc`
146+
147+`%roller-rpc`, stored at `/app/roller-rpc.hoon`, is a very simple Gall app responsible for receiving HTTP RPC-API
148+calls, typically sent from other Urbit ID users via Bridge. It then translates
149+these API calls from JSON to a format understood by `%roller` and
150+forwards them to `%roller`. This app
151+does not keep any state - its only purpose is to act as an intermediary between
152+Bridge and `%roller`. See [here](/docs/azimuth/l2/layer2-api) for more
153+information on the JSON RPC-API.
154+
155+### `naive.hoon` {#naive}
156+
157+`/lib/naive.hoon` consists of a gate whose sample is a `verifier`, `chain-id=@ud`,
158+`state`, and `input`, which outputs a cell of `[effects state]`. This is the
159+transition function which updates the state of the PKI stored in `%azimuth`
160+which handles state transitions caused by both layer 1 and layer 2 transactions.
161+A high-level overview of how `naive.hoon` functions can be found
162+[here](/docs/azimuth/l2/layer2#layer-2).
163+
164+A `verifier` is a gate whose sample is of the form `[dat=octs v=@ r=@ s=@]` and
165+which returns `(unit address)`:
166+
167+```hoon
168++$ verifier $-([dat=octs v=@ r=@ s=@] (unit address))
169+```
170+
171+The `verifier` in use by `naive.hoon` runs the keccak hash function on `dat` to
172+verify that `dat` is data signed by the ECDSA signature given by the `[v r s]`
173+tuple, according to the format for signed transactions outlined in the
174+[bytestring format](/docs/azimuth/l2/bytestring) documentation.
175+
176+`chain-id` is the ID used by the Ethereum blockchain, which is `1337`. See [bytestring
177+format](/docs/azimuth/l2/bytestring) for more information. This is used so that
178+e.g. transactions on the Ropsten test network cannot be replayed on the mainnet.
179+
180+`state` is the current state of the PKI. This is structured similarly to the
181+state held in [Azimuth.eth](/docs/azimuth/azimuth-eth), but will differ in
182+general since `state` takes into account layer 2 transactions as well. See the
183+[Layer 2 Overview](/docs/azimuth/l2/layer2#state) for more on how PKI state is handled.
184+
185+```hoon
186++$ state
187+ $: =points
188+ =operators
189+ dns=(list @t)
190+ ==
191++$ points (tree [ship point])
192+++ point
193+ $: :: domain
194+ ::
195+ =dominion
196+ ::
197+ :: ownership
198+ ::
199+ $= own
200+ $: owner=[=address =nonce]
201+ spawn-proxy=[=address =nonce]
202+ management-proxy=[=address =nonce]
203+ voting-proxy=[=address =nonce]
204+ transfer-proxy=[=address =nonce]
205+ ==
206+ ::
207+ :: networking
208+ ::
209+ $= net
210+ $: rift=@ud
211+ =keys
212+ sponsor=[has=? who=@p]
213+ escape=(unit @p)
214+ ==
215+ ==
216++$ dominion ?(%l1 %l2 %spawn)
217++$ operators (jug address address)
218+```
219+
220+`points` should be self-explanatory if you are already familiar with the
221+structure of [Azimuth.eth](/docs/azimuth/azimuth-eth). The only new addition is
222+`dominion`, whose value says
223+whether a ship is on layer 1, layer 2, or layer 1 with a layer 2 spawn proxy.
224+See [Layer 2 actions](/docs/azimuth/l2/l2-actions) for an overview of how
225+`dominion` determines the PKI actions available to a ship.
226+
227+`operators` already existed on layer 1 and are defined as a part of the [ERC-721
228+standard](https://eips.ethereum.org/EIPS/eip-721).
229+
230+`dns` is a list of DNS entries by which galaxy IP addresses may be looked up. At
231+present, this is always `~['urbit.org' 'urbit.org' 'urbit.org']`.
232+
content/docs/azimuth/hd-wallet.mdnew file+137
@@ -0,0 +1,137 @@
1++++
2+title = "Urbit HD Wallet"
3+weight = 3
4+template = "doc.html"
5++++
6+
7+Owners of Urbit identities need safeguards that allow for the use of Urbit
8+without jeopardizing cryptographic ownership of their assets. Toward this end,
9+we created the **Urbit Hierarchical Deterministic (HD) Wallet** for the storage
10+of identities. The Urbit HD Wallet is not one key-pair, but a system of related
11+key-pairs that each have distinct powers, from setting networking keys for
12+communicating in the Arvo network to transferring ownership of identities.
13+
14+The Urbit HD Wallet's derivation paths have a hierarchical structure, so that
15+keys with different powers can be physically separated. A "master ticket" can
16+[re-derive the entire wallet](#hd-wallet-generation) in case of loss. The
17+encryption and authentication keys that identities ships use to sign messages
18+within the network are also derived from the wallet.
19+
20+Another HD wallet option you may wish to utilize to store your Urbit are
21+hardware wallets such as Trezor or Ledger. We compare this method to the Urbit
22+HD wallet [below](#hardware-hd-wallet).
23+
24+Urbit HD wallets are composed of the following items, which are each assigned to
25+their own individual Ethereum key-pairs.
26+
27+### Master Ticket
28+
29+Think of your master ticket like a very high-value password. The master ticket
30+is the secret code from which all of your other keys are derived. Technically,
31+your master ticket is a cryptographic seed. You should never share it with anyone, and
32+store it very securely. This ticket can derive all of your other keys: your
33+ownership key and all of the related proxies.
34+
35+### Ownership Address
36+
37+An ownership address has all rights over the assets deeded to it. These rights
38+are on-chain actions described and implemented in
39+[Ecliptic](/docs/glossary/ecliptic), Azimuth's suite of governing
40+smart-contracts.
41+
42+### Proxies
43+
44+Each permanent Urbit ID can designate one or more
45+[proxies](/docs/using/id/proxies), which are Ethereum addresses capable of a
46+limited subset of Urbit ID transactions, such as spawning planets or rotating
47+keys. The HD wallet automatically generates additional addresses utilized as
48+proxies according to what is appropriate for your Urbit ID.
49+
50+### HD wallet generation
51+
52+Your Urbit HD wallet is generated from a `@q` seed called `T`, which looks
53+something like `~sampel-ticket-bucbel-sipnem`. This is the string known as your
54+"Master Ticket" that you input into Bridge to sign in. This is put through a
55+series of algorithms that ultimately generate your keys and the Ethereum
56+addresses at which they are stored.
57+
58+![](https://media.urbit.org/fora/proposals/UP-8.jpg)
59+
60+First, your `@q` is converted into a numeric value `E` as an intermediary step
61+by adding [salt](<https://en.wikipedia.org/wiki/Salt_(cryptography)>). Then by
62+adding additional salts, `E` is converted into a set of BIP39 seed phrases -
63+these are 24 word mnemonic sequences used to generate Ethereum wallets. You end
64+up with one seed phrase for each proxy associated with your ship, and these seed
65+phrases are then used to generate Ethereum wallets.
66+
67+One of the wallets will store your Azimuth point, an [ERC-721](#erc-721) token,
68+which will be known as your ownership address. Bridge then automatically uses
69+your ownership address to assign the other proxies to the other wallets
70+generated.
71+
72+### ERC-721
73+
74+Most Ethereum tokens use the ERC-20 standard for smart contracts. Urbit
75+identities are, however, essentially different from most Ethereum tokens, due to
76+identities not being fungible. Since any two stars will handle social-networking
77+realities in a different way, they will carry a different reputation.
78+
79+The ERC-721 standard, having been made specifically to provide a smart-contract
80+interface for non-fungible assets, serves our needs well. This is the standard
81+that we use for deeding Urbit identities.
82+
83+Identities, and all of their blockchain operations, are governed by Ecliptic.
84+Ecliptic is an Ethereum smart-contract that governs identity state and the
85+ownership, spawn, management, and voting rights affiliated with your identities.
86+
87+For the technical implementation details, take a look at Azimuth's [Github
88+repository](https://github.com/urbit/azimuth).
89+
90+## Hardware HD wallet
91+
92+You may also store your Urbit using a hardware HD wallet such as a Trezor or
93+Ledger. This option is used instead of a master ticket - it is a totally
94+separate process from that outlined above. How hardware wallets work are outside
95+of the scope of this document, but here we explain how you may utilize your
96+hardware wallet in a similar fashion to the Urbit HD wallet.
97+
98+A hardware HD wallet is generated from a seed phrase that should be thought of
99+as analogous to the `@q` `T` used to generate the Urbit HD wallet in the above
100+diagram. This seed phrase is a human readable sequence of words that may be used
101+to generate private keys to a near-limitless number of wallets created by adding
102+salt. Some hardware wallets also allow an additional passphrase to go into the
103+generation of these wallets. The seed phrase and passphrase should be considered
104+equal in value to the master ticket `T`- never share these with anyone!
105+
106+In order to use your hardware wallet as your Urbit wallet, you first need to
107+generate a set of addresses on which you would like to store your Azimuth point
108+and proxies. Consult your wallet vendor on how to do this. Then login to Bridge
109+using your current method (likely a master ticket) and transfer ownership to the
110+wallet address you generated on your hardware wallet for ownership.
111+
112+Next, login to Bridge using your hardware wallet. While Bridge supports Trezor
113+and Ledger natively, this may require using Metamask as an intermediary anyways,
114+depending on which firmware you are running. Then [accept the
115+transfer](/using/id/using-bridge#accept-your-transfer). Your Azimuth point is
116+now stored on your hardware wallet.
117+
118+To finish the process, use Bridge to set your management, voting, and spawn
119+proxies to the other addresses you generated as applicable. You are now using
120+your hardware HD wallet in an analogous fashion to the Urbit HD wallet.
121+
122+## Heightened security practices
123+
124+A common security pattern is to have "hot" and "cold" wallets. For higher value
125+points such as stars and galaxies, you may consider having your ownership
126+address live on a "cold" wallet that never touches an internet-connected
127+computer, and the various proxies on a "hot" wallet that is permitted to connect
128+to internet-connected devices. This could be accomplished with multiple hardware
129+wallets, a combination of paper and hardware wallet, a hardware cold wallet and
130+Metamask hot wallet, etc. See the [User Manual](/using/id/hd-wallet) for
131+concrete suggestions on security practices.
132+
133+One tool useful for this setup is `claz`, located at `app/claz.hoon`. `claz` is
134+used for making and signing Bridge transactions from an offline computer. A
135+guide to using `claz` is available [here](/docs/azimuth/advanced-azimuth-tools).
136+
137+
content/docs/azimuth/l2/_index.mdnew file+35
@@ -0,0 +1,35 @@
1++++
2+title = "Layer 2"
3+weight = 800
4+sort_by = "weight"
5+template = "sections/docs/chapters.html"
6+insert_anchor_links = "right"
7++++
8+
9+Documentation of the technical details of naive rollups, our Layer 2 solution
10+for the reduction of Urbit ID gas prices and friction associated with the usage
11+of cryptocurrency.
12+
13+### [Layer 2 Overview](/docs/azimuth/l2/layer-2)
14+
15+A high-level technical description of the functionality of the naive rollups
16+"Hoon smart contract" and associated apps, such as Bridge and the roller.
17+
18+### [Layer 2 Actions](/docs/azimuth/l2/l2-actions)
19+
20+An exhaustive list of what Azimuth actions can be performed for any given tuple
21+`(ship rank, layer 2 status)`.
22+
23+### [Transaction Format](/docs/azimuth/l2/bytestring)
24+
25+The bytestring format for layer 2 transactions and batches.
26+
27+### [Rollers](/docs/azimuth/l2/roller)
28+
29+How rollers work.
30+
31+### [Roller HTTP RPC API](/docs/azimuth/l2/layer2-api)
32+
33+Documentation on the HTTP RPC API used for Urbit to communicate with Bridge to
34+manage layer 2 transactions.
35+
content/docs/azimuth/l2/bytestring.mdnew file+201
@@ -0,0 +1,201 @@
1++++
2+title = "Transaction Format"
3+weight = 8
4+template = "doc.html"
5++++
6+
7+This document gives the bytestring format for layer 2 transactions and batches.
8+
9+[Recall](/docs/azimuth/l2/layer2.md) that a layer 2 transaction is a compact
10+representation of an Azimuth action (format given below), along with a 65-byte
11+ECDSA signature. A `batch` is an atom that is a concatenation of one or more
12+layer 2 transactions and associated signatures. This atom is what is posted on
13+the Ethereum blockchain by a roller.
14+
15+We remark that each transaction from a given ship in a batch needs a separate
16+signature, since data such as the nonce are not included in the transaction but
17+are used in the signature. Thus a ship cannot submit multiple transactions with
18+a single signature for all of them - a different signature is needed for each
19+transaction.
20+
21+## Byte format
22+
23+We describe the byte format of a `batch` and its components in the following.
24+All atoms described here are read by the parser as little-endian - i.e. it reads
25+the last digit first and proceeds backwards.
26+
27+For the purposes of concatenation, all atoms are encoded using `octs=(pair @ud
28+@)`, which is a way to represent atoms with a fixed width in order to account
29+for leading zeroes. Here `@ud` will be the length of the atom in bytes, while
30+the `@` is actual atom.
31+
32+### Batches {#batch}
33+
34+A `batch` is an atom that is the concatenation of several raw transactions,
35+which are themselves atoms. `naive.hoon` starts reading the `batch` from the end
36+and working backwards (little-endian). A `batch` looks like:
37+
38+```
39+action-n
40+signature-n
41+action-(n-1)
42+signature-(n-1)
43+...
44+action-2
45+signature-2
46+action-1
47+signature-1
48+```
49+
50+Be careful to distinguish between an "action" and an "unsigned transaction". An
51+action is a short bytestring that describes an Azimuth action as given in the
52+[following section](#actions), while an unsigned transaction is an action plus
53+the nonce, chain ID, header. Actions are what are submitted to Ethereum, while
54+unsigned transactions are what are signed and used as the signatures in the
55+above `batch` format. When `naive.hoon` parses a batch it adds the appropriate
56+nonce, chain ID, and header to a given action and uses that to verify the
57+corresponding signature, rather than just the action itself. This reduces the
58+number of bytes in the batch, making transactions cheaper.
59+
60+### Actions {#actions}
61+
62+The byte format of an action as they appear in a `batch` is as
63+follows. They are parsed by the `+parse-tx` arm in `naive.hoon`.
64+
65+```
66+remainder: arguments
67+7 bits: operation
68+4 bytes: ship sending the transaction
69+5 bits: padding
70+3 bits: proxy
71+```
72+
73+The `proxy` is an atom between `0` and `4`, which corresponds as follows:
74+```
75+%0 %own
76+%1 %spawn
77+%2 %manage
78+%3 %vote
79+%4 %transfer
80+```
81+Note that `%vote` proxies are not supported by layer 2.
82+
83+The ship is its `@p` encoded as an `@`. As we are working with fixed width
84+atoms, the full 4 bytes is used, even if the bit length of the `@p` is shorter.
85+
86+The operation is an atom between `0` and `10` corresponding as follows:
87+
88+```
89+%0 %transfer-point
90+%1 %spawn
91+%2 %configure-keys
92+%3 %escape
93+%4 %cancel-escape
94+%5 %adopt
95+%6 %reject
96+%7 %detach
97+%8 %set-management-proxy
98+%9 %set-spawn-proxy
99+%10 %set-transfer-proxy
100+```
101+
102+Since the operation is represented with 7 bits, to complete the byte the
103+arguments either use the remaining bit as a binary flag or as padding.
104+
105+#### `%transfer-point`
106+
107+```
108+20 bytes: address to transfer to
109+1 bit: breach?
110+```
111+
112+#### `%spawn`
113+
114+As before, the length of the ship argument is always 4 bytes.
115+
116+```
117+20 bytes: address to set transfer proxy of spawned ship to
118+4 bytes: ship to spawn
119+1 bit: padding
120+```
121+
122+#### `%configure-keys`
123+
124+```
125+4 bytes: crypto suite
126+32 bytes: encryption public key
127+32 bytes: authentication public key
128+1 bit: breach?
129+```
130+
131+#### `%escape`, `%cancel-escape`, `%adopt`, `%reject`, `%detach`
132+
133+Each of these actions have the same argument - a single ship. Again, the length
134+of the ship argument is always 4 bytes.
135+
136+```
137+4 bytes: ship
138+1 bit: padding
139+```
140+
141+#### `%set-management-proxy`, `%set-spawn-proxy`, `%set-transfer-proxy`
142+
143+Each of these actions have the same argument - an Ethereum address:
144+
145+```
146+20 bytes: address
147+1 bit: padding
148+```
149+
150+### Unsigned transactions {#unsigned}
151+
152+An unsigned transaction is an atom consisting of the concatentation of an Ethereum signed
153+message header, an Urbit ID header, a chain ID, a nonce, and an action. This has the following format:
154+
155+```hoon
156+%: cad 3
157+ 26^'\19Ethereum Signed Message:\0a'
158+ (met 3 len)^len
159+ 14^'UrbitIDV1Chain'
160+ (met 3 chain-t)^chain-t
161+ 1^':'
162+ 4^nonce
163+ action
164+ ~
165+==
166+```
167+
168+Here `+cad` is a gate in `/lib/tiny.hoon` that concatenates atoms given in `octs` format. The
169+argument `3` is a `bloq` size meaning `2^3=8` bits (one byte), and the head of
170+each cell (which are `octs`) in the arguments that follow is the number of blocks (number of bytes
171+in this scenario) of each entry, with the tail being the actual data.
172+
173+`len` is the length measured in bytes of everything following it except the
174+signature. `chain-t` is the chain ID, which is to distinguish between e.g. the
175+Ethereum test net and main net, to ensure that transaction used in one cannot be
176+rebroadcast on the other (see
177+[EIP-155](https://eips.ethereum.org/EIPS/eip-155)). We note that `len` and
178+`chain-t` are both ASCII decimals (`@t` in Hoon), while `nonce` and `action` are
179+`@ud`s.
180+
181+Again we emphasize that unsigned transactions are _not_ what is submitted in a
182+batch - an [action](#actions) and a [signature](#signatures) are. A ship
183+submitting a layer 2 transaction to a roller signs an unsigned transaction and
184+this signature is included along with the action, which does not include the
185+additional data listed above. When a ship determines whether or not a given
186+layer 2 action is valid, it adds the additional data to the action to form an
187+unsigned transaction and verifies the signature against that.
188+
189+### Signatures {#signatures}
190+
191+The signature is a 65-byte ECDSA signature as described in
192+[EIP-191](https://eips.ethereum.org/EIPS/eip-191) and is compatible with
193+`personal_sign`. The precise format of the signature depends on which wallet was
194+used to sign it. Layer 2 supports all major signature formats, including
195+Metamask, Trezor, Ledger, and others. Signatures in batches are obtained by signing
196+an [unsigned transaction](#unsigned).
197+
198+Because of the format of signatures, it may have leading zeroes resulting in a
199+64-byte signature, and so it is important to use `octs` to ensure that it is
200+interpreted as being 65 bytes.
201+
content/docs/azimuth/l2/l2-actions.mdnew file+183
@@ -0,0 +1,183 @@
1++++
2+title = "Layer 2 Actions"
3+weight = 6
4+template = "doc.html"
5++++
6+
7+There are a total of eleven layer 2 actions, each corresponding to a familiar
8+[layer 1 action](/docs/azimuth/ecliptic): `%transfer-point`, `%spawn`,
9+`%configure-keys`, `%escape`, `%cancel-escape`, `%adopt`, `%reject`, `%detach`,
10+`%set-management-proxy`, `%set-spawn-proxy`, and `%set-transfer-proxy`.
11+Descriptions of what these actions do may be found by searching for them at
12+[Azimuth.eth](/docs/azimuth/azimuth-eth).
13+
14+Once a ship moves to layer 2, the owner will still utilize the same private keys
15+they used before the transfer to perform Azimuth actions. This includes the ownership
16+key as well as proxies. Stars and galaxies may move their spawn proxy to layer 2
17+while otherwise remaining on layer 1, but it is not possible to transfer only
18+the management proxy to layer 2; it may only happen as a side-effect of
19+transferring ownership to layer 2.
20+
21+### Moving a pre-existing ship to L2
22+
23+In order to move your ship from layer 1 to layer 2, transfer ownership of your
24+ship to the address `0x1111111111111111111111111111111111111111`. The easiest
25+way to accomplish this is using [Bridge](/docs/glossary/bridge). The Azimuth
26+smart contracts interpret any ship at this address as being on layer 2.
27+
28+### Dominion
29+
30+Layer 2 Azimuth data for a given ship includes which layer that ship is on. We
31+call this the ship's _dominion_. There are three dominions: `%l1`, `l2`, and
32+`%spawn`. Planets may exist in dominion `%l1` or `%l2`, stars may exist in any
33+of the three dominions, and galaxies may exist in dominion `%l1` or `%spawn`. We
34+detail what this means in each case in the following.
35+
36+### Planets
37+
38+*Permitted dominions:* `%l1`, `%l2`.
39+
40+#### `%l1` planets
41+
42+*Permitted layer 2 actions:*
43+ - owner: `%escape`, `%cancel-escape`
44+ - management proxy: `%escape`, `%cancel-escape`
45+ - transfer proxy: none
46+
47+A planet in dominion `%l1` is said to exist on layer 1, which is the default
48+state for all planets prior to the introduction of naive rollups. In addition to
49+the ordinary layer 1 Azimuth actions a planet can perform, they may also choose to
50+`%escape` or `%cancel-escape` on layer 2 using either their ownership key or
51+[management proxy](/docs/glossary/proxies). See the [layer 2 sponsorship](/docs/azimuth/l2/layer2#sponsorship)
52+section for more information on layer 1 ships performing layer 2
53+sponsorship actions.
54+
55+Layer 1 planets may also move to dominion `%l2` by depositing their ownership to
56+the layer 2 deposit address.
57+
58+#### `%l2` planets
59+
60+*Permitted layer 2 actions:*
61+ - owner: `%transfer-point`, `%configure-keys`,
62+`%escape`, `%cancel-escape`, `%set-management-proxy`, `%set-transfer-proxy`
63+ - management proxy: `%configure-keys`, `%escape`, `%cancel-escape`,
64+`%set-management-proxy`
65+ - transfer proxy: `%transfer-point`, `%set-transfer-proxy`
66+
67+A planet in dominion `%l2` is said to exist on layer 2. A planet may be on layer
68+2 either by previously being a layer 1 planet deposited to the layer 2 address,
69+or by being spawned by a star in dominion `%spawn` or `%l2`, in which case it
70+will always be on layer 2.
71+
72+A layer 2 planet is no longer capable of performing any layer 1 actions, and
73+cannot move to layer 1.
74+
75+### Stars
76+
77+*Permitted dominions:* `%l1`, `%spawn`, `%l2`.
78+
79+#### `%l1` stars
80+
81+*Permitted layer 2 actions:*
82+ - owner: `%escape`, `%cancel-escape`, `%adopt`,
83+`%reject`, `%detach`
84+ - management proxy: `%escape`, `%cancel-escape`, `%adopt`,
85+`%reject`, `%detach`
86+ - spawn proxy: none
87+ - transfer proxy: none
88+
89+A star in dominion `%l1` is said to exist on layer 1, which is the default state
90+for all stars prior to the introduction of naive rollups. In addition to the
91+ordinary Azimuth actions a star can perform, they may also perform any
92+sponsorship-related actions on layer 2.
93+
94+A `%l1` dominion star may move to dominion `%spawn` by depositing its spawn proxy to the
95+layer 2 deposit address, or may move to dominion `%l2` by depositing its ownership
96+to the layer 2 deposit address. Both actions are irreversible.
97+
98+#### `%spawn` stars
99+
100+*Permitted layer 2 actions:*
101+ - owner: `%escape`, `%cancel-escape`, `%adopt`,
102+`%reject`, `%detach`, `%spawn`, `%set-spawn-proxy`
103+ - management proxy: `%escape`,
104+`%cancel-escape`, `%adopt`, `%reject`, `%detach`
105+ - spawn proxy: `%spawn`,
106+`%set-spawn-proxy`
107+ - transfer proxy: none
108+
109+A star in dominion `%spawn` is said to exist on layer 1.
110+
111+A star in dominion `%spawn` may spawn planets directly on layer 2, but will no
112+longer be able to spawn layer 1 planets and will no longer be able to set its
113+spawn proxy on layer 1. All other layer 1 Azimuth actions may still be performed
114+by the star.
115+
116+A star moving from `%l1` to `%spawn` has no effect on sponsorship status of any
117+of its sponsored planets. Moving to `%spawn` from `%l1` is currently
118+irreversible - the only further change to dominion permitted is moving to `%l2`.
119+
120+#### `%l2` stars
121+
122+*Permitted layer 2 actions:*
123+ - owner: `%transfer-point`, `%spawn`, `%configure-keys`, `%escape`,
124+`%cancel-escape`, `%adopt`, `%reject`, `%detach`, `%set-management-proxy`,
125+`%set-spawn-proxy`,`%set-transfer-proxy`
126+ - management proxy: `%escape`,
127+`%cancel-escape`, `%adopt`, `%reject`, `%detach`, `%configure-keys`,
128+`%set-management-proxy`
129+ - spawn proxy: `%spawn`, `%set-spawn-proxy`
130+ - transfer proxy: `%transfer-point`, `%set-transfer-proxy`
131+
132+A star in dominion `%l2` is said to exist on layer 2. A star may exist on layer
133+2 by being deposited to the layer 2 deposit address from layer 1, or by being
134+spawned by a `%spawn` dominion galaxy.
135+
136+A star in dominion `%l2` cannot perform any layer 1 actions.
137+
138+### Galaxies
139+
140+*Permitted dominions:* `%l1`, `%spawn`.
141+
142+#### `%l1` galaxies
143+
144+*Permitted layer 2 actions:*
145+ - owner: `%adopt`, `%reject`, `%detach`
146+ - management proxy: `%adopt`, `%reject`, `%detach`
147+ - spawn proxy: none
148+ - transfer proxy: none
149+ - voting proxy: none.
150+
151+A galaxy in dominion `%l1` is said to exist on layer 1, which is the default state
152+for all galaxies prior to the introduction of naive rollups. In addition to the
153+ordinary Azimuth actions a galaxy can perform, they may also perform any
154+sponsorship-related actions on layer 2. `%l1` galaxies can perform all the usual
155+layer 1 Azimuth actions, and may also perform layer 2 sponsorship actions.
156+
157+A `%l1` dominion galaxy may move to dominion `%spawn` by depositing its spawn proxy to the
158+layer 2 deposit address. This action is irreversible. Note, however that the
159+majority of galaxies already have all of their stars spawned in the [Linear
160+Star Release
161+Contract](https://etherscan.io/address/0x86cd9cd0992f04231751e3761de45cecea5d1801).
162+Layer 2 has no interactions with this contract - all stars released in this
163+manner are `%l1` dominion stars. Moving to the `%spawn` dominion has no effect
164+on sponsorship status.
165+
166+#### `%spawn` galaxies
167+
168+*Permitted layer 2 actions:*
169+ - owner: `%adopt`, `%reject`, `%detach`, `%spawn`,
170+`%set-spawn-proxy`
171+ - management proxy: `%adopt`, `%reject`, `%detach`
172+ - spawn proxy: `%spawn`, `%set-spawn-proxy`
173+ - transfer proxy: none
174+ - voting proxy: none
175+
176+Galaxies may either remain on layer 1, or, similar to stars, they may
177+deposit their spawn proxy to layer 2. They cannot move their ownership,
178+management proxy, or voting proxy to layer 2. However, as with stars,
179+sponsorship actions may be performed on layer 2 using the ownership or
180+management proxies regardless of the dominion status of the galaxy.
181+
182+
183+
content/docs/azimuth/l2/layer2-api.mdnew file+14
@@ -0,0 +1,14 @@
1++++
2+title = "Roller HTTP RPC-API"
3+weight = 10
4+template = "doc.html"
5++++
6+
7+With the introduction of Layer 2 arrived a new set of Gall agents equipped with
8+an HTTP RPC-API primarily intended for interacting with Bridge. The
9+documentation for this API is coming soon.
10+
11+The set of API calls available is summarized in the following diagram.
12+
13+[![JSON RPC-API](https://media.urbit.org/docs/layer2/l2-json-rpc.svg)](https://media.urbit.org/docs/layer2/l2-json-rpc.svg)
14+
content/docs/azimuth/l2/layer2.mdnew file+425
@@ -0,0 +1,425 @@
1++++
2+title = "Layer 2 Overview"
3+weight = 5
4+template = "doc.html"
5++++
6+
7+This document provides technical details on Azimuth's "Layer 2" scaling solution
8+for Azimuth, known more formally as "naive rollups". We focus here primarily on the
9+"Hoon smart contract" located at `/lib/naive.hoon` in your ship's pier, as well
10+as other proximal topics.
11+
12+This is intended for developers that desire a deeper understanding of how this
13+protocol works, how secure it is, and how to extract data from layer 2 to obtain
14+a complete picture of the Arvo network.
15+
16+This is not intended for everyday users who only wish to know how
17+to either transfer their ship to layer 2 or perform layer 2 actions. For that,
18+see ((bridge documentation yet to be written)). For a casual overview of the
19+rationale and functionality of layer 2, please see this [blog
20+post](/blog/rollups). For more information on how Azimuth works more generally,
21+including interactions with Bridge and Ethereum, see the page on [Azimuth data flow](/docs/azimuth/flow).
22+
23+This page is also not where to find instruction on how to run your own "aggregator"/"roller".
24+Documentation for this process is forthcoming. However, this page does contain
25+essential background information for anybody in this category.
26+
27+## Summary
28+
29+Naive rollups were developed in response to rising gas costs for performing
30+Azimuth actions. They also serve the dual purpose of making onboarding easier,
31+as it is now possible to acquire a planet and get on Urbit without any knowledge
32+of Ethereum or cryptocurrency.
33+
34+In this section we give a high-level summary of how naive rollups function and
35+how they affect the end user. Later sections elaborate on this summary.
36+
37+### Layer 1
38+
39+We briefly review how "Layer 1", i.e. the [Azimuth](/docs/glossary/azimuth) smart
40+contract suite, functions. An update to the Azimuth PKI data stored on your urbit
41+occurs with four steps:
42+
43+ 1. A transaction is posted to the Ethereum blockchain.
44+ 2. The [Ethereum Virtual Machine](https://ethereum.org/en/developers/docs/evm/)
45+ calculates the resulting state transition and checks its validity, then
46+ updates the state if it is a valid transition.
47+ 3. Your urbit downloads the new state from an Ethereum node.
48+ 4. Your urbit makes the final decision on whether the new state is valid.
49+
50+By default, step four always succeeds. It has always been possible in theory for
51+your urbit to dispute what it read on Ethereum, but there has never been any
52+reason to do so.
53+
54+### Layer 2 {#layer-2}
55+
56+Layer 1 still functions identically today as it did before naive rollups. Naive
57+rollups work via the following process.
58+
59+ 1. A batch of one or more transactions is posted to the Ethereum blockchain by
60+ an urbit node called a roller or aggregator.
61+ 2. Your urbit downloads the transactions from an Ethereum node.
62+ 3. Your urbit computes the resulting state transitions from the transactions
63+ and checks them for validity.
64+ 4. Your urbit updates its locally stored Azimuth state using state transitions
65+ from the batch that have been deemed valid.
66+
67+ In comparison with Layer 1, the EVM no longer checks the validity or computes
68+ the state transitions for any given transaction. It is now being used solely as
69+ a database of submitted transactions, and the business logic of computing what
70+ these transactions mean has been offloaded to your urbit. Thus we think of
71+ `naive.hoon` as being the first "Hoon smart contract". You could also consider
72+steps 3 and 4 of the Layer 2 process as being a fattening of the trivial step 4
73+ of the layer 1 process.
74+
75+Here we briefly elaborate on the layer 2 steps, but see below for more technical
76+detail.
77+
78+A roller is any urbit node - even a moon, comet, or fakezod will do - to which
79+batches of transactions are submitted. You could use your own ship as a roller
80+if you wanted. The roller collects batches of transactions from whichever
81+parties they choose and submits them to the Ethereum blockchain all at once.
82+We expect this to either happen on a regular interval, or once some minimum
83+threshold of transactions is reached, but the decision on when to submit is
84+ultimately up to the roller.
85+
86+Computing the resulting state transitions obtained from downloaded Ethereum
87+transactions is done using `/lib/naive.hoon`, which is a gate that accepts both layer
88+1 transaction logs and layer 2 batches, and then computes the resulting state
89+transitions and updates the ship's internal Azimuth data held in
90+the Gall agent `/app/azimuth.hoon` accordingly.
91+
92+### Savings in gas costs
93+
94+There are several dimensions by which naive rollups saves on gas over layer 1.
95+They are:
96+
97+ 1. Gas is not spent on instructing the EVM to compute state transitions and
98+ confirm validity.
99+ 2. Layer 2 Azimuth state is not stored on Ethereum, so the only data storage
100+ gas costs is for the transactions themselves.
101+ 3. Layer 2 transactions are written in a highly compressed form. E.g., instead
102+ of calling the spawn action by name, it is simply referred to as action `%1`.
103+ 4. By collecting multiple layer 2 transactions and submitting them as a single
104+ "batch transaction", additional gas savings are achieved by not needing to
105+ duplicate information such as which smart contract the transactions are
106+ intended for.
107+
108+Put together, these create a reduction in gas costs of at least 65x when adding
109+a transaction to a sufficiently large batch (approximately 30 or more
110+transactions). A single transaction submitted as a batch is approximately 5x
111+cheaper, while 10 transaction submitted as a batch is approximately 30x cheaper.
112+Thus using one's own ship to submit a single-transaction batch is still a
113+cost-saving measure.
114+
115+### One way trip
116+
117+Moving to layer 2 is a one-way trip for now. This means that once a ship moves
118+to layer 2, it cannot be moved back to layer 1. We believe it to be technically
119+possible to engineer a return trip, and expect that someday this will be the
120+case, but there are no plans to implement this in the near future.
121+
122+## Interacting with L2
123+
124+Layer 2 ships can perform the same actions on layer 2 that they could on
125+layer 1, but are no longer able to perform any layer 1 actions. Layer 1 ships
126+can also perform a subset of layer 2 actions - namely the ones related to
127+sponsorship.
128+
129+For a complete list of what layer 2 actions each ship rank, layer, and proxy can
130+perform, see [Layer 2 Actions](/docs/azimuth/l2/l2-actions). For an explicit
131+description of the byte format of Layer 2 Ethereum transaction, see [Bytestring format](/docs/azimuth/l2/bytestring).
132+
133+### Sponsorship {#sponsorship}
134+
135+Due to the possibility of sponsors and sponsees existing on different layers,
136+the precise logic of how sponsorship works is complex. However, under common
137+circumstances it is simple.
138+
139+If either the sponsor or sponsee are on layer 2, then sponsorship actions must
140+occur on layer 2. The only exception to this is detaching. A sponsor on layer 1
141+may perform a layer 1 detach action on a layer 2 sponsee, and this will result
142+in the sponsee having no sponsor on layer 1, and layer 2 as well if they were
143+the sponsor on layer 2. This is necessary to simplify the logic, but it also
144+guarantees that there is no hard requirement to ever utilize layer 2. Without
145+this exception, sponsors with sponsees that move to layer 2 would be forced to
146+detach them as a layer 2 action if they wanted to cease sponsorship. This would
147+also have an unacceptable impact on ships owned by [smart contracts](#smart-contracts).
148+
149+If both sponsor and sponsee are on layer 1 then sponsorship actions may occur on
150+either layer. As long as all sponsorship actions betweeen the two parties occur
151+on a single layer, behavior will be as expected.
152+
153+In most cases this is sufficient to understand how sponsorship works. However
154+there are a number of edge cases that make this more complicated that developers
155+may need to concern themselves with in scenarios where layer 1 sponsor and
156+sponsees are mixing layer 1 and layer 2 actions. In the [Sponsorship state
157+transitions](#sponsorship-state-transitions) section below, we give a table that
158+shows how the sponsor and escape status of a ship changes according to which
159+actions are taken.
160+
161+### Smart contracts {#smart-contracts}
162+
163+Smart contracts are unable to own layer 2 ships, and thus cannot sign layer 2
164+transactions. This creates a hard requirement that layer 1 ships be allowed to
165+perform a layer 1 detach operation on a layer 2 ships.
166+
167+## Azimuth state {#state}
168+
169+The introduction of layer 2 presents additional complication in understanding
170+Azimuth state. In order to be precise we define the following terminology:
171+
172+ - _Layer 1 Azimuth state_ refers to the state of Azimuth as reflected on the
173+ Ethereum blockchain. This excludes all layer 2 transactions. Depositing to
174+ layer 2 is considered a layer 1 action, so the layer 1 Azimuth state is aware
175+ of which ships are on layer 2, but is blind to everything that happens to
176+ them afterward.
177+ - _Layer 2 Azimuth state_ refers to the state of Azimuth as stored in
178+ `/app/azimuth.hoon` on your ship. The state here takes into account
179+ transactions that occur on both layers. No distinction between the
180+ layers is made in the state here - e.g. a ship only has one sponsor in Layer 2
181+ Azimuth state, not a layer 1 sponsor and a layer 2 sponsor. This is the state
182+ actually in use by Urbit. Layer 1 Azimuth state is now only an input for
183+ generating Layer 2 Azimuth state, so any time a ship needs to check e.g. the
184+ public key of a ship (regardless of which layer it is on), it will check the
185+ Layer 2 Azimuth state, not the Layer 1 Azimuth state.
186+ - _Layer-2-Only Azimuth state_ refers to the state of Azimuth as reflected
187+ solely by layer 2 transactions. This state is not explicitly stored anywhere,
188+ but is computed as part of the process to create the Layer 2 Azimuth state.
189+ We do not make any further references to this state, but it is important to
190+ keep in mind conceptually.
191+
192+Layer 1 Azimuth state is computed by the Ethereum Virtual Machine. Layer 2
193+Azimuth state is computed by taking in the Layer 1 Azimuth state and modifying
194+it according to layer 2 transactions using `/lib/naive.hoon`. When we are being
195+precise about which state we are referring to we will utilize capitalization as above.
196+
197+Layer 2 Azimuth state is held by the Azimuth Gall app located at
198+`/lib/azimuth.hoon`. Layer 1 and layer 2 state are not held separately - your
199+ship holds only one canonical Azimuth state, generated by parsing both layer 1
200+and layer 2 Ethereum transactions using `/lib/naive.hoon`. It is important to
201+keep in mind that Layer 1 Azimuth state is entirely unaware of Layer 2 Azimuth
202+state. Thus, for instance, the Azimuth PKI on Ethereum (Layer 1 Azimuth state)
203+may claim that the sponsor of `~sampel-palnet` is `~marzod`, while the Azimuth
204+state held on your ship (Layer 2 Azimuth state) claims that the sponsor of
205+`~sampel-palnet` is `~dopzod`. Under this circumstance, this would mean that the
206+sponsor of `~sampel-palnet` was `~marzod` before `~sampel-palnet` was deposited
207+to layer 2, and thus the Azimuth PKI on Ethereum will forever reflect this.
208+
209+For more information on how Azimuth state is handled, including how this
210+integrates with Bridge and Ethereum, see [Azimuth data flow](/docs/azimuth/flow).
211+
212+### Sponsorship state transitions
213+
214+When either a sponsor or sponsee is on layer 2, then all sponsorship actions
215+occur on layer 2 and layer 1 Azimuth state is ignored. The exception to this, as
216+noted [above](#sponsorship), is when a layer 1 sponsor performs a layer 1 detach
217+action on a layer 2 sponsee. Furthermore, any time a ship moves from layer 1 to
218+layer 2, its sponsorship status is automatically maintained in layer 2.
219+
220+The only potentially complicated scenario is when both sponsee and (potential)
221+sponsor exist on layer 1. Then because layer 1 actions can modify layer 2 state,
222+careful consideration is required for interactions that mix the two. If you
223+and your sponsor/sponsee are not mixing layer 1 and layer 2 sponsorship actions
224+between yourselves, then you have nothing to worry about and may safely ignore this
225+section.
226+
227+But, for instance, if both `~sampel-palnet` and `~dopzod` are on layer 1, it is
228+technically possible for `~sampel-palnet` to escape to `~dopzod` on layer 1, and
229+then `~dopzod` can accept the escape on layer 2. This will result in `~dopzod`
230+appearing as the sponsor in the Layer 2 Azimuth state (and thus be
231+`~sampel-palnet`'s "true" sponsor), and the sponsor in the Layer 1 Azimuth state
232+will remain unchanged. While it is difficult to imagine a good reason to do
233+this, developers working with layer 2 need to keep in mind these edge cases and
234+ought to read on.
235+
236+In the following table, columns `E_1` and `S_1` represent the escape status and
237+sponsor of a given ship as reflected by the Layer 1 Azimuth state. Columns `E_2`
238+and `S_2` represent the escape status and sponsor of a given ship as reflected
239+in the Layer 2 Azimuth State. The "true" escape status and sponsor of a ship is
240+always what is listed in the Layer 2 Azimuth state. In other words, at the end
241+of the day, `S_2` is always the sponsor that matters, but layer 1 actions can
242+affect the values of `E_2` and `S_2`.
243+
244+A tar `*` entry represents any value and if an event shows a transition
245+from `*` to `*` that means that value is not altered by the transition. The
246+transitions marked with `!!` are prohibited by the layer 1 Azimuth smart
247+contract and thus never occur. `A1` and `A2` represent two distinct ships.
248+
249+```
250+Event | E_1 | E_2 | S_1 | S_2 | -> | E_1 | E_2 | S_1 | S_2
251+L1-escape A1 | * | * | * | * | -> | A1 | A1 | * | *
252+L1-cancel A1 | ~ | * | * | * | -> !! :: no cancel if not escaping
253+L1-cancel A1 | A1 | * | * | * | -> | ~ | ~ | * | *
254+L1-adopt A1 | A1 | * | * | * | -> | ~ | ~ | A1 | A2
255+L1-adopt A1 | ~ | * | * | * | -> !! :: no adopt if not escaping
256+L1-adopt A1 | A2 | * | * | * | -> !! :: no adopt if not escaping
257+L1-detach A1 | * | * | A1 | A1 | -> | * | * | ~ | ~
258+L1-detach A1 | * | * | A1 | A2 | -> | * | * | ~ | A2
259+L1-detach A1 | * | * | A1 | ~ | -> | * | * | ~ | ~
260+L2-escape A1 | * | * | * | * | -> | * | A1 | * | *
261+L2-cancel A1 | * | * | * | * | -> | * | ~ | * | *
262+L2-adopt A1 | * | A1 | * | * | -> | * | ~ | * | A1
263+L2-adopt A1 | * | A2 | * | * | -> | * | A2 | * | *
264+L2-adopt A1 | * | ~ | * | * | -> | * | ~ | * | *
265+L2-reject A1 | * | A1 | * | * | -> | * | ~ | * | *
266+L2-reject A1 | * | A2 | * | * | -> | * | A2 | * | *
267+L2-reject A1 | * | ~ | * | * | -> | * | ~ | * | *
268+L2-detach A1 | * | * | * | A1 | -> | * | * | * | ~
269+L2-detach A1 | * | * | * | A2 | -> | * | * | * | A2
270+L2-detach A1 | * | * | * | ~ | -> | * | * | * | ~
271+```
272+
273+| **Event** | **E_1** | **E_2** | **S_1** | **S_2** | **->** | **E_1** | **E_2** | **S_1** | **S_2** |
274+|--------------|---------|---------|---------|---------|--------|---------|---------|---------|---------|
275+| L1-escape A1 | * | * | * | * | -> | A1 | A1 | * | * |
276+| L1-cancel A1 | ~ | * | * | * | -> | !! | !! | !! | !! |
277+| L1-cancel A1 | A1 | * | * | * | -> | ~ | ~ | * | * |
278+| L1-adopt A1 | A1 | * | * | * | -> | ~ | ~ | A1 | A2 |
279+| L1-adopt A1 | ~ | * | * | * | -> | !! | !! | !! | !! |
280+| L1-adopt A1 | A2 | * | * | * | -> | !! | !! | !! | !! |
281+| L1-detach A1 | * | * | A1 | A1 | -> | * | * | ~ | ~ |
282+| L1-detach A1 | * | * | A1 | A2 | -> | * | * | ~ | A2 |
283+| L1-detach A1 | * | * | A1 | ~ | -> | * | * | ~ | ~ |
284+| L2-escape A1 | * | * | * | * | -> | * | A1 | * | * |
285+| L2-cancel A1 | * | * | * | * | -> | * | ~ | * | * |
286+| L2-adopt A1 | * | A1 | * | * | -> | * | ~ | * | A1 |
287+| L2-adopt A1 | * | A2 | * | * | -> | * | A2 | * | * |
288+| L2-adopt A1 | * | ~ | * | * | -> | * | ~ | * | * |
289+| L2-reject A1 | * | A1 | * | * | -> | * | ~ | * | * |
290+| L2-reject A1 | * | A2 | * | * | -> | * | A2 | * | * |
291+| L2-reject A1 | * | ~ | * | * | -> | * | ~ | * | * |
292+| L2-detach A1 | * | * | * | A1 | -> | * | * | * | ~ |
293+| L2-detach A1 | * | * | * | A2 | -> | * | * | * | A2 |
294+| L2-detach A1 | * | * | * | ~ | -> | * | * | * | ~ |
295+
296+## Aggregators
297+
298+An "aggregator" or "roller" is any Urbit node that collects signed layer 2
299+transactions (typically via `/app/azimuth-rpc.hoon`), combines them into a
300+"batch", and then submits the batch as an Ethereum transaction. Any urbit can be
301+a roller, including moons, comets, and even fakezods. You can also use your own
302+ship as a roller.
303+
304+Tlon has set up our own roller that is free to use by the community. Using
305+Bridge, a ship may submit X transactions to Tlon's roller per Y period free of
306+charge. Tlon's roller submits on a regular schedule: a submission occurs when a
307+total of A layer 2 transactions have been submitted to it since the the previous
308+submitted Ethereum transaction, or every Z time, whichever occurs first.
309+
310+There are no security risks in utilizing an aggregator. The transactions you
311+submit to it are signed with your private key, and so if an aggregator alters
312+them the signature will no longer match and `naive.hoon` will reject it as an
313+invalid transaction. The worst an aggregator can do is not submit your transaction.
314+
315+## Multi-keyfiles
316+
317+As part of the layer 2 upgrade, Tlon has expanded the role of
318+[keyfiles](/docs/glossary/keyfile). One of our goals with layer 2 was to reduce
319+the amount of friction experienced when getting onto Urbit. The enormous
320+reduction in fees has made a new boot method which allows instantaneous sale of
321+layer 2 planets or stars to be cost effective.
322+
323+The ideal situation would be for the end user to be able to buy or receive a
324+planet and immediately boot it without having to wait for an aggregator to
325+submit a transaction that spawns the planet. In order to bring about this
326+circumstance, "multi-keyfiles" have been introduced.
327+
328+Multi-keyfiles are keyfiles used to boot an urbit for first time that contains
329+more than one set of keys, the purpose of which is to initially utilize one set
330+of keys on a temporary basis, and then the other set of keys soon after. This
331+works as follows. A star owner prespawns a number of layer 2 planets ready to be
332+sold at any time for which they posess the initial key. When a user acquires a
333+planet from a star owner, the star owner immediately hands the initial keys to
334+boot the planet to the buyer. The buyer then queues a transaction at a roller to
335+rotate the keys to a new value only known by the buyer (this step is performed
336+automatically by Bridge). The buyer then downloads a keyfile from Bridge
337+containing both keys and uses that to boot their planet for the first time.
338+After the transaction setting the new keys is submitted by the roller to
339+Ethereum, the purchased planet will automatically switch to them once it reads
340+the corresponding transaction from Ethereum.
341+
342+This process introduces a short period of time in which both the buyer and
343+seller are in possession of the keys of a planet. A malicious seller could
344+theoretically sell a planet to more than one party in this time period. However,
345+they would quickly be found out as two identical ships on the network
346+immediately creates problems, and the seller's reputation would be tarnished.
347+Due to the expense or effort needed to acquire a star, this seems an unlikely
348+scenario as the reward is much less than the cost. Nonetheless, buyers should
349+always make an effort to purchase from a reputable star, as is the case with all
350+transactions in life. If you want to be absolutely sure that you've received the
351+planet, just wait for the batch to be sent and confirmed.
352+
353+Multi-keyfiles were possible before layer 2, but as the cost of configuring keys
354+was comparable to the cost of buying a planet, they were not practical.
355+
356+## Security measures
357+
358+In the process of designing naive rollups, we felt it to be of the utmost
359+importance that there not be any loss in the security of a layer 2 ship over a
360+layer 1 ship. In this section we outline several relevant facets of Urbit as
361+well as particular measures that were taken to ensure that naive rollups were
362+free of bugs and exploits. We think of `naive.hoon` as being the first "Hoon
363+smart contract", and thus its functionality needs to be as rock-solid and
364+guaranteed as the Azimuth Ethereum smart contracts.
365+
366+### Arvo is deterministic
367+
368+Crucial to the functionality of Ethereum smart contracts is that they work the
369+same way every time since the Ethereum Virtual Machine is deterministic.
370+Similarly, as the state of Arvo is evolved via [a single pure
371+function](/docs/arvo/overview#an-operating-function), Arvo is deterministic as
372+well. This property makes it well-suited for cases where side effects are
373+unacceptable such as smart contracts, and thus `naive.hoon` is worthy of the
374+name "Hoon smart contract".
375+
376+### Restricted standard library
377+
378+A standard security practice is to reduce the surface area of attack to be as
379+minimal as possible. One common source of exploits among all programming
380+languages are issues with the standard library of functions, and this is one factor
381+that leads to the existence of multiple implementations of standard library functions for
382+a given programming language. For instance, `glibc` is the most widely used
383+standard library for the C programming language, but sheer size gives a large
384+surface area in which to find exploits. Thus, other standard libraries have been
385+written such as `musl` that are much smaller, and some argue to be more secure
386+at least partially due to fewer lines of code. Hoon is not yet popular enough to have
387+multiple standard library implementations, but `naive.hoon` shucks the usual
388+standard library and so its subject contains only the exact standard library
389+functions needed for it to function. This library is known as `tiny` and is
390+found at `/lib/tiny.hoon`.
391+
392+### Unit tests
393+
394+`naive.hoon` is among the most well-tested software in Urbit. The test suite,
395+which may be run with `-test %/lib/tests/naive ~` from dojo, is larger than any
396+other test suite both in number of lines of code and number of tests. We believe
397+branch coverage to be at or very close to 100%
398+
399+### Nonces
400+
401+In the Layer 2 Azimuth state, each proxy belonging to a given ship (including
402+the ownership "proxy") has a non-negative integer associated to it called a
403+"nonce". Each transaction submitted by a given proxy also have a nonce value. If
404+the current nonce of a proxy in the Layer 2 Azimuth state is `n`, then only a
405+transaction from that proxy with a nonce of `n+1` will be considered valid.
406+Otherwise the transaction is discarded. A valid transaction, by which we
407+mean one in which the nonce and signature are correct, will increment the nonce
408+of the proxy in the Layer 2 Azimuth state by one once processed by `naive.hoon`.
409+Note that "valid transactions" also include ones where the action will fail,
410+such as a planet attempting to `%spawn` another planet. For the purposes of
411+incrementing the nonce, only the nonce and signature matter.
412+
413+The use of nonces prevents "replay attacks", which is when a malicious party collects
414+valid transactions and attempts to resubmit them in order to perform the action
415+again. Since a valid transaction increments the nonce associated to the proxy
416+that submitted it, it is only ever possible for a given transaction to alter the
417+Layer 2 Azimuth state once.
418+
419+The use of nonces also eliminates potential issues caused by submitting a
420+transaction to more than one roller. This might happen if the first roller
421+submitted to is taking too long for your liking, and you want to try again with
422+another. If both rollers end up submitting the transaction, only the first one
423+will succeed, as the second one will be ignored by `naive.hoon` for having the
424+wrong nonce.
425+
content/docs/azimuth/l2/roller.mdnew file+66
@@ -0,0 +1,66 @@
1++++
2+title = "Rollers"
3+weight = 9
4+template = "doc.html"
5++++
6+
7+Here we outline how the naive rollup rollers work. This page is only a quick
8+summary - the full documentation of the API is coming soon.
9+
10+## Overview
11+
12+The following diagram illustrates the most important parts of the plumbing
13+present in the roller.
14+
15+[![Roller internals](https://media.urbit.org/docs/layer2/roller-internal.png)](https://media.urbit.org/docs/layer2/roller-internal.png)
16+
17+We elaborate on the components of this diagram below.
18+
19+## `%roller-rpc`
20+
21+The roller communicates with the outside world via a JSON-RPC API, which is
22+implemented with a Gall agent `%roller-rpc`. This is how Bridge communicates
23+with a roller. See the [RPC
24+documentation](https://documenter.getpostman.com/view/16338962/Tzm3nx7x#5a698656-8e7e-433f-9eff-1c6047b9eace)
25+for detailed information on the API.
26+
27+## `%roller`
28+
29+`%roller` is the Gall agent which collects layer 2 Azimuth **transactions**, which
30+are a concatenation of an
31+[action](/docs/azimuth/l2/bytestrings#actions) and a
32+[signature](/docs/azimuth/l2/bytestrings#signatures) and forms them into
33+[batches](/docs/azimuth/l2/bytestrings#batch) to be submitted periodically to the
34+Ethereum blockchain.
35+
36+### Transaction format
37+
38+See [Bytestring Format](/docs/azimuth/l2/bytestring) for a technical description of
39+how layer 2 transactions are formatted.
40+
41+### Pending transactions
42+
43+`%roller` maintains in its state a list of transactions that have been submitted
44+to it since the most recent roll it submitted to Ethereum. These are referred to as
45+**pending transactions**.
46+
47+### Signing the batch
48+
49+Each pending transaction already includes a signature from its sender, but the roller
50+itself must also sign the entire batch of transactions with its private key to
51+submit it as a single Ethereum transaction. This signed batch is known as a **roll**.
52+
53+### Predicted state
54+
55+Once a roll has been submitted to an Ethereum node, there is a waiting period
56+before a miner includes it in a block.
57+
58+During this waiting period, the roller applies the submitted batch to the
59+locally held Azimuth state to get a predicted state. This predicted state is
60+presented to the user in Bridge, such as to show which points a given address owns.
61+
62+### Timer
63+
64+Each roller may choose to submit rolls on a regular basis, periodically
65+and/or whenever a certain number of pending transactions is reached.
66+
content/docs/azimuth/life-and-rift.md+7−5
@@ -1,6 +1,6 @@
11+++
22title = "Life and Rift"
3−weight = 3
3+weight = 8
44template = "doc.html"
55+++
66
@@ -13,10 +13,12 @@ and [Jael](/docs/arvo/jael/jael-api) to ensure that communication between
1313ships is always done with the most recent set of networking keys, and that
1414networking state is appropriately reset when a breach has occurred.
1515
16−Every ship begins with a `life` and `rift` of 0. For
17−galaxies, stars, and planets, these values are stored in the Azimuth PKI, while
18−for moons, these values are stored by their parent. Comets cannot change their
19−networking keys, nor can they breach, and so their `life` and `rift` are always 0.
16+Every ship begins with a `life` and `rift` of 0. For galaxies, stars, and
17+planets, these values are stored in the [Azimuth
18+PKI](/docs/azimuth/azimuth-eth#points) as `keyRevisionNumber` and
19+`continuityNumber`, while for moons, these values are stored by their parent.
20+Comets cannot change their networking keys, nor can they breach, and so their
21+`life` and `rift` are always 0.
2022
2123You can check your current `life` and `rift` number by running the `+keys our`
2224generator in dojo. You can inspect another ship's `life` and `rift` by running
content/docs/glossary/azimuth.md+27−6
@@ -3,16 +3,37 @@ title = "Azimuth"
33template = "doc.html"
44+++
55
6−**Azimuth** is Urbit's identity layer, built as a suite of smart contracts on the Ethereum blockchain. It is Urbit's method of securing digital identities that are required to use the [Arvo](/docs/glossary/arvo) peer-to-peer network, without the need for a central authority. Azimuth identities exist as non-fungible tokens, which are owned by Ethereum addresses and can be transferred between such addresses. Identities can use the [claims](/docs/glossary/claims) contract to make assertions – real-world or otherwise – about their owner.
6+**Azimuth** is Urbit's identity layer, built as a suite of smart contracts on
7+the Ethereum blockchain and several apps run locally on your
8+[ship](/docs/glossary/ship). It is Urbit's method of securing digital identities
9+that are required to use the [Arvo](/docs/glossary/arvo) peer-to-peer network,
10+without the need for a central authority. Azimuth identities exist as
11+non-fungible tokens, which are owned by Ethereum addresses and can be
12+transferred between such addresses. Identities can use the
13+[claims](/docs/glossary/claims) contract to make assertions – real-world or
14+otherwise – about their owner.
715
8−The primary way to interact with Azimuth and to manage your identities is through our [Bridge](https://bridge.urbit.org) application. Bridge is a front-end for [Ecliptic](/docs/glossary/ecliptic), the Azimuth contract that's used to perform actions on the blockchain.
16+The primary way to interact with Azimuth and to manage your identities is
17+through our [Bridge](https://bridge.urbit.org) application. Bridge is a
18+front-end for [Ecliptic](/docs/glossary/ecliptic), the Azimuth contract that's
19+used to perform actions on the blockchain.
920
10−There are a limited number of Azimuth identities which results in identities having value. This allows for identities to function as reputation primitives, since such scarcity creates an economic incentive for identities to remain static and to keep the network friendly. Undesirable behavior – spamming, scamming, and malware-spreading - will generally result in a [censure](/docs/glossary/censure) from [galaxies](/docs/glossary/galaxy) and [stars](/docs/glossary/star), marking the bad actor.
21+There are a limited number of Azimuth identities which results in identities
22+having value. This allows for identities to function as reputation primitives,
23+since such scarcity creates an economic incentive for identities to remain
24+static and to keep the network friendly. Undesirable behavior – spamming,
25+scamming, and malware-spreading - will generally result in a
26+[censure](/docs/glossary/censure) from [galaxies](/docs/glossary/galaxy) and
27+[stars](/docs/glossary/star), marking the bad actor.
1128
12−It should be noted that Azimuth isn't built just for Arvo. It can be used as an identity system for other projects.
29+It should be noted that Azimuth isn't built just for Arvo. It can be used as an
30+identity system for other projects.
1331
1432### Further Reading
1533
16−- [The Azimuth concepts page](/docs/azimuth/advanced-azimuth-tools): A more in-depth explanation of Azimuth, including information the storage of Urbit identities.
17−- [Install instructions](/getting-started/): Guide to installing Urbit, which includes instructions on booting with your Urbit identity.
34+- [The Azimuth concepts page](/docs/azimuth/azimuth): A more in-depth
35+ explanation of Azimuth.
36+- [Install instructions](/getting-started/): Guide to installing Urbit, which
37+ includes instructions on booting with your Urbit identity.
1838- [Understanding Urbit ID](/understanding-urbit/urbit-id)
39+
content/docs/glossary/hdwallet.md+2−1
@@ -14,4 +14,5 @@ If a proxy or ownership address is compromised or has its keys lost, it can alwa
1414
1515### Further Reading
1616
17−- [The Azimuth concepts page](/docs/azimuth/advanced-azimuth-tools): A more in-depth explanation of Azimuth, including information about the HD wallet.
17+- [The Azimuth concepts page](/docs/azimuth/azimuth): A more in-depth explanation of Azimuth.
18+- [Urbit HD Wallet](/docs/azimuth/hd-wallet): An in-depth explanation of the HD wallet.
content/docs/glossary/proxies.md+6−1
@@ -6,7 +6,12 @@ template = "doc.html"
66category = "azimuth"
77+++
88
9−**Proxies** are Ethereum addresses in the [Urbit HD Wallet](/docs/glossary/hdwallet) system that have limited powers. They are lower-powered "siblings" of the ownership key, which has the sole power to transfer the assigned Urbit identity. Using [Bridge](/docs/glossary/bridge), you can change the Ethereum addresses used for your proxies.
9+**Proxies** are Ethereum addresses in the [Urbit ID](/docs/glossary/azimuth)
10+system that have limited powers. They are lower-powered "siblings" of the
11+ownership key, which has the sole power to transfer the assigned Urbit identity.
12+Using [Bridge](/docs/glossary/bridge), you can change the Ethereum addresses
13+used for your proxies. If you use the [Urbit HD
14+wallet](/docs/glossary/hdwallet), your proxies have already been set.
1015
1116There are three types of proxy.
1217
content/docs/glossary/rollups.mdnew file+30
@@ -0,0 +1,30 @@
1++++
2+title = "Naive rollups"
3+template = "doc.html"
4+[extra]
5+category = "azimuth"
6++++
7+
8+**Naive rollups**, also referred to as **layer 2**, is an upgrade to
9+[Azimuth](/docs/glossary/azimuth) implemented in 2021 that reduces Ethereum gas
10+costs associated with Urbit ID transactions and friction associated with using
11+cryptocurrency in general.
12+
13+This system allows batches of Urbit ID transactions to be submitted together as
14+a single transaction using an urbit node known as a "roller". The PKI state
15+transitions resulting from these transactions are computed locally by your
16+[ship](/docs/glossary/ship) rather than by the [Ethereum Virtual
17+Machine](https://ethereum.org/en/developers/docs/evm/).
18+
19+Due to the dramatically reduced cost, Tlon offers their own roller that is free
20+for ordinary public use. This enables new users to get started with a permanent
21+Urbit ID without any prior knowledge of Ethereum, cryptocurrency, or
22+blockchains.
23+
24+### Further reading
25+
26+- [The Gang Solves the Gas Crisis](/blog/rollups): A casual overview of how
27+naive rollups works.
28+- Pilot's Guide to layer 2 : insert link
29+- [Layer 2 Overview](/docs/azimuth/l2/layer2): where developers should go to learn
30+about the technical details of naive rollups.
content/faq.md+9−154
@@ -35,18 +35,9 @@ Urbit IDs come in three classes: galaxies, stars, and planets. The length of an
3535
3636Planets are intended for everyday use by individuals, and there are 4.3 billion of them (two to the 32nd power). Stars and galaxies, on the other hand, are meant to act as network infrastructure: on the [Urbit OS](#what-is-arvo) network they provide routing and are responsible for distributing software updates.
3737
38−### Why is is currently expensive to acquire a planet? {#gas-prices}
38+### How can I spend less to get a planet? {#gas-prices}
3939
40−For the latest on this topic, see our recent blog post: [The Gang Solves the Gas Crisis](/blog/rollups).
41−
42−As of early 2021, if you try to acquire a planet from a market, you will likely encounter an enormous "gas price" fee. Ethereum is going through some growing pains, and this is an issue for every
43−smart contract on the network. This fee is unrelated to Urbit specifically, rather it results from how Ethereum transactions are paid for. The gas fee does not go to the person selling you the planet, nor to the market, nor to anybody associated with Urbit - it goes to the "miners" processing all Ethereum transactions.
44−
45−Tlon is aggressively pursuing a solution we call "naive rollups" which we predict to reduce gas costs by a factor of at least 100. We cannot give a precise estimate on when this will be complete, but it is top priority and this solution was chosen in part for the speed with which it can be implemented without sacrificing security. If you'd like to know more, we recommend watching this [Developer Call](https://www.youtube.com/watch?v=CKuHXrdkIw0) with `~wicdev-wisryt`.
46−
47−In the meantime, we recommend either using the network as a [comet](/docs/glossary/comet), or signing up with a [hosting provider](#why-hosting), which includes a free planet.
48−
49−We understand that this is an enormous frustration, and will keep this section updated as we get closer to resolving it.
40+Using Ethereum has become much more expensive since Urbit ID first launched. To rectify this, Tlon has created a system referred to as [naive rollups](/docs/glossary/rollups), or "layer 2". By reducing the size of transactions, batching them together, and moving computation off-chain to your urbit, it is now possible to perform Urbit ID transactions free of charge and without any prior knowledge of blockchains, cryptocurrency, or Ethereum. This is easily done using [Bridge](/docs/glossary/bridge), our web interface for managing your Urbit ID.
5041
5142### What is Azimuth? {#what-is-azimuth}
5243
@@ -112,56 +103,20 @@ It’s also worth noting that, while there are almost 8B people on Earth, there
112103
113104(For more background on why Urbit ID is the way it is, read [this](/understanding-urbit/urbit-id/).)
114105
115−## Urbit OS
116−
117−### What is Urbit OS? {#what-is-arvo}
118−
119−Urbit OS, also called [Arvo](/docs/glossary/arvo), is our functional and deterministic software stack. Arvo is written in [Hoon](/docs/glossary/hoon), our purely functional programming language, which compiles to [Nock](/docs/glossary/nock), a compact bytecode language.
120−
121−Instances of Urbit OS, called '[ships](/docs/glossary/ship)', communicate as peers on what we refer to as “the [Ames](/docs/glossary/ames) network.” Using Urbit ID, Urbit OS ships can prove their identities to one another.
122−
123−### What is unique about Urbit OS / Arvo? {#what-is-unique-about-arvo}
124−
125−[Arvo](/docs/glossary/arvo) is different from other operating systems in many ways. One notable way is that it is completely deterministic. Processing in the system happens in a unique way: when an event happens, a transition function takes that event and the old state of Arvo, and produces an effect and a new state of Arvo. To visualize:
126−
127−`[event, old state] -> [effects, new state]`
128−
129−All events are logged to disk, so you can always restore the system to a previous point in time.
130−
131−### How is Urbit OS / Arvo connected to Ethereum? {#arvo-ethereum}
132−
133−When an [Arvo](/docs/glossary/arvo) ship (instance) is started for the first time you must use a "[keyfile](/docs/glossary/keyfile)" containing the private keys for your identity's networking keys. Urbit ID uses the Ethereum blockchain as its decentralized ledger.
134−
135−See our [Getting Started](/getting-started/planet) guide to learn how to get your ship onto the Urbit OS / [Ames](/docs/glossary/ames) network.
136−
137−### Will the Urbit OS network survive if Ethereum dies? {#if-ethereum-dies}
138−
139−Yes. It would be annoying, but Urbit ID / [Azimuth](/docs/glossary/azimuth) could be ported to another decentralized ledger, or hosted on Urbit OS / [Arvo](/docs/glossary/arvo) itself.
140−
141−### How do I install Urbit OS? {#install-urbit-os}
142−
143−Check out our guides [here](/getting-started/).
144−
145−### How do I use Urbit OS? {#use-urbit-os}
146−
147−The [Using](/using/os/getting-started) section of the documentation will help you out.
148−
149−### How do over-the-air updates work? {#over-the-air-updates}
150−
151−Your sponsor, a star or galaxy that your ship is connected to, may send you new source code for your system. When you receive new source code from your sponsor, your system recompiles itself using that code, performs any necessary data migrations, and keeps running. Ideally this happens seamlessly without the user even noticing, although there is sometimes a slowdown while rebuilding the system from source.
106+### I have a galaxy or star with lockup conditions. How does this work? {#lockup-conditions}
152107
153−### What is Landscape? {#what-is-landscape}
108+There are two kinds of release schemes for locked up assets: linear and conditional.
154109
155−[Landscape](/docs/glossary/landscape) is an experimental Urbit OS web interface that includes social functions such as chat and publishing. You can access Landscape by navigating to `http://localhost:PORT`, where PORT is typically 80, 8080, or 8081 (check your boot messages).
110+In either scheme, you start out being able to take one star out of lockup, regardless of the terms set around the lockup as a whole. This way, you get to participate with a star right away. Go do something cool!
156111
157−### I have an Urbit ID, now what? {#now-what}
112+If your lockup involved a [galaxy](/docs/glossary/galaxy), all of its [stars](/docs/glossary/star) will be locked up, but you will have immediate, lock-free control of the galaxy. You will likely need it to use that star.
158113
159−Follow our guide on how to boot a ship [here](/getting-started/planet).
114+Note that the "releasing" of stars just means that they become available for you to claim. They don't automatically get transferred to you; you have to withdraw them from the appropriate lockup contract.
160115
161−Get on the [mailing list](https://urbit.us11.list-manage.com/subscribe/post?u=972a03db9e0c6c25bb58de8c8&id=be143888d2). Learn [Hoon](/docs/hoon/hoon-school/). Sign up for [Hooniversity](https://hooniversity.org/). [Make stuff](https://grants.urbit.org).
116+Linear release is the simplest: your stars will be released linearly over a period of time. Most often this is a period of four years. If you have four stars in lockup, that means you will be able to withdraw one star per year. In many cases, there is also an initial windup period which has to pass before linear releasing begins, typically one year. Since Azimuth launched in January 2019, the linear release will begin in January 2020.
162117
118+Conditional release is a bit more complicated. If your stars are in conditional lockup, they're likely divided over three so-called tranches. Each of these unlocks only after a unique condition is met. Since it's difficult to verify things about the real world using smart contracts, the [Galactic Senate](/docs/glossary/senate) verifies that they've been met. Once the Senate marks a condition for a tranche as cleared, it starts releasing linearly over the period of a year.
163119
164−## Urbit Security
165120
166121### How secure is Urbit right now? {#how-secure-is-urbit}
167122
@@ -179,106 +134,6 @@ Tlon keeps a quantum computing expert on staff and understands that post-quantum
179134
180135Thus, while Urbit is probably more secure and private than most digital communication channels, we cannot yet consider it impervious to a dedicated attacker. If you are a cybersecurity expert looking for work, please drop us a line at `apply@tlon.io`.
181136
182−### What is the Urbit HD Wallet? {#urbit-hd-wallet}
183−
184−The [Urbit Hierarchical Deterministic (HD) Wallet](/docs/glossary/hdwallet) is a custom Ethereum wallet based on BIP39 and BIP44 – the same underlying technology used by wallet providers like Ledger, Trezor, Metamask, and MyEtherWallet. You can think of the Urbit HD wallet as a wallet of wallets, which lets you keep a single passphrase for all of your Urbit ID keys. Urbit ID uses multiple keys with different capabilities – a bit like permissions – so that you can keep the more valuable keys in cold storage while keeping less valuable keys, used in day-to-day operation, more easily accessible. If you're only operating a planet, you shouldn't have to worry about this: you can simply think of your "master ticket" as the password to your Urbit ID. If you're operating a star or galaxy, the Urbit HD Wallet allows you to implement a multi-tier key custody scheme.
185−
186−If you're interested, you can read the spec here: [Urbit HD Wallet Spec (UP 8)](https://github.com/urbit/proposals/blob/master/008-urbit-hd-wallet).
187−
188−### What is a master ticket? {#master-ticket}
189−
190−The "master ticket" is the entropy seed from which your other Urbit ID keys are derived. It should be treated like a master password: **you should never share it with anyone, and you must store it very securely (see our practices below).** This ticket is used to derive the Ethereum wallet that holds your ownership keys, your [Urbit OS](#what-is-arvo) key – used to boot your Urbit – and the other keys associated with your identity. You’ll have a master ticket if you used the Urbit Wallet Generator or claimed a [ship](/docs/glossary/ship) on our hosted version of Bridge.
191−
192−If you're operating a planet, you can use your master ticket to authenticate with Bridge.
193−
194−### What is an ownership address? {#ownership-address}
195−
196−An ownership address is an Ethereum address that owns one or more of your Urbit IDs. The Urbit Wallet Generator creates one [Urbit HD Wallet](/docs/glossary/hdwallet) and associated addresses for each of your identities. Using the ownership key associated with your ownership address, you can transfer identities to other people, meaning that it’s very important to store securely.
197−
198−### What are proxies? {#proxies}
199−
200−[Proxies](/docs/glossary/proxies) are seeds derived from your master ticket used to generate sub-wallets, which in turn are used to generate keys that have the ability to execute different Urbit ID functions associated with your Urbit identity. Proxies generally have more restricted capabilities than your ownership seed. These capabilities include spawning child identities, voting, and setting networking keys.
201−
202−- Transfer proxy: Can transfer your identity to another Ethereum address.
203−- Spawn Proxy: For [stars](/docs/glossary/star) and [galaxies](/docs/glossary/galaxy) only. Can create new child identities.
204−- Management Proxy: Can configure or set networking keys and conduct sponsorship related operations.
205−- Voting Proxy: [Galaxies](/docs/glossary/galaxy) only. Galaxies are the part of the [galactic senate](/docs/glossary/senate), which means they can cast votes on new proposals including changes to the "[Ecliptic](/docs/glossary/ecliptic)" contract, which defines the operations of [Azimuth](/docs/glossary/azimuth).
206−
207−### What are seeds? {#seeds}
208−
209−All Ethereum key-pairs in the Urbit wallet system, including [proxies](/docs/glossary/proxies), are produced by 128-bit cryptographically random values called seeds. These seeds are the equivalent of the BIP39 mnemonic of an Ethereum wallet and are yours alone. An ownership key pair is derived from an ownership seed and, likewise, the various proxy key pairs are generated from their respective proxy seeds.
210−
211−For detailed information see the [Urbit HD Wallet Spec (UP 8)](https://github.com/urbit/proposals/blob/master/008-urbit-hd-wallet).
212−
213−### What does it mean to “set public keys”? {#set-public-keys}
214−
215−This means registering the public keys of your identity's encryption and authentication key pairs (together known as "networking keys") with Urbit ID / [Azimuth](/docs/glossary/azimuth), so that others can discover them. The corresponding private keys can then be used to, for example, run a [ship](/docs/glossary/ship) on the [Urbit OS](#what-is-arvo) network.
216−
217−You want to reset these keys if they are compromised, or if your ship has sunk. This is of little practical significance today, but resetting your networking keys resets your relationship with other ships on the network.
218−
219−### What do I do if I want to own multiple identities? {#multiple-points}
220−
221−We recommend using different HD Wallets for each identity. You are able to assign any number of identities to a single Ethereum address, however, since they are just ERC-721 tokens.
222−
223−### How should I take care of my Urbit HD Wallet? {#custody}
224−
225−Urbit IDs have accompanying security realities that must be taken seriously. The responsibility for keeping cryptographic assets safe rests fully with the party that owns them.
226−
227−The nature of decentralization is such that there is no authority that has the power to restore any lost or stolen wallet. Neither can anyone force you to follow good security practices. At most, they can give you recommendations. **Remember:** if critical items, such as your ownership key, are lost or compromised, your assets are likely gone forever.
228−
229−Below we list some good practices for storing keys, strictest first. Higher-value assets should be secured with stricter measures.
230−
231−#### Security Tier 1: Cold storage\*
232−
233−Cold storage refers to any method in which secrets are stored in a way that is not accessible to any network. Cold-stored keys should only ever be generated offline.
234−
235−Cold storage media options:
236−
237−- Printing the secret on a piece of paper. However, paper wallets are vulnerable to various forms of physical damage, such as rot, water damage, smoke, or fire. Laminating the paper can mitigate some of these risks, but the lamination can potentially trap moisture. Make sure that you trust the printer; some have memory and network connections.
238−- Storing the secret on a brand-new USB stick or hard drive that has never been connected to a networked machine.
239−- Storing the secret on a hardware wallet like Ledger or Trezor.
240−- Engraving the secret on a strip of stainless steel. This medium is resistant to both water and fire damage.
241−
242−Places to store your cold-storage media:
243−
244−- A hidden safe in your home
245−- A safe-deposit box at a bank
246−
247−It’s a good idea to store your keys redundantly; for example, on both a USB stick and a piece of paper in the safe, in case one of those methods fails. If you deem a key to be valuable enough, you can **shard** it into thirds (or other splits) and store each third in secure, geographically distributed locations. Urbit HD wallets for galaxies automatically provide a 3-way sharded master ticket.
248−
249−#### Security Tier 2: Hardware wallet or paper wallet
250−
251−A hardware wallet is a digital storage device that’s purpose-built to store cryptographic secrets. They are unaffected by typical key-stealing malware and have built-in security mechanisms that other digital devices lack. Do your research and make sure that you are buying an authentic device manufactured by trustworthy, technically competent security experts with a good reputation. Trezor and Ledger are two popular brands of hardware wallets.
252−
253−A "paper wallet" is a physical medium printed or engraved with a secret. These are resistent to network attacks, but the downside is that the secret must be entered into a computer by hand, exposing the user to attacks from malware and eavesdroppers.
254−
255−#### Security Tier 3: On your computer
256−
257−This tier includes any method where secrets are stored on an everyday computing platform. Some such methods are:
258−
259−- Encrypted PDFs containing a secret on your desktop’s drive
260−- Storing secrets on a cloud account protected by multi-factor authentication
261−- Storing secrets in a password manager
262−
263−This method is risky for a number of reasons. Networked computers can contain malware. Computers that see common use are also prone to crashes and data loss. Storing secrets on cloud accounts mitigates the risk of data destruction, but it exposes a much larger attack surface to malicious actors.
264−
265−For all of these reasons, if you use Tier 3 methods, use them only for the storage of low-value secrets.
266−
267−### I have a galaxy or star with lockup conditions. How does this work? {#lockup-conditions}
268−
269−There are two kinds of release schemes for locked up assets: linear and conditional.
270−
271−In either scheme, you start out being able to take one star out of lockup, regardless of the terms set around the lockup as a whole. This way, you get to participate with a star right away. Go do something cool!
272−
273−If your lockup involved a [galaxy](/docs/glossary/galaxy), all of its [stars](/docs/glossary/star) will be locked up, but you will have immediate, lock-free control of the galaxy. You will likely need it to use that star.
274−
275−Note that the "releasing" of stars just means that they become available for you to claim. They don't automatically get transferred to you; you have to withdraw them from the appropriate lockup contract.
276−
277−Linear release is the simplest: your stars will be released linearly over a period of time. Most often this is a period of four years. If you have four stars in lockup, that means you will be able to withdraw one star per year. In many cases, there is also an initial windup period which has to pass before linear releasing begins, typically one year. Since Azimuth launched in January 2019, the linear release will begin in January 2020.
278−
279−Conditional release is a bit more complicated. If your stars are in conditional lockup, they're likely divided over three so-called tranches. Each of these unlocks only after a unique condition is met. Since it's difficult to verify things about the real world using smart contracts, the [Galactic Senate](/docs/glossary/senate) verifies that they've been met. Once the Senate marks a condition for a tranche as cleared, it starts releasing linearly over the period of a year.
280−
281−
282137## Urbit Grants
283138
284139### What are the different types of grants? {#grants-1}
content/using/id/_index.md+26
@@ -19,6 +19,16 @@ built that way at a high level.
1919A guide to using [Bridge](https://bridge.urbit.org), our tool for managing your
2020Urbit ID.
2121
22+### [Proxies](/using/id/proxies)
23+
24+You may designate other Ethereum addresses as [proxies](/docs/glossary/proxies)
25+for your Urbit ID, which are capable of a reduced subset of Urbit ID actions.
26+
27+### [HD Wallet](/using/id/hw-wallet)
28+
29+A wallet for your Urbit ID that is accessible with a passphrase called a master
30+ticket.
31+
2232### [Bridge Troubleshooting](/using/id/bridge-troubleshooting)
2333
2434How to resolve common issues in Bridge.
@@ -31,3 +41,19 @@ network.
3141### [Guide to Breaches](/using/id/guide-to-breaches)
3242
3343What to do when things go very wrong and you need to start over.
44+
45+## Layer 2
46+
47+In 2021, [naive rollups](/blog/rollups) were introduced to reduce the cost of
48+working with Urbit ID and the friction associated with using Ethereum and
49+cryptocurrency. We have written a series of short guides intended to educate
50+users of how these changes affect them. For more comprehensive documentation
51+aimed at developers, see the [Azimuth documentation](/docs/azimuth).
52+
53+### Layer 2 Bridge Guide
54+
55+A guide to how to utilize Bridge to interact with Layer 2. XX TODO
56+
57+### [Layer 2 Stars](/using/id/l2-star)
58+
59+A summary of the different options available to stars and their proxies on layer 2.
content/using/id/hd-wallet.mdnew file+164
@@ -0,0 +1,164 @@
1++++
2+title = "HD Wallet (Master Ticket)"
3+weight = 11
4+template = "doc.html"
5++++
6+
7+This document explains what the [Urbit HD wallet](/docs/glossary/hdwallet) is
8+and how to use it.
9+
10+### What is the Urbit HD Wallet? {#urbit-hd-wallet}
11+
12+The [Urbit Hierarchical Deterministic (HD) Wallet](/docs/glossary/hdwallet) is a
13+custom Ethereum wallet based on BIP39 and BIP44 – the same underlying technology
14+used by wallet providers like Ledger, Trezor, Metamask, and MyEtherWallet. You
15+can think of the Urbit HD wallet as a wallet of wallets, which lets you keep a
16+single passphrase for all of your Urbit ID keys. Urbit ID uses multiple keys
17+with different capabilities – a bit like permissions – so that you can keep the
18+more valuable keys in cold storage while keeping less valuable keys, used in
19+day-to-day operation, more easily accessible. If you're only operating a planet,
20+you shouldn't have to worry about this: you can simply think of your "master
21+ticket" as the password to your Urbit ID. If you're operating a star or galaxy,
22+the Urbit HD Wallet allows you to implement a multi-tier key custody scheme.
23+
24+If you're interested, you can read the spec here: [Urbit HD Wallet Spec (UP
25+8)](https://github.com/urbit/proposals/blob/master/008-urbit-hd-wallet).
26+
27+### What is a master ticket? {#master-ticket}
28+
29+The "master ticket" is the cryptographic seed from which your other Urbit ID keys are
30+derived. It should be treated like a master password: **you should never share
31+it with anyone, and you must store it very securely (see our practices below).**
32+This ticket is used to derive the Ethereum wallet that holds your ownership
33+keys, your [Urbit OS](#what-is-arvo) key – used to boot your Urbit – and the
34+other keys associated with your identity. You’ll have a master ticket if you
35+used the Urbit Wallet Generator or claimed a [ship](/docs/glossary/ship) on our
36+hosted version of Bridge.
37+
38+If you're operating a planet, you can use your master ticket to authenticate
39+with Bridge.
40+
41+### What is an ownership address? {#ownership-address}
42+
43+An ownership address is an Ethereum address that owns one or more of your Urbit
44+IDs. The Urbit Wallet Generator creates one [Urbit HD
45+Wallet](/docs/glossary/hdwallet) and associated addresses for each of your
46+identities. Using the ownership key associated with your ownership address, you
47+can transfer identities to other people, meaning that it’s very important to
48+store securely.
49+
50+### What are proxies? {#proxies}
51+
52+See [Proxies](/using/id/proxies).
53+
54+### What are seeds? {#seeds}
55+
56+All Ethereum key-pairs in the Urbit wallet system, including
57+[proxies](/docs/glossary/proxies), are produced by 128-bit cryptographically
58+random values called seeds. These seeds are the equivalent of the BIP39 mnemonic
59+of an Ethereum wallet and are yours alone. An ownership key pair is derived from
60+an ownership seed and, likewise, the various proxy key pairs are generated from
61+their respective proxy seeds.
62+
63+For detailed information see the [Urbit HD Wallet Spec (UP
64+8)](https://github.com/urbit/proposals/blob/master/008-urbit-hd-wallet).
65+
66+### What does it mean to “set public keys”? {#set-public-keys}
67+
68+This means registering the public keys of your identity's encryption and
69+authentication key pairs (together known as "networking keys") with Urbit ID /
70+[Azimuth](/docs/glossary/azimuth), so that others can discover them. The
71+corresponding private keys can then be used to, for example, run a
72+[ship](/docs/glossary/ship) on the [Urbit OS](#what-is-arvo) network.
73+
74+You want to reset these keys if they are compromised, or if your ship has sunk.
75+This is of little practical significance today, but resetting your networking
76+keys resets your relationship with other ships on the network.
77+
78+### What do I do if I want to own multiple identities? {#multiple-points}
79+
80+We recommend using a different HD Wallet for each identity. You are able to
81+assign any number of identities to a single Ethereum address, however, since
82+they are just ERC-721 tokens.
83+
84+### How should I take care of my Urbit HD Wallet? {#custody}
85+
86+Urbit IDs have accompanying security realities that must be taken seriously. The
87+responsibility for keeping cryptographic assets safe rests fully with the party
88+that owns them.
89+
90+The nature of decentralization is such that there is generally no authority that
91+has the power to restore any lost or stolen wallet. The exception to this is
92+[social recovery wallets](https://vitalik.ca/general/2021/01/11/recovery.html).
93+The HD wallet does not yet support social recovery, but it is possible to
94+utilize it with another wallet such as [Argent](https://www.argent.xyz/).
95+
96+Nobody can force you to follow good security practices. At most, they
97+can give you recommendations. **Remember:** if critical items, such as your
98+ownership key, are lost or compromised, your assets are likely gone forever.
99+
100+Below we list some good practices for storing keys, strictest first.
101+Higher-value assets should be secured with stricter measures.
102+
103+#### Security Tier 1: Cold storage
104+
105+Cold storage refers to any method in which secrets are stored in a way that is
106+not accessible to any network. Cold-stored keys should only ever be generated
107+offline.
108+
109+Cold storage media options:
110+
111+- Printing the secret on a piece of paper. However, paper wallets are vulnerable
112+ to various forms of physical damage, such as rot, water damage, smoke, or
113+ fire. Laminating the paper can mitigate some of these risks, but the
114+ lamination can potentially trap moisture. Make sure that you trust the
115+ printer; some have memory and network connections.
116+- Storing the secret on a brand-new USB stick or hard drive that has never been
117+ connected to a networked machine.
118+- Storing the secret on a hardware wallet like Ledger or Trezor.
119+- Engraving the secret on a strip of stainless steel. This medium is resistant
120+ to both water and fire damage.
121+
122+Places to store your cold-storage media:
123+
124+- A hidden safe in your home
125+- A safe-deposit box at a bank
126+
127+It’s a good idea to store your keys redundantly; for example, on both a USB
128+stick and a piece of paper in the safe, in case one of those methods fails. If
129+you deem a key to be valuable enough, you can **shard** it into thirds (or other
130+splits) and store each third in secure, geographically distributed locations.
131+Urbit HD wallets for galaxies automatically provide a 3-way sharded master
132+ticket.
133+
134+#### Security Tier 2: Hardware wallet or paper wallet
135+
136+A hardware wallet is a digital storage device that’s purpose-built to store
137+cryptographic secrets. They are unaffected by typical key-stealing malware and
138+have built-in security mechanisms that other digital devices lack. Do your
139+research and make sure that you are buying an authentic device manufactured by
140+trustworthy, technically competent security experts with a good reputation.
141+Trezor and Ledger are two popular brands of hardware wallets.
142+
143+A "paper wallet" is a physical medium printed or engraved with a secret. These
144+are resistent to network attacks, but the downside is that the secret must be
145+entered into a computer by hand, exposing the user to attacks from malware and
146+eavesdroppers.
147+
148+#### Security Tier 3: On your computer
149+
150+This tier includes any method where secrets are stored on an everyday computing
151+platform. Some such methods are:
152+
153+- Encrypted PDFs containing a secret on your desktop’s drive
154+- Storing secrets on a cloud account protected by multi-factor authentication
155+- Storing secrets in a password manager
156+
157+This method is risky for a number of reasons. Networked computers can contain
158+malware. Computers that see common use are also prone to crashes and data loss.
159+Storing secrets on cloud accounts mitigates the risk of data destruction, but it
160+exposes a much larger attack surface to malicious actors.
161+
162+For all of these reasons, if you use Tier 3 methods, use them only for the
163+storage of low-value secrets.
164+
content/using/id/l2-star.mdnew file+41
@@ -0,0 +1,41 @@
1++++
2+title = "Layer 2 Stars"
3+weight = 60
4+template = "doc.html"
5++++
6+
7+This is a brief summary of the three possible options for star owners with
8+respect to use of [layer 2](/docs/glossary/rollups).
9+
10+## One-way trip
11+
12+Stars have three options with respect to layer 2:
13+ - Layer 1
14+ - Layer 1 with Layer 2 spawn proxy
15+ - Layer 2
16+
17+A layer 1 star can move to layer 1 with layer 2 spawn proxy, or to layer 2. A
18+star on layer 1 with layer 2 spawn proxy can move to layer 2. None of these
19+actions are currently reversible.
20+
21+Moving between layers has no effect on sponsorship status of any of its
22+sponsees, nor its sponsorship status with its galaxy. It also has no effect on
23+planets spawned by the star prior to moving between layers.
24+
25+## Layer 1
26+
27+A star on layer 1 performs all Urbit ID-related actions on layer 1, except for
28+sponsorship actions, which can be performed on either layer.
29+
30+## Layer 1 with Layer 2 spawn proxy
31+
32+A star on layer 1 with layer 2 spawn proxy can spawn planets on layer 2 using
33+either their ownership proxy or spawn proxy. They will no longer be able to
34+spawn planets on layer 1. They may also perform sponsorship actions on either
35+layer, identical to layer 1 stars.
36+
37+## Layer 2
38+
39+A star on layer 2 must perform all Urbit ID related actions on layer 2. All
40+planets spawned by the star will be on layer 2.
41+
content/using/id/overview.md+187−55
@@ -7,49 +7,160 @@ template = "doc.html"
77
88![](https://media.urbit.org/site/posts/essays/pki-maze.png)
99
10−A public key infrastructure (PKI) is a system for binding a set of keys to a name. Sometimes a small amount of metadata is included.
11−
12−Existing PKIs include PGP-style ["web of trust"](https://en.wikipedia.org/wiki/Web_of_trust), [SSL certificates](https://en.wikipedia.org/wiki/Certificate_authority), [ZeroTier](https://www.zerotier.com/lf-announcement/), [Keybase](https://keybase.io/), [OpenID](https://openid.net/what-is-openid/), [Mozilla Persona](https://developer.mozilla.org/en-US/docs/Archive/Mozilla/Persona), and [Login with Google](https://developers.google.com/identity). These take unique approaches to the problem and have achieved some degree of success, but none provide globally consistent, permanent, and completely self-owned identities. Exhaustive exploration and categorization is unfortunately out of scope for this post, so we'll just describe Urbit's approach to achieving these properties in our PKI.
13−
14−In Urbit, a "name" is often called a "ship" or an "address" because we use the metadata in the PKI to make names routable. The total data is two 256-bit asymmetric keys, a cryptographic suite number (to allow changing crypto algorithms), the revision number of the key, and the name of a ship that will route for it. This sums to less than 128 bytes of data.
15−
16−Each PKI trades off various properties. We chose a tripartite system so that appropriate choices can be made for different use cases. Here, we explore the various properties we chose by following a series of binary choices -- the idea maze.
17−
18−There are two sorts of PKI: either you can change your keys or not. If you cannot, then your name is impermanent, for no one can keep a set of keys secure forever. Even if your opsec never fails, eventually your crypto algorithms may be compromised.
19−
20−However, if you sacrifice the ability to change your keys, you can have a very nice property: self-attesting keys. If your name is a hash of your public key information, then no other source of information is required to verify you are who you say you are. This is a useful property since it requires no coordination at all. Many things are impermanent, especially during development. It also provides a way to try out the network without obtaining a permanent address.
21−
22−This is our first stop in the idea maze. We call this sort of name a "comet". A comet's name is the 128-bit hash of its public keys.
23−
24−However, Urbit is yours and it's forever. You shouldn't have to change your name every time you change your keys. So, we go back and take the other choice: you must be able to change your keys.
25−
26−To change keys, you must sign a message with the old keys revoking them and supplying the new ones[^0]. The question is what happens if the old keys also sign a second set of new keys. This could happen if an attacker obtained your old keys after the fact. This is important because one of the reasons to be able to change your keys is to invalidate the old ones so that they have no power.
27−
28−We have two options again: the PKI may be globally consistent or not. To be globally consistent means that if you believe a name is bound to a set of keys, then nobody on the network will disagree.
29−
30−If you don't require global consistency, you may sign this message and send it to all your neighbors, and they pass it on, and hopefully it gets to most of the network quickly. However, if one of those ships receives two contradictory versions of this message, the only thing it can do is trust the first one it heard, which may be different than what someone else heard. Thus, this is pairwise consistent but globally inconsistent. This is essentially how the pre-blockchain Ames network worked, though key changes were not actually implemented. Because global consistency is a valuable property, we looked at other options.
31−
32−For a globally consistent PKI that allows you to revoke keys, you need to be able to distinguish between two cryptographically valid messages to determine which was signed first. The dual problem could be solved easily — you can prove a message is signed after another by including the signature of the first in the second. This is equivalent to reading out a newspaper headline to prove a message was recorded after a given day.
33−
34−However, the problem of proving one message was sent before any later ones inverts the problem. You can solve this with newspapers by placing the message in the text of the newspaper. However, while reading a newspaper requires no central party, writing one does. For a long time, this sort of message was always handled by a central party. SSL revocations are managed by a few central parties. When you buy property, it's not sufficient to have the previous owner sign the title — this must be entered into a central land registry. Otherwise, the owner may sell their property to multiple people and there would be no way to determine who is the new owner. With the land registry, all you need to do is ask the registry which sale happened first, and that's the one that counts.
35−
36−However, Urbit is yours and it's forever. Trusting central registries jeopardizes both. The keen reader will notice that the problem of determining which key rotation happened first is exactly the double-spend problem that Satoshi solved with his proof of work algorithm for Bitcoin. His first block famously includes a newspaper headline to prove he didn't mine the block before that date. In a beautiful duality, his own algorithm proves that he didn't mine it after that date.[^1]
37−
38−Some argue that blockchain is only good for money. This is myopic and is generally based on the experience that its most valuable application so far has been money. However, blockchain is a cryptographic primitive to do what was previously impossible: prove that one message was signed before another without a central party. Blockchain was discovered by someone trying to create digital money, and he needed that primitive, but that doesn't mean that's all it's good for.
39−
40−Thus, we store our PKI data on a blockchain for our second kind of name: planets. A planet is a 32-bit address which has key information stored on the blockchain.[^2] The owner of a planet may broadcast new PKI data by adding it to the blockchain. Any later messages by the old keys will be rejected, and everyone on the network will listen to the blockchain for key data. Thus, we have global consistency, permanence, and self sovereignty. We know of no other solution that can provide these properties.
41−
42−However, while small individually, the aggregate PKI data for all nodes on the network may become very large. This is not an issue for comets because nobody needs to store comet keys except for those which they're talking with, and even those can be garbage-collected and re-requested and verified. For planets, there is a canonical set of keys, and somebody must store that. There are about 2<sup>32</sup>, or 4 billion planets. If the PKI data is about 100 bytes for each planet, this is about 400 GB of data. This may be more than most users wish to store, but it's small enough that it would be very cheap for someone to host this data for many users[^3].
43−
44−This information is currently stored directly on the Ethereum 1.0 blockchain, but as is well understood in blockchain circles this approach will not scale beyond a certain point. Many chains are pursing designs that allow the users of the smart contracts to store locally the data associated with the contracts they care about and only commit hashes to the chain. We expect there to be several viable options for this by the time our scaling needs exceed what's provided by Ethereum 1.0. This will free us from the cost of hosting the PKI data on all Ethereum nodes, but the data must still be stored somewhere. Any service that could handle such a large amount of data would inherently centralize the network.
45−
46−However, 4 billion is not enough addresses for every device on the planet today, much less in a few decades. So, we apply our maxim of re-examining our choices at each level for each use case. Examining the idea maze above, we cannot use the blockchain option for everything since the data is too big. However, it's not actually necessary for each of your devices to have its own self-sovereign identity separate from your planet. So we choose the option of using a central registry: your own planet.
47−
48−We allocate 4 billion "moons" to each of those planets. A moon is a 64-bit address whose 32-bit suffix is its planet. Your planet can easily store the keys for its own moons, and anyone who needs to talk to your moons can ask you for the keys.
49−
50−This is the sense in which moons are true ships: they're permanent names and you own them completely, as long as you own the planet. However, they're not independent ships — their keys can always be revoked by their planet.
51−
52−To create a sane network, we require global consistency for all our names. There are three other properties; pick any two:
10+A public key infrastructure (PKI) is a system for binding a set of keys to a
11+name. Sometimes a small amount of metadata is included.
12+
13+Existing PKIs include PGP-style ["web of
14+trust"](https://en.wikipedia.org/wiki/Web_of_trust), [SSL
15+certificates](https://en.wikipedia.org/wiki/Certificate_authority),
16+[ZeroTier](https://www.zerotier.com/lf-announcement/),
17+[Keybase](https://keybase.io/), [OpenID](https://openid.net/what-is-openid/),
18+[Mozilla
19+Persona](https://developer.mozilla.org/en-US/docs/Archive/Mozilla/Persona), and
20+[Login with Google](https://developers.google.com/identity). These take unique
21+approaches to the problem and have achieved some degree of success, but none
22+provide globally consistent, permanent, and completely self-owned identities.
23+Exhaustive exploration and categorization is unfortunately out of scope for this
24+post, so we'll just describe Urbit's approach to achieving these properties in
25+our PKI.
26+
27+In Urbit, a "name" is often called a "[ship](/docs/glossary/ship)" or an "address" because we use the
28+metadata in the PKI to make names routable. The total data is two 256-bit
29+asymmetric keys, a cryptographic suite number (to allow changing crypto
30+algorithms), the revision number of the key, and the name of a ship that will
31+route for it. This sums to less than 128 bytes of data.
32+
33+Each PKI trades off various properties. We chose a tripartite system so that
34+appropriate choices can be made for different use cases. Here, we explore the
35+various properties we chose by following a series of binary choices -- the idea
36+maze.
37+
38+There are two sorts of PKI: either you can change your keys or not. If you
39+cannot, then your name is impermanent, for no one can keep a set of keys secure
40+forever. Even if your opsec never fails, eventually your crypto algorithms may
41+be compromised.
42+
43+However, if you sacrifice the ability to change your keys, you can have a very
44+nice property: self-attesting keys. If your name is a hash of your public key
45+information, then no other source of information is required to verify you are
46+who you say you are. This is a useful property since it requires no coordination
47+at all. Many things are impermanent, especially during development. It also
48+provides a way to try out the network without obtaining a permanent address.
49+
50+This is our first stop in the idea maze. We call this sort of name a "[comet](/docs/glossary/comet)". A
51+comet's name is a 128-bit human-readable hash of its public keys.
52+
53+However, Urbit is yours and it's forever. You shouldn't have to change your name
54+every time you change your keys. So, we go back and take the other choice as well: you
55+must be able to change your keys.
56+
57+<a name="0"></a>
58+To change keys, you must sign a message with the old keys revoking them and
59+supplying the new ones<sup><a href="#f0">[0]</a></sup>. The question
60+is what happens if the old keys also sign a second set of new keys. This could
61+happen if an attacker obtained your old keys after the fact. This is important
62+because one of the reasons to be able to change your keys is to invalidate the
63+old ones so that they have no power.
64+
65+We have two options again: the PKI may be globally consistent or not. To be
66+globally consistent means that if you believe a name is bound to a set of keys,
67+then nobody on the network will disagree.
68+
69+If you don't require global consistency, you may sign this message and send it
70+to all your neighbors, and they pass it on, and hopefully it gets to most of the
71+network quickly. However, if one of those ships receives two contradictory
72+versions of this message, the only thing it can do is trust the first one it
73+heard, which may be different than what someone else heard. Thus, this is
74+pairwise consistent but globally inconsistent. This is essentially how the
75+pre-blockchain [Ames](/docs/glossary/ames) network worked, though key changes were not actually
76+implemented. Because global consistency is a valuable property, we looked at
77+other options.
78+
79+For a globally consistent PKI that allows you to revoke keys, you need to be
80+able to distinguish between two cryptographically valid messages to determine
81+which was signed first. The dual problem could be solved easily — you can prove
82+a message is signed after another by including the signature of the first in the
83+second. This is equivalent to reading out a newspaper headline to prove a
84+message was recorded after a given day.
85+
86+The problem of proving that one message was sent before any later ones
87+inverts the problem. You can solve this with newspapers by placing the message
88+in the text of the newspaper. While reading a newspaper requires no
89+central party, writing one does. For a long time, this sort of message was
90+always handled by a central party. SSL revocations are managed by a few central
91+parties. When you buy property, it's not sufficient to have the previous owner
92+sign the title — this must be entered into a central land registry. Otherwise,
93+the owner may sell their property to multiple people and there would be no way
94+to determine who is the new owner. With the land registry, all you need to do is
95+ask the registry which sale happened first, and that's the one that counts.
96+
97+<a name="1"></a>
98+Again, Urbit is yours and it's forever. Trusting central registries
99+jeopardizes both. The keen reader will notice that the problem of determining
100+which key rotation happened first is exactly the double-spend problem that
101+Satoshi solved with his proof of work algorithm for Bitcoin. His first block
102+famously includes a newspaper headline to prove he didn't mine the block before
103+that date. In a beautiful duality, his own algorithm proves that he didn't mine
104+it after that date.<sup><a href="#f1">[1]</a></sup>
105+
106+Some argue that blockchain is only good for money. This is myopic and is
107+generally based on the experience that its most valuable application so far has
108+been money. The deeper problem that the blockchain cryptographic primitive
109+allows one to solve a previously impossible task: prove that one message was
110+signed before another without a central party. Blockchain was discovered by
111+someone trying to create digital money, and he needed that primitive, but that
112+doesn't mean that's all it's good for.
113+
114+<a name="2"></a>
115+Thus, we store our PKI data on a blockchain for our second kind of name:
116+[planets](/docs/glossary/planet). A planet is a 32-bit address which has key
117+information stored on the blockchain.<sup><a href="#f2">[2]</a></sup>
118+The owner of a planet may broadcast new PKI data by adding it to the
119+blockchain. Any later messages by the old keys will be rejected, and everyone
120+on the network will listen to the blockchain for key data. Thus, we have global
121+consistency, permanence, and self sovereignty. We know of no other solution
122+that can provide these properties.
123+
124+<a name="3"></a>
125+While small individually, the aggregate PKI data for all nodes on the
126+network may become very large. This is not an issue for comets because nobody
127+needs to store comet keys except for those which they're talking with, and even
128+those can be garbage-collected and re-requested and verified. For planets, there
129+is a canonical set of keys, and somebody must store that. There are about
130+2<sup>32</sup>, or 4 billion planets. If the PKI data is about 100 bytes for
131+each planet, this is about 400 GB of data. This may be more than most users wish
132+to store, but it's small enough that it would be very cheap for someone to host
133+this data for many users<sup><a href="#f3">[3]</a></sup>.
134+
135+This information is currently stored directly on the Ethereum 1.0 blockchain,
136+but as is well understood in blockchain circles this approach will not scale
137+beyond a certain point. This moment came to be sometime in 2020. In reaction to
138+this state of affairs, Tlon developed a "layer 2" scaling solution known as
139+[naive rollups](/docs/glossary/rollups). This allows users to submit compressed
140+PKI transactions to Ethereum as batches and compute the resulting change in PKI
141+state locally, dramatically reducing gas costs to the point that Tlon offers a
142+free-to-use public "roller" which aggregates transactions and submits them as a
143+batch.
144+
145+Of course, 4 billion is not enough addresses for every device on the planet today,
146+much less in a few decades. So, we apply our maxim of re-examining our choices
147+at each level for each use case. Examining the idea maze above, we cannot use
148+the blockchain option for everything since the data is too big. However, it's
149+not actually necessary for each of your devices to have its own self-sovereign
150+identity separate from your planet. So we choose the option of using a central
151+registry: your own planet.
152+
153+We allocate 4 billion "moons" to each of those planets. A moon is a 64-bit
154+address whose 32-bit suffix is its planet. Your planet can easily store the keys
155+for its own moons, and anyone who needs to talk to your moons can ask you for
156+the keys.
157+
158+This is the sense in which moons are true ships: they're permanent names and you
159+own them completely, as long as you own the planet. But they're not
160+independent ships — their keys can always be revoked by their planet.
161+
162+To create a sane network, we require global consistency for all our names. There
163+are three other properties; pick any two:
53164
54165- Comets are impermanent, self sovereign, and plentiful.
55166
@@ -57,15 +168,36 @@ To create a sane network, we require global consistency for all our names. There
57168
58169- Moons are permanent, not self sovereign, and plentiful.
59170
60−Fancifully, comets are wayward celestial bodies that are great for testing and miscellaneous low-value things that won't last for long. Planets are where you can build a home and shape it into anything you want it to be. People can always find your planet; it's not going anywhere. Moons are useful for special purposes, like storage, heavy industry, and anything else you might want to do off-planet.[^4]
61−
62−
63−[^0]: Or the equivalent with a hierarchical key structure. In practice, you want to have a master key which signs a junior key for everyday use. You use the master key to rotate the junior key.
64−
65−[^1]: More strictly: it proves that he didn't mine it after the other blocks currently on the Bitcoin blockchain. It only gives an ordering within the chain, not a literal timestamp.
66−
67−[^2]: In addition to planets, there are stars and galaxies. From a PKI perspective they're treated exactly like planets, but on the network they provide infrastructure services like routing.
68−
69−[^3]: In practice, this will likely be an included service by your sponsoring star. It could be a separate service, but it will be very cheap because it's a commodity and the "cost of production" is very cheap. At any rate, it should never rise above the capital cost of a 400GB hard drive.
70−
71−[^4]: To extend the metaphor, stars are a neighborhood to live in -- they're easier for other planets to see, so when they want to send you a message they look for your star first. If they don't even know where your star is, they can certainly find your star's galaxy, and that will be enough to locate the star. Of course, if your star is not providing satisfactory service, you can take your planet and move to another star.
171+<a name="4"></a>
172+Fancifully, comets are wayward celestial bodies that are great for testing and
173+miscellaneous low-value things that won't last for long. Planets are where you
174+can build a home and shape it into anything you want it to be. People can always
175+find your planet; it's not going anywhere. Moons are useful for special
176+purposes, like storage, heavy industry, and anything else you might want to do
177+off-planet.<sup><a href="#f4">[4]</a></sup>
178+
179+
180+<a name="f0" href="#0">[0]</a>: Or the equivalent with a hierarchical key
181+structure. In practice, you want to have a master key which signs a junior key
182+for everyday use. You use the master key to rotate the junior key.
183+
184+<a name="f1" href="#1">[1]</a>: More strictly: it proves that he didn't mine it
185+after the other blocks currently on the Bitcoin blockchain. It only gives an
186+ordering within the chain, not a literal timestamp.
187+
188+<a name="f2" href="#2">[2]</a>: In addition to planets, there are stars and
189+galaxies. From a PKI perspective they're treated exactly like planets, but on
190+the network they provide infrastructure services like routing.
191+
192+<a name="f3" href="#3">[3]</a>: In practice, this will likely be an included
193+service by your sponsoring star. It could be a separate service, but it will be
194+very cheap because it's a commodity and the "cost of production" is very cheap.
195+At any rate, it should never rise above the capital cost of a 400GB hard drive.
196+
197+<a name="f4" href="#4">[4]</a>: To extend the metaphor, stars are a
198+neighborhood to live in -- they're easier for other planets to see, so when
199+they want to send you a message they look for your star first. If they don't
200+even know where your star is, they can certainly find your star's galaxy, and
201+that will be enough to locate the star. Of course, if your star is not
202+providing satisfactory service, you can take your planet and move to another
203+star.
content/using/id/proxies.mdnew file+56
@@ -0,0 +1,56 @@
1++++
2+title = "Proxies"
3+weight = 8
4+template = "doc.html"
5++++
6+
7+Proxy addresses allow you to execute non-ownership related actions like spawning
8+child identities, voting, and setting networking keys without jeopardizing the
9+keys you've designated with ownership rights. Setting proxy rights is optional,
10+but it is recommended for on-chain actions you will execute more frequently.
11+
12+Setting proxies is a good security practice. For instance, you might keep your
13+ownership address in cold storage, while your management proxy is kept in Metamask.
14+
15+The [Urbit HD Wallet](/docs/glossary/hdwallet) automatically sets proxies for
16+your Urbit ID.
17+
18+### Types of proxies
19+
20+There are three main types of proxy: management, spawn, and voting. Their
21+capabilities are detailed in the following. In addition, each proxy is able to
22+transfer itself to another address - e.g. the management proxy can set a new
23+address to be the management proxy.
24+
25+- **Management proxy**
26+
27+ Can configure or set Arvo networking keys,
28+ [breach](/docs/using/id/guide-to-breaches), and conduct sponsorship related
29+ operations. Planets, stars, and galaxies may all set a management proxy.
30+
31+- **Spawn proxy**
32+
33+ For stars and galaxies only. Can create new child identities.
34+
35+- **Voting proxy**
36+
37+ Galaxies only. Galaxies are the part of the [Galactic
38+ Senate](/docs/glossary/senate), and this means they can cast votes on new
39+ proposals including changes to Ecliptic.
40+
41+### Transfer proxy
42+
43+There is also a fourth proxy called the transfer proxy which is considered to be
44+of a different sort than the other three, since it generally only set on a
45+temporary basis to make ownership transfer less mistake-prone, and cleared once
46+ownership has finished.
47+
48+The address holding the transfer proxy may transfer ownership of the ID to the
49+address of the transfer proxy. This is used to make transferring a two-step
50+process: using the ownership address to set the transfer proxy, and then using
51+the transfer proxy to complete the transaction. It is possible to transfer
52+ownership as a one-step process, but this is risky and not recommended. Bridge
53+does not natively support one-step transfers, you must use an advanced tool like
54+[`%claz`](/docs/azimuth/advanced-azimuth-tools) to manually generate such a
55+transaction.
56+
content/using/id/using-bridge.md+1−1
@@ -2,7 +2,7 @@
22title = "Using Bridge"
33template = "doc.html"
44description = "How to use Bridge to interact with Azimuth and manage your Urbit ID."
5−weight = 10
5+weight = 7
66aliases = ["/docs/getting-started/using-bridge/"]
77+++
88