Added some comments, etc.

This commit is contained in:
C. Guy Yarvin 2016-10-03 17:36:11 -07:00
parent e9c962bfc0
commit 3fc6d0abaa
2 changed files with 337 additions and 218 deletions

View File

@ -5460,6 +5460,7 @@
{$pin p/twig q/twig} :: =+ q w/[p subject] {$pin p/twig q/twig} :: =+ q w/[p subject]
{$tow p/(list twig)} :: =~ twig stack {$tow p/(list twig)} :: =~ twig stack
{$aka p/term q/twig r/twig} :: =* r w/alias p/q {$aka p/term q/twig r/twig} :: =* r w/alias p/q
{$use p/wing q/twig} :: =, overlap
:: :::::: conditionals :: :::::: conditionals
{$or p/(list twig)} :: ?| loobean or {$or p/(list twig)} :: ?| loobean or
{$case p/wing q/(list (pair twig twig))} :: ?- pick case in q {$case p/wing q/(list (pair twig twig))} :: ?- pick case in q

View File

@ -1,70 +1,113 @@
!: :: /van/jael !: :: /van/jael
:: :: %reference/0 :: :: %reference/0
!? 150 !? 150
::
:: %jael: secrets and promises.
::
:: todo:
::
:: - communication with other vanes:
:: - actually use %behn for expiring secrets
:: - report %ames propagation errors to user
::
:: - nice features:
:: - scry namespace
:: - task for converting invites to tickets
::
:: - restructuring
:: - move section 0 to %zuse/%york once ready
::
:: :::: :: ::::
:::: # 0 :: public structures :::: # 0 :: public structures
:: :::: :: ::::
|= pit/vase |= pit/vase
:: ::::
:::: # 1 :: private structures
:: ::::
=> |% => |%
++ jael-state :: all crypto state
$: ver/$0 :: %jael version
yen/(set duct) :: raw observers
urb/jael-objective :: all objective state
sub/jael-subjective :: all subjective state
== ::
++ jael-subjective :: urbit metadata
$: $= car :: secure channels
%+ map ship :: partner
$: yen/(set duct) :: trackers
det/pipe :: channel state
== ::
$= rel :: neighborhood
$: dad/_our :: parent
cod/farm :: cousins
pyr/(set ship) :: peers
kyz/(set ship) :: children
== ::
$= bal :: balance sheet
$: yen/(set duct) :: trackers
== ::
$= own :: vault
$: yen/(set duct) :: trackers
lyf/life :: version
jaw/(map life ring) :: private keys
== ::
== ::
++ jael-objective :: objective urbit
$: pug/farm :: keys
pry/(map ship (map ship jael-purse)) :: promises
== ::
++ jael-remote :: remote notification
%+ each jael-purse :: addition
jael-purse :: replacement
:: :: :: ::
++ jael-balance :: balance sheet :::: ## 0.a :: certificates
%+ pair :: :: ::::
(map ship jael-purse) :: liabilities ::
(map ship jael-purse) :: assets :: the urbit meta-certificate (++will) is a sequence
:: :: :: of certificates (++cert). each cert in a will
++ jael-tally :: balance update :: revokes and replaces the previous cert. the
%+ each jael-balance :: complete :: version number of a ship is a ++life. a ++farm
jael-action :: change :: is a set of (possibly interdependent) wills.
:: :: ::
++ jael-action :: balance change :: the deed contains an ++arms, an optional definition
%+ pair ship :: partner :: of cosmetic identity; a semi-trusted parent,
%+ each jael-delta :: %&/liability change :: which signs the initial certificate and provides
jael-delta :: %|/asset change :: routing services; and a dirty bit. if the dirty
:: :: :: bit is set, the new life of this ship may have
++ jael-gift :: report :: lost information that the old life had.
$? {$veil p/pipe} :: secure channel ::
{$vest p/jael-tally} :: balance update ++ arms (map chip (pair @ta @t)) :: stated identity
{$vein p/life q/(map life ring)} :: private keys ++ bull :: cert metadata
{$vine p/(list jael-edit)} :: raw actions $: dad/ship :: parent
dob/? :: & clean, | dirty
nym/arms :: identity strings
== :: == ::
++ jael-right :: urbit commitment ++ cert (tale deed) :: signed deed
++ chip :: standard identity
$? $giv :: given name
$sur :: surname
$had :: fictitious name
$mid :: middle name
== ::
++ deed :: certificate deed
$: doc/bull :: metadata
pub/pass :: public key
== ::
++ farm (map ship will) :: pki dump set
++ life @ud :: ship version
++ mind {who/ship lyf/life} :: key identifier
++ name (pair @ta @t) :: ascii / unicode
++ oath @ :: signature
++ tale :: urbit-signed *
|* typ/mold :: payload mold
$: dat/typ :: data
syg/(map ship (pair life oath)) :: signatures
== ::
++ will (map life cert) :: meta-certificate
:: ::::
:::: ## 0.b :: rights and promises
:: ::::
::
:: %jael tracks promises (++rite) from ship to ship.
:: a rite may be any right, badge, asset, secret, etc.
:: un-shared secret or private asset is stored as a
:: rite from self to self.
::
:: a set of rites is stored as a tree (++safe), sorted
:: by ++gor on the stem, balanced by ++vor on the stem.
:: (this is the same structure as a ++map, but we can't
:: use ++map because it's not designed for mixed type.)
:: the goal of the design is to make it easy to add new
:: kinds of rite without a state adapter.
::
:: present kinds of rite:
::
:: %apple: application secret for a web api.
:: %block: the promisee is banned.
:: %email: email tied to promissee's ship.
:: %final: ship/ticket pair, ready to launch.
:: %fungi: fungible, countable asset.
:: %guest: permission to adopt foreign child.
:: %hotel: block of unissued children.
:: %jewel: urbit private keys.
:: %login: user's login passcode.
:: %pword: password for a website/api.
:: %token: user access token for a web api.
:: %urban: symmetric key for urbit networking.
::
:: %fungi keys can be anything, but don't reuse
:: currency codes. codes for urbit invitations:
:: %ugl == galaxy, %usr == star, %upl == planet
::
++ bill (pair @da @) :: expiring value
++ bump :: rights change
$: mor/safe :: add rights
les/safe :: lose rights
== ::
++ rite :: urbit commitment
$% {$apple p/(map site @)} :: web api key $% {$apple p/(map site @)} :: web api key
{$block $~} :: banned {$block $~} :: banned
{$email p/(set @ta)} :: email addresses {$email p/(set @ta)} :: email addresses
@ -78,72 +121,159 @@
{$token p/(map site (map @t @t))} :: app tokens by user {$token p/(map site (map @t @t))} :: app tokens by user
{$urban p/(map hand bill)} :: urbit symmetric keys {$urban p/(map hand bill)} :: urbit symmetric keys
== :: == ::
++ jael-purse :: rights set ++ site (list @ta) :: [%com %yahoo %www ~]
(tree jael-right) :: ++ safe (tree rite) :: rights set
:: ::::
:::: ## 0.c :: i/o
:: ::::
::
:: %jael has two general kinds of task: changes
:: and change subscriptions.
::
:: change tasks are designed to match high-level
:: operations - for instance, we have %burn, %mint,
:: and %move, not just a single delta operation.
:: more of these operations will probably be added,
:: and invariants enforced at transaction end.
::
:: subscriptions are also user-focused - for instance,
:: %vein sends all the information needed to maintain
:: the secure channel, both rights and certificates.
:: the security-critical tasks (%veil, %vein, %vine)
:: should probably be bound to a whitelisted duct set.
:: (all secrets are redacted from %vest gifts.)
::
:: %jael only talks to %ames and %behn. we send messages
:: through %ames and use %behn timers.
::
++ action :: balance change
%+ pair ship :: partner
%+ each bump :: %&/liability change
bump :: %|/asset change
:: :: :: ::
++ jael-delta :: rights change ++ balance :: balance sheet
$: mor/jael-purse :: grow rights %+ pair ::
les/jael-purse :: lose rights (map ship safe) :: liabilities
(map ship safe) :: assets
:: ::
++ change :: urbit change
$% $: $fact :: certificate change
rex/ship :: owner
vie/(unit (unit ship)) :: made/heard from
lyf/life :: deed added/modified
gan/growth :: info gained
== ::
$: $rite :: rights change
rex/ship :: issuer
pal/ship :: issued to
del/bump :: change
== == ::
:: ::
++ channel :: secure channel
$: out/(unit (pair hand bill)) :: outbound key
inn/(map hand bill) :: inbound keys
cur/(unit life) :: their version
sax/(list ship) :: their ancestry
pub/will :: their public keys
== ::
++ gift :: out result <-$
$? {$veil p/channel} :: secure channel
{$vest p/tally} :: balance update
{$vein p/life q/(map life ring)} :: private keys
{$vine p/(list change)} :: all raw changes
== :: == ::
++ jael-task :: operations on ++ growth :: unit of learning
$% {$burn p/ship q/jael-purse} :: destroy rights $% {$sign p/mind q/@} :: add/update signature
{$hail p/ship q/jael-remote} :: remote update {$step p/cert} :: add whole deed
== ::
++ note :: out request $->
$% {$b $wait p/@da} :: wait until
{$x $mess p/ship q/path r/*} :: send message
== ::
++ remote :: remote notification
%+ each safe :: addition
safe :: replacement
:: ::
++ sign :: in result $<-
$% {$b $wake $~} :: wakeup
{$x $rest p/coop} :: message result
== ::
++ tally :: balance update
%+ each balance :: complete
action :: change
::
++ task :: in request ->$
$% {$burn p/ship q/safe} :: destroy rights
{$hail p/ship q/remote} :: remote update
{$init p/@pG q/arms} :: initialize urbit {$init p/@pG q/arms} :: initialize urbit
{$meet p/(unit (unit ship)) q/farm} :: integrate pki from {$meet p/(unit (unit ship)) q/farm} :: integrate pki from
{$mint p/ship q/jael-purse} :: create rights {$mint p/ship q/safe} :: create rights
{$move p/ship q/ship r/jael-purse} :: transfer from/to {$move p/ship q/ship r/safe} :: transfer from/to
{$next p/bull} :: update private key {$next p/bull} :: update private key
{$nuke $~} :: cancel tracker {$nuke $~} :: cancel tracker from
{$veil p/ship} :: view secret channel {$veil p/ship} :: view secret channel
{$vein $~} :: view signing keys {$vein $~} :: view signing keys
{$vest $~} :: view public balance {$vest $~} :: view public balance
{$vine $~} :: view secret history {$vine $~} :: view secret history
{$west p/ship q/path r/*} :: remote request {$west p/ship q/path r/*} :: remote request
== :: == ::
++ jael-report-them :: report on neighbor --
$: gur/wyll :: certificate :: ::::
lab/jael-purse :: our promises to :::: # 1 :: private structures
own/jael-purse :: our promises from :: ::::
::
:: the %jael state comes in two parts: absolute
:: and relative.
::
:: ++state-absolute is objective -- defined without
:: reference to our ship. if you steal someone else's
:: private keys, we have a place to put them. when
:: others make promises to us, we store them in the
:: same structures we use to make promises to others.
::
::
=> |%
++ state :: all vane state
$: ver/$0 :: vane version
yen/(set duct) :: raw observers
urb/state-absolute :: all absolute state
sub/state-relative :: all relative state
== :: == ::
++ jael-report-self :: report on self ++ state-relative :: urbit metadata
$: gur/wyll :: certificate $: $= car :: secure channels
war/(map life ring) :: private keys %+ map ship :: partner
$: yen/(set duct) :: trackers
det/channel :: channel state
== ::
$= rel :: neighborhood
$: dad/_our :: parent
cod/farm :: dependencies
pyr/(set ship) :: peers
kyz/(set ship) :: children
== ::
$= bal :: balance sheet
$: yen/(set duct) :: trackers
== ::
$= own :: vault
$: yen/(set duct) :: trackers
lyf/life :: version
jaw/(map life ring) :: private keys
== ::
== :: == ::
++ jael-report-cash :: neighbors/assets ++ state-absolute :: absolute urbit
$: has/(map ship jael-purse) :: $: pug/farm :: keys
pry/(map ship (map ship safe)) :: promises
== :: == ::
++ jael-report-paid :: asset diff :: ::
$: dif/(list (trel ship ? jael-purse)) :: who, +/-, what ++ message :: p2p message
== :: $% {$hail p/safe} :: reset rights
++ jael-note :: out request $->
$% {$x $mess p/ship q/path r/*} :: send message
== ::
++ jael-message :: p2p message
$% {$hail p/jael-purse} :: reset rights
{$meet p/farm} :: propagate pki {$meet p/farm} :: propagate pki
== :: == ::
++ jael-grow :: unit of learning ++ card :: i/o action
$% {$sign p/mind q/@} :: add/update signature (wind note gift) ::
{$step p/cert} :: add whole deed
== ::
++ jael-edit :: urbit change
$% $: $fact :: certificate change
rex/ship :: owner
vie/(unit (unit ship)) :: made/heard from
lyf/life :: deed added/modified
gan/jael-grow :: info gained
== ::
$: $rite :: rights change
rex/ship :: issuer
pal/ship :: issued to
del/jael-delta :: change
== ::
== ::
++ jael-card :: i/o action
(wind jael-note jael-gift) ::
:: :: :: ::
++ jael-move :: output ++ move :: output
{p/duct q/jael-card} {p/duct q/card} ::
-- --
:: :::: :: ::::
:::: # 2 :: static data :::: # 2 :: static data
@ -435,7 +565,7 @@
-- --
:: :: ++ry :: :: ++ry
++ ry :: rights algebra ++ ry :: rights algebra
|_ {lef/jael-right ryt/jael-right} |_ {lef/rite ryt/rite}
:: ::
:: ++ry: rights algebra :: ++ry: rights algebra
:: ::
@ -447,7 +577,7 @@
:: ::
:: :: ++dif:ry :: :: ++dif:ry
++ dif :: r->l: {add remove} ++ dif :: r->l: {add remove}
^- (pair (unit jael-right) (unit jael-right)) ^- (pair (unit rite) (unit rite))
|^ ?- -.lef |^ ?- -.lef
$apple ?>(?=($apple -.ryt) (table %apple p.lef p.ryt)) $apple ?>(?=($apple -.ryt) (table %apple p.lef p.ryt))
$block ?>(?=($block -.ryt) [~ ~]) $block ?>(?=($block -.ryt) [~ ~])
@ -471,7 +601,7 @@
:: :: ++noble:dif:ry :: :: ++noble:dif:ry
++ noble :: diff map of @ud ++ noble :: diff map of @ud
|* {nut/@tas new/(map * @ud) old/(map * @ud)} |* {nut/@tas new/(map * @ud) old/(map * @ud)}
^- (pair (unit jael-right) (unit jael-right)) ^- (pair (unit rite) (unit rite))
=/ fop (~(tap by (~(def by old) new))) =/ fop (~(tap by (~(def by old) new)))
=/ mor =/ mor
|- ^+ new |- ^+ new
@ -545,19 +675,19 @@
:: :: ++table:dif:ry :: :: ++table:dif:ry
++ table :: diff map ++ table :: diff map
|* {nut/@tas new/(map) old/(map)} |* {nut/@tas new/(map) old/(map)}
^- (pair (unit jael-right) (unit jael-right)) ^- (pair (unit rite) (unit rite))
=/ ped (~(dep by old) new) =/ ped (~(dep by old) new)
:- ?~(p.ped ~ `[nut p.ped]) :- ?~(p.ped ~ `[nut p.ped])
?~(q.ped ~ `[nut q.ped]) ?~(q.ped ~ `[nut q.ped])
-- --
:: :: ++sub:ry :: :: ++sub:ry
++ sub :: l - r ++ sub :: l - r
^- (unit jael-right) ^- (unit rite)
=/ vid dif =/ vid dif
?>(?=($~ q.vid) p.vid) ?>(?=($~ q.vid) p.vid)
:: :: ++add:ry :: :: ++add:ry
++ uni :: lef new, ryt old ++ uni :: lef new, ryt old
^- jael-right ^- rite
|^ ?- -.lef |^ ?- -.lef
$apple ?>(?=($apple -.ryt) [%apple (table p.lef p.ryt)]) $apple ?>(?=($apple -.ryt) [%apple (table p.lef p.ryt)])
$block ?>(?=($block -.ryt) [%block ~]) $block ?>(?=($block -.ryt) [%block ~])
@ -610,18 +740,6 @@
:: ::
:: ++up: wallet algebra :: ++up: wallet algebra
:: ::
:: we store the various kinds of ++jael-right in
:: a binary tree, sorted by ++gor on the tag,
:: balanced by ++vor on the tag. this tree, a
:: ++jael-purse, is also a valid ++map. but
:: unlike a ++map, it has heterogeneous type.
::
:: this design is pretty generalized and should
:: probably be promoted deeper in the stack. its
:: goal is to make it super easy to add new
:: forms of ++jael-right, without invalidating
:: existing purse nouns.
::
:: rights operations always crash if impossible; :: rights operations always crash if impossible;
:: the algebra has no concept of negative rights. :: the algebra has no concept of negative rights.
:: ::
@ -634,11 +752,11 @@
:: properly inferred, eliminating the ?>. :: properly inferred, eliminating the ?>.
:: :: ++up :: :: ++up
++ up :: rights wallet ++ up :: rights wallet
|_ pig/jael-purse |_ pig/safe
:: :: ++delete:up :: :: ++delete:up
++ delete :: delete right ++ delete :: delete right
|= ryt/jael-right |= ryt/rite
^- jael-purse ^- safe
?~ pig ?~ pig
~ ~
?. =(-.ryt -.n.pig) ?. =(-.ryt -.n.pig)
@ -647,7 +765,7 @@
[n.pig l.pig $(pig r.pig)] [n.pig l.pig $(pig r.pig)]
=/ dub ~(sub ry n.pig ryt) =/ dub ~(sub ry n.pig ryt)
?^ dub [u.dub l.pig r.pig] ?^ dub [u.dub l.pig r.pig]
|- ^- jael-purse |- ^- safe
?~ l.pig r.pig ?~ l.pig r.pig
?~ r.pig l.pig ?~ r.pig l.pig
?: (vor -.n.l.pig -.n.r.pig) ?: (vor -.n.l.pig -.n.r.pig)
@ -655,13 +773,13 @@
[n.r.pig $(r.pig l.r.pig) r.r.pig] [n.r.pig $(r.pig l.r.pig) r.r.pig]
:: :: ++differ:up :: :: ++differ:up
++ differ :: delta pig->gob ++ differ :: delta pig->gob
|= gob/jael-purse |= gob/safe
^- jael-delta ^- bump
|^ [way way(pig gob, gob pig)] |^ [way way(pig gob, gob pig)]
++ way ++ way
%- intern(pig ~) %- intern(pig ~)
%+ skip linear(pig gob) %+ skip linear(pig gob)
|=(jael-right (~(has in pig) +<)) |=(rite (~(has in pig) +<))
-- --
:: :: ++exists:up :: :: ++exists:up
++ exists :: test presence ++ exists :: test presence
@ -670,15 +788,15 @@
:: :: ++expose:up :: :: ++expose:up
++ expose :: typed extract ++ expose :: typed extract
|= tag/@tas |= tag/@tas
^- (unit jael-right) ^- (unit rite)
?~ pig ~ ?~ pig ~
?: =(tag -.n.pig) ?: =(tag -.n.pig)
[~ u=n.pig] [~ u=n.pig]
?:((gor tag -.n.pig) $(pig l.pig) $(pig r.pig)) ?:((gor tag -.n.pig) $(pig l.pig) $(pig r.pig))
:: :: ++insert:up :: :: ++insert:up
++ insert :: insert item ++ insert :: insert item
|= ryt/jael-right |= ryt/rite
^- jael-purse ^- safe
?~ pig ?~ pig
[ryt ~ ~] [ryt ~ ~]
?: =(-.ryt -.n.pig) ?: =(-.ryt -.n.pig)
@ -698,24 +816,24 @@
[n.nex [n.pig l.pig l.nex] r.nex] [n.nex [n.pig l.pig l.nex] r.nex]
:: :: ++intern:up :: :: ++intern:up
++ intern :: insert list ++ intern :: insert list
|= lin/(list jael-right) |= lin/(list rite)
^- jael-purse ^- safe
?~ lin pig ?~ lin pig
=. pig $(lin t.lin) =. pig $(lin t.lin)
(insert i.lin) (insert i.lin)
:: :: ++linear:up :: :: ++linear:up
++ linear :: convert to list ++ linear :: convert to list
=| lin/(list jael-right) =| lin/(list rite)
|- ^+ lin |- ^+ lin
?~ pig ~ ?~ pig ~
$(pig r.pig, lin [n.pig $(pig l.pig)]) $(pig r.pig, lin [n.pig $(pig l.pig)])
:: :: ++redact:up :: :: ++redact:up
++ redact :: conceal secrets ++ redact :: conceal secrets
|- ^- jael-purse |- ^- safe
?~ pig ~ ?~ pig ~
:_ [$(pig l.pig) $(pig r.pig)] :_ [$(pig l.pig) $(pig r.pig)]
=* rys n.pig =* rys n.pig
^- jael-right ^- rite
?+ -.rys rys ?+ -.rys rys
$apple $apple
[%apple (~(run by p.rys) |=(@ (mug +<)))] [%apple (~(run by p.rys) |=(@ (mug +<)))]
@ -745,27 +863,27 @@
== ==
:: :: ++remove:up :: :: ++remove:up
++ remove :: pig minus gob ++ remove :: pig minus gob
|= gob/jael-purse |= gob/safe
^- jael-purse ^- safe
=/ buv (~(tap by gob)) =/ buv (~(tap by gob))
|- ?~ buv pig |- ?~ buv pig
$(buv t.buv, pig (delete i.buv)) $(buv t.buv, pig (delete i.buv))
:: :: ++splice:up :: :: ++splice:up
++ splice :: pig plus gob ++ splice :: pig plus gob
|= gob/jael-purse |= gob/safe
^- jael-purse ^- safe
=/ buv (~(tap by gob)) =/ buv (~(tap by gob))
|- ?~ buv pig |- ?~ buv pig
$(buv t.buv, pig (insert i.buv)) $(buv t.buv, pig (insert i.buv))
:: :: ++update:up :: :: ++update:up
++ update :: arbitrary change ++ update :: arbitrary change
|= del/jael-delta |= del/bump
^- jael-purse ^- safe
(splice(pig (remove les.del)) mor.del) (splice(pig (remove les.del)) mor.del)
-- --
:: :: ++we :: :: ++we
++ we :: wyll tool ++ we :: will tool
|_ pub/wyll |_ pub/will
:: :: ++collate:we :: :: ++collate:we
++ collate :: sort by version ++ collate :: sort by version
|= com/$-({{life cert} {life cert}} ?) |= com/$-({{life cert} {life cert}} ?)
@ -794,7 +912,7 @@
=> |% => |%
:: ## 4.a :: of :: ## 4.a :: of
++ of :: main engine ++ of :: main engine
=| moz/(list jael-move) :::: =| moz/(list move) ::::
=| $: :: sys: system context =| $: :: sys: system context
:: ::
$= sys $= sys
@ -806,7 +924,7 @@
== ==
:: all vane state :: all vane state
:: ::
jael-state state
== ==
:: lex: all durable state :: lex: all durable state
:: moz: pending actions :: moz: pending actions
@ -826,19 +944,19 @@
:: tac: event data :: tac: event data
:: ::
hen/duct hen/duct
tac/jael-task tac/task
== ==
^+ +> ^+ +>
?- -.tac ?- -.tac
:: ::
:: destroy promises :: destroy promises
:: {$burn p/ship q/jael-purse)} :: {$burn p/ship q/safe)}
:: ::
$burn $burn
(cure abet:abet:(deal:(burb our) p.tac [~ q.tac])) (cure abet:abet:(deal:(burb our) p.tac [~ q.tac]))
:: ::
:: remote update :: remote update
:: {$hail p/ship q/jael-remote} :: {$hail p/ship q/remote}
:: ::
$hail $hail
(cure abet:abet:(hail:(burb p.tac) our q.tac)) (cure abet:abet:(hail:(burb p.tac) our q.tac))
@ -850,14 +968,14 @@
(cure abet:(~(make ur urb) now.sys eny.sys p.tac q.tac)) (cure abet:(~(make ur urb) now.sys eny.sys p.tac q.tac))
:: ::
:: create promises :: create promises
:: {$mint p/ship q/jael-purse} :: {$mint p/ship q/safe}
:: ::
$mint $mint
(cure abet:abet:(deal:(burb our) p.tac [q.tac ~])) (cure abet:abet:(deal:(burb our) p.tac [q.tac ~]))
:: ::
:: move promises :: move promises
:: {$move p/ship q/ship r/jael-purse} :: {$move p/ship q/ship r/safe}
:: ::
$move $move
=. +> (cure abet:abet:(deal:(burb our) p.tac [~ r.tac])) =. +> (cure abet:abet:(deal:(burb our) p.tac [~ r.tac]))
@ -879,7 +997,7 @@
yen.bal.sub (~(del in yen.bal.sub) hen) yen.bal.sub (~(del in yen.bal.sub) hen)
yen.own.sub (~(del in yen.own.sub) hen) yen.own.sub (~(del in yen.own.sub) hen)
car.sub %- ~(run by car.sub) car.sub %- ~(run by car.sub)
|= {yen/(set duct) det/pipe} |= {yen/(set duct) det/channel}
[(~(del in yen) hen) det] [(~(del in yen) hen) det]
== ==
:: ::
@ -918,11 +1036,11 @@
:: ::
$west $west
?> =(~ q.tac) ?> =(~ q.tac)
=+ mes=((hard jael-message) r.tac) =+ mes=((hard message) r.tac)
?- -.mes ?- -.mes
:: ::
:: reset remote rights :: reset remote rights
:: {$hail p/jael-purse} :: {$hail p/safe}
:: ::
$hail $hail
(cure abet:abet:(hail:(burb p.tac) our [%| p.mes])) (cure abet:abet:(hail:(burb p.tac) our [%| p.mes]))
@ -935,24 +1053,24 @@
== ==
== ==
:: :: ++curd:of :: :: ++curd:of
++ curd :: subjective moves ++ curd :: relative moves
|= {moz/(list jael-move) sub/jael-subjective} |= {moz/(list move) sub/state-relative}
+>(sub sub, moz (weld (flop moz) ^moz)) +>(sub sub, moz (weld (flop moz) ^moz))
:: :: ++cure:of :: :: ++cure:of
++ cure :: objective edits ++ cure :: absolute edits
|= {hab/(list jael-edit) urb/jael-objective} |= {hab/(list change) urb/state-absolute}
^+ +> ^+ +>
(curd(urb urb) abet:(~(apex su urb sub) hab)) (curd(urb urb) abet:(~(apex su urb sub) hab))
-- --
:: ## 4.b :: ++su :: ## 4.b :: ++su
++ su :: subjective engine ++ su :: relative engine
=| moz/(list jael-move) :::: =| moz/(list move) ::::
=| $: jael-objective =| $: state-absolute
jael-subjective state-relative
== ==
:: moz: moves in reverse order :: moz: moves in reverse order
:: urb: objective urbit state :: urb: absolute urbit state
:: sub: subjective urbit state :: sub: relative urbit state
:: ::
=* urb -< =* urb -<
=* sub -> =* sub ->
@ -962,7 +1080,7 @@
[(flop moz) sub] [(flop moz) sub]
:: :: ++apex:su :: :: ++apex:su
++ apex :: apply changes ++ apex :: apply changes
|= hab/(list jael-edit) |= hab/(list change)
^+ +> ^+ +>
?~ hab +> ?~ hab +>
%= $ %= $
@ -975,7 +1093,7 @@
== ==
:: :: ++exec:su :: :: ++exec:su
++ exec :: mass gift ++ exec :: mass gift
|= {yen/(set duct) cad/jael-card} |= {yen/(set duct) cad/card}
=/ noy (~(tap in yen)) =/ noy (~(tap in yen))
|- ^+ ..exec |- ^+ ..exec
?~ noy ..exec ?~ noy ..exec
@ -1041,7 +1159,7 @@
(exec(+.own yam) yen.own [%give %vein +.own]) (exec(+.own yam) yen.own [%give %vein +.own])
:: :: ++vest:feel:su :: :: ++vest:feel:su
++ vest :: kick balance ++ vest :: kick balance
|= hug/jael-action |= hug/action
^+ ..feel ^+ ..feel
?: =([~ ~] +.q.hug) ..feel ?: =([~ ~] +.q.hug) ..feel
:: ::
@ -1127,7 +1245,7 @@
:: :: ++veil:form:su :: :: ++veil:form:su
++ veil :: channel report ++ veil :: channel report
|= who/ship |= who/ship
^- pipe ^- channel
:: ::
:: pub: will of who :: pub: will of who
:: exp: promises from our to who :: exp: promises from our to who
@ -1136,20 +1254,20 @@
:: inn: symmetric keys from who to our :: inn: symmetric keys from who to our
:: ::
=/ pub =/ pub
^- wyll ^- will
=- ?~(- ~ u.-) =- ?~(- ~ u.-)
(~(get by pug.urb) who) (~(get by pug.urb) who)
:: ::
=/ exp =/ exp
^- jael-purse ^- safe
=- ?~(- ~ u.-) =- ?~(- ~ u.-)
(~(get by (~(got by pry.urb) our)) who) (~(get by (~(got by pry.urb) our)) who)
:: ::
=/ imp =/ imp
^- jael-purse ^- safe
=- ?~(- ~ u.-) =- ?~(- ~ u.-)
%. our %. our
~(get by (fall (~(get by pry.urb) who) *(map ship jael-purse))) ~(get by (fall (~(get by pry.urb) who) *(map ship safe)))
:: ::
=* out =* out
^- (unit (pair hand bill)) ^- (unit (pair hand bill))
@ -1169,7 +1287,7 @@
?> ?=($urban -.u.-) ?> ?=($urban -.u.-)
p.u.- p.u.-
:: ::
^- pipe ^- channel
[out inn ~(current we pub) (~(dads ur urb) who) pub] [out inn ~(current we pub) (~(dads ur urb) who) pub]
:: :: ++vein:form:su :: :: ++vein:form:su
++ vein :: private key report ++ vein :: private key report
@ -1177,7 +1295,7 @@
(~(lean ur urb) our) (~(lean ur urb) our)
:: :: ++vest:form:su :: :: ++vest:form:su
++ vest :: balance report ++ vest :: balance report
^- jael-balance ^- balance
:- :: :- ::
:: raw: all our liabilities by ship :: raw: all our liabilities by ship
:: dud: delete liabilities to self :: dud: delete liabilities to self
@ -1185,25 +1303,25 @@
:: ::
=* raw =-(?~(- ~ u.-) (~(get by pry.urb) our)) =* raw =-(?~(- ~ u.-) (~(get by pry.urb) our))
=* dud (~(del by raw) our) =* dud (~(del by raw) our)
=* cul (~(run by dud) |=(jael-purse ~(redact up +<))) =* cul (~(run by dud) |=(safe ~(redact up +<)))
cul cul
:: ::
:: fub: all assets by ship :: fub: all assets by ship
:: veg: all nontrivial assets, secrets masked :: veg: all nontrivial assets, secrets masked
:: ::
=/ fub =/ fub
^- (list (pair ship (unit jael-purse))) ^- (list (pair ship (unit safe)))
%+ turn %+ turn
(~(tap by pry.urb)) (~(tap by pry.urb))
|= (pair ship (map ship jael-purse)) |= (pair ship (map ship safe))
[p (~(get by q) our)] [p (~(get by q) our)]
=* veg =* veg
|- ^- (list (pair ship jael-purse)) |- ^- (list (pair ship safe))
?~ fub ~ ?~ fub ~
=+ $(fub t.fub) =+ $(fub t.fub)
?~(q.i.fub - [[p.i.fub ~(redact up u.q.i.fub)] -]) ?~(q.i.fub - [[p.i.fub ~(redact up u.q.i.fub)] -])
:: ::
(~(gas by *(map ship jael-purse)) veg) (~(gas by *(map ship safe)) veg)
-- --
:: :: ++open:su :: :: ++open:su
++ open :: make secure channel ++ open :: make secure channel
@ -1236,7 +1354,7 @@
:: ::
rex/ship rex/ship
pal/ship pal/ship
del/jael-delta del/bump
== ==
^+ +> ^+ +>
=* bur ?| (~(exists up mor.del) %urban) =* bur ?| (~(exists up mor.del) %urban)
@ -1281,13 +1399,13 @@
rex/ship rex/ship
vie/(unit (unit ship)) vie/(unit (unit ship))
lyf/life lyf/life
gan/jael-grow gan/growth
== ==
:: lip: this change as its own farm :: lip: this change as its own farm
:: ::
=/ lip ^- farm =/ lip ^- farm
=- [[rex -] ~ ~] =- [[rex -] ~ ~]
^- wyll ^- will
=- [[lyf -] ~ ~] =- [[lyf -] ~ ~]
^- cert ^- cert
?- -.gan ?- -.gan
@ -1361,8 +1479,8 @@
-- --
:: ## 4.c :: ++ur :: ## 4.c :: ++ur
++ ur :: urbit engine ++ ur :: urbit engine
=| hab/(list jael-edit) :::: =| hab/(list change) ::::
=| jael-objective =| state-absolute
:: ::
:: hab: side effects, reversed :: hab: side effects, reversed
:: urb: all urbit state :: urb: all urbit state
@ -1371,7 +1489,7 @@
|% |%
:: :: ++abet:ur :: :: ++abet:ur
++ abet :: resolve ++ abet :: resolve
[(flop hab) `jael-objective`urb] [(flop hab) `state-absolute`urb]
:: :: ++boss:ur :: :: ++boss:ur
++ boss :: parent ++ boss :: parent
|= who/ship |= who/ship
@ -1388,7 +1506,7 @@
:: ::
++ lawn :: ++lawn:ur ++ lawn :: ++lawn:ur
|= {rex/ship pal/ship} :: debts, rex to pal |= {rex/ship pal/ship} :: debts, rex to pal
^- jael-purse ^- safe
(lawn:~(able ex rex) pal) (lawn:~(able ex rex) pal)
:: :: ++leak:ur :: :: ++leak:ur
++ leak :: private key ++ leak :: private key
@ -1428,9 +1546,9 @@
:: ::
=. +>.$ =. +>.$
=- abet:(deal:~(able ex our) our - ~) =- abet:(deal:~(able ex our) our - ~)
^- jael-purse ^- safe
%- intern:up %- intern:up
^- (list jael-right) ^- (list rite)
=/ mir (clan our) =/ mir (clan our)
?+ mir ~ ?+ mir ~
$czar $czar
@ -1459,7 +1577,7 @@
:: ::
=/ key (ypt:scr (mix our %jael-make) gen) =/ key (ypt:scr (mix our %jael-make) gen)
=* had (shaf %hand key) =* had (shaf %hand key)
=* ryt `jael-right`[%urban [had (add ~m1 now) key] ~ ~] =* ryt `rite`[%urban [had (add ~m1 now) key] ~ ~]
:: ::
:: register initial symmetric key from ticket :: register initial symmetric key from ticket
:: ::
@ -1489,8 +1607,8 @@
:: shy: private state :: shy: private state
:: rug: domestic will :: rug: domestic will
:: ::
=| $: shy/(map ship jael-purse) =| $: shy/(map ship safe)
rug/wyll rug/will
== ==
=| :: rex: server ship =| :: rex: server ship
:: ::
@ -1505,14 +1623,14 @@
:: :: ++able:ex:ur :: :: ++able:ex:ur
++ able :: initialize ++ able :: initialize
%_ . %_ .
shy (fall (~(get by pry) rex) *(map ship jael-purse)) shy (fall (~(get by pry) rex) *(map ship safe))
rug (fall (~(get by pug) rex) *wyll) rug (fall (~(get by pug) rex) *will)
== ==
:: :: ++deal:ex:ur :: :: ++deal:ex:ur
++ deal :: alter rights ++ deal :: alter rights
|= {pal/ship del/jael-delta} |= {pal/ship del/bump}
^+ +> ^+ +>
=/ gob (fall (~(get by shy) pal) *jael-purse) =/ gob (fall (~(get by shy) pal) *safe)
=* hep (~(update up gob) del) =* hep (~(update up gob) del)
%_ +>.$ %_ +>.$
shy (~(put by shy) pal hep) shy (~(put by shy) pal hep)
@ -1520,10 +1638,10 @@
== ==
:: ::
++ hail :: ++hail:ex:ur ++ hail :: ++hail:ex:ur
|= {pal/ship rem/jael-remote} :: report rights |= {pal/ship rem/remote} :: report rights
^+ +> ^+ +>
=/ gob (fall (~(get by shy) pal) *jael-purse) =/ gob (fall (~(get by shy) pal) *safe)
=/ yer ^- (pair jael-delta jael-purse) =/ yer ^- (pair bump safe)
?- -.rem ?- -.rem
$& [[p.rem ~] (~(splice up gob) p.rem)] $& [[p.rem ~] (~(splice up gob) p.rem)]
$| [(~(differ up gob) p.rem) p.rem] $| [(~(differ up gob) p.rem) p.rem]
@ -1544,13 +1662,13 @@
=/ lyf `life`(need ~(current we (~(got by pug) rex))) =/ lyf `life`(need ~(current we (~(got by pug) rex)))
=* lab (~(got by pry) rex) =* lab (~(got by pry) rex)
=* par (~(got by lab) rex) =* par (~(got by lab) rex)
=/ jel `jael-right`(need (~(expose up par) %jewel)) =/ jel `rite`(need (~(expose up par) %jewel))
?> ?=($jewel -.jel) ?> ?=($jewel -.jel)
[lyf p.jel] [lyf p.jel]
:: :: ++lawn:ex:ur :: :: ++lawn:ex:ur
++ lawn :: liabilities to pal ++ lawn :: liabilities to pal
|= pal/ship |= pal/ship
^- jael-purse ^- safe
=-(?~(- ~ u.-) (~(get by shy) pal)) =-(?~(- ~ u.-) (~(get by shy) pal))
:: :: ++next:ex:ur :: :: ++next:ex:ur
++ next :: advance private key ++ next :: advance private key
@ -1566,10 +1684,10 @@
:: ::
=/ loy (pit:nu:crub 512 eny) =/ loy (pit:nu:crub 512 eny)
=* rig sec:ex:loy =* rig sec:ex:loy
=* ryt `jael-right`[%jewel [1 rig] ~ ~] =* ryt `rite`[%jewel [1 rig] ~ ~]
=* pub pub:ex:loy =* pub pub:ex:loy
=* cet `cert`[[doc pub] ~] =* cet `cert`[[doc pub] ~]
=* wyl `wyll`[[1 cet] ~ ~] =* wyl `will`[[1 cet] ~ ~]
=* hec `farm`[[rex wyl] ~ ~] =* hec `farm`[[rex wyl] ~ ~]
=. +>.$ (deal rex [[ryt ~ ~] ~]) =. +>.$ (deal rex [[ryt ~ ~] ~])
=. ..ex (meet [~ ~] hec) =. ..ex (meet [~ ~] hec)
@ -1582,7 +1700,7 @@
:: ::
vie/(unit (unit ship)) vie/(unit (unit ship))
cod/farm cod/farm
gur/wyll gur/will
== ==
?: |(=(~ gur) =(gur rug)) ..grow ?: |(=(~ gur) =(gur rug)) ..grow
|^ ^+ ..grow |^ ^+ ..grow
@ -1600,7 +1718,7 @@
^- (unit life) ^- (unit life)
?~(wap ~ ?:(=(1 p.i.wap) ~ `(dec p.i.wap))) ?~(wap ~ ?:(=(1 p.i.wap) ~ `(dec p.i.wap)))
=/ pre =/ pre
^- (unit deyd) ^- (unit deed)
(bind nem |=(life dat:(~(got by rug) +<))) (bind nem |=(life dat:(~(got by rug) +<)))
:: ::
:: merge each life :: merge each life
@ -1631,7 +1749,7 @@
|= {myn/mind ash/@ val/@} |= {myn/mind ash/@ val/@}
^- ? ^- ?
=: ..able able(rex who.myn) =: ..able able(rex who.myn)
gur (fall (~(get by cod) who.myn) *wyll) gur (fall (~(get by cod) who.myn) *will)
== ==
(grow-lick (grow-look lyf.myn) ash val) (grow-lick (grow-look lyf.myn) ash val)
:: :: grow-look/ex:ur :: :: grow-look/ex:ur
@ -1662,11 +1780,11 @@
:: ::
num/@ud num/@ud
new/cert new/cert
pre/(unit deyd) pre/(unit deed)
== ==
=+ :* eld=`(unit cert)`(~(get by rug) num) =+ :* eld=`(unit cert)`(~(get by rug) num)
== ==
^- (pair (list jael-edit) cert) ^- (pair (list change) cert)
:: ::
:: enforce artificial scarcity in lives :: enforce artificial scarcity in lives
:: ::
@ -1709,7 +1827,7 @@
:: sow: all new signatures :: sow: all new signatures
:: ::
=+ sow=`(list (trel ship life @))`(~(tap by syg.new)) =+ sow=`(list (trel ship life @))`(~(tap by syg.new))
|- ^- (pair (list jael-edit) cert) |- ^- (pair (list change) cert)
?~ sow [~ u.eld] ?~ sow [~ u.eld]
:: ::
:: mor: all further edits :: mor: all further edits
@ -1728,7 +1846,7 @@
?> (grow-like [p q]:i.sow ash r.i.sow) ?> (grow-like [p q]:i.sow ash r.i.sow)
:_ q.mor(syg (~(put by syg.q.mor) p.i.sow [q r]:i.sow)) :_ q.mor(syg (~(put by syg.q.mor) p.i.sow [q r]:i.sow))
:_ p.mor :_ p.mor
`jael-edit`[%fact rex vie num `jael-grow`[%sign [[p q] r]:i.sow]] `change`[%fact rex vie num `growth`[%sign [[p q] r]:i.sow]]
:: ::
:: non-initial deeds must be signed by previous :: non-initial deeds must be signed by previous
:: ::
@ -1797,7 +1915,7 @@
:: ::
:: lex: all durable %jael state :: lex: all durable %jael state
:: ::
=| lex/jael-state =| lex/state
|= $: :: |= $: ::
:: now: current time :: now: current time
:: eny: unique entropy :: eny: unique entropy
@ -1817,10 +1935,10 @@
:: hic: event data :: hic: event data
:: ::
hen/duct hen/duct
hic/(hypo (hobo jael-task)) hic/(hypo (hobo task))
== ==
=> .(q.hic ?.(?=($soft -.q.hic) q.hic ((hard jael-task) p.q.hic))) => .(q.hic ?.(?=($soft -.q.hic) q.hic ((hard task) p.q.hic)))
^- {p/(list jael-move) q/_..^$} ^- {p/(list move) q/_..^$}
=^ did lex abet:~(call of [now eny] lex) =^ did lex abet:~(call of [now eny] lex)
[did ..^$] [did ..^$]
:: :: ++doze :: :: ++doze
@ -1837,7 +1955,7 @@
++ load :: upgrade ++ load :: upgrade
|= $: :: old: previous state |= $: :: old: previous state
:: ::
old/jael-state old/state
== ==
^+ ..^$ ^+ ..^$
..^$(lex old) ..^$(lex old)
@ -1872,6 +1990,6 @@
hen/duct hen/duct
hin/(hypo sign-arvo) hin/(hypo sign-arvo)
== ==
^- {p/(list jael-move) q/_..^$} ^- {p/(list move) q/_..^$}
[~ ..^$] [~ ..^$]
-- --