Derive the owner seed, and all other seeds, from "master seed"

This commit is contained in:
Fang 2018-10-24 16:31:40 -07:00
parent 75800ef997
commit ad9bd39db0
2 changed files with 14 additions and 12 deletions

View File

@ -30,36 +30,31 @@
::
++ full-wallet-from-ticket
|= [ticket=byts sis=(set ship) pass=(unit @t) revs=revisions]
=+ owner-seed=(argon2u ticket)
(full-wallet-from-seed owner-seed sis pass revs)
::
++ full-wallet-from-seed
|= [owner-seed=@ux sis=(set ship) pass=(unit @t) revs=revisions]
=+ master-seed=(argon2u ticket)
=+ dr=~(. sd pass)
=+ cn=|=([s=@ m=meta] (child-node-from-seed s m pass))
::
:- ^= owner ^- node
:+ *meta owner-seed
(wallet:dr owner-seed)
(cn master-seed "owner" owner.revs ~)
::
:- ^= delegate
(cn owner-seed "delegate" delegate.revs ~)
(cn master-seed "delegate" delegate.revs ~)
::
=/ manage=node
(cn owner-seed "manage" manage.revs ~)
(cn master-seed "manage" manage.revs ~)
:- manage=manage
::
:- ^= transfer
%- ~(rep in sis)
|= [s=ship n=nodes]
%+ ~(put by n) s
(cn owner-seed "transfer" transfer.revs `s)
(cn master-seed "transfer" transfer.revs `s)
::
:- ^= spawn
%- ~(rep in sis)
|= [s=ship n=nodes]
%+ ~(put by n) s
(cn owner-seed "spawn" spawn.revs `s)
(cn master-seed "spawn" spawn.revs `s)
::
^= network
%- ~(rep in sis)

View File

@ -13,5 +13,12 @@
::
+= keypair [public=@ux secret=@ux]
::
+= revisions [transfer=@ud spawn=@ud delegate=@ud manage=@ud network=@ud]
+= revisions
$: owner=@ud
transfer=@ud
spawn=@ud
delegate=@ud
manage=@ud
network=@ud
==
--