Skip to content

Commit a1c8a07

Browse files
authored
Update seeds-with-envelope.md
1 parent 887cdfa commit a1c8a07

1 file changed

Lines changed: 42 additions & 7 deletions

File tree

_pages/seeds-with-envelope.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,37 +78,66 @@ ur:envelope/tpsotantjzoyadgdtburldbkjpjeclprcnwpfnsrcakkgdwmprkgvlzc
7878
### Examing a Seed Envelope
7979

8080
The envelope-cli will directly output the CBOR of an envelope for you:
81-
d8c8d8c9d99d6ca10150d6df890a726b21b223ec3cc31d7950eb
8281

82+
```
8383
% envelope format --type cbor $SEED_E
84+
d8c8d8c9d99d6ca10150d6df890a726b21b223ec3cc31d7950eb
85+
```
8486

87+
That can also be viewed with cbor2diag or with [cbor.me](https://cbor.me/):
88+
```
8589
SEED_E_CBOR=$(envelope format --type cbor $SEED_E)
86-
8790
cbor2diag -x $SEED_E_CBOR
8891
200(201(40300({1: h'd6df890a726b21b223ec3cc31d7950eb'})))
92+
```
93+
94+
That's now:
95+
* a envelope (CBOR tag 200)
96+
* With a single leaf (CBOR tag 201)
97+
* That contains a seed (CBOR tag 40300)
98+
* Which is still a map with one entry for key `1` (`{1:`)
99+
* Which is the seed `d6df890a726b21b223ec3cc31d7950eb`
89100

101+
One important difference between the UR Seed and the Envelope Seed is that the UR seed was preceded by `ur:seed`, so it did not need a CBOR tag for the seed. However, once it's an envelope, it now needs the CBOR tag of `40300` to define what that part of the envelope is. A particular element will self-identify with a CBOR tag (like `200` or `40300`) or a UR tag (like `ur:envelope` or `ur:seed`) but not both.
102+
103+
### Modifying a Seed
104+
105+
There are many advantages to having a seed in an envelope, rather than it being a bare seed. One advantage is that you can add metadata as assertions in the envelope (with the actual seed remaining the subject):
106+
```
90107
SEED_E=$(envelope assertion add pred-obj known note string "Zcash seed" $SEED_E)
108+
```
91109

110+
The seed now looks like this:
111+
```
92112
envelope format $SEED_E
93113
Seed [
94114
'note': "Zcash seed"
95115
]
116+
```
96117

97-
SEED_E_ENCPUB=$(envelope encrypt --recipient $PUBKEYS $SEED_E)
118+
### Encrypting a Seed
119+
120+
You can also encrypt an envelope, or rather you can encrypt the _subject_ of an evelope.
121+
122+
This demonstrates the generation of a
123+
124+
SKEY=$(envelope generate key)
125+
SEED_E_ENCS=$(envelope encrypt --key $SKEY $SEED_E)
98126

99-
envelope format $SEED_E_ENCPUB
100127
ENCRYPTED [
101-
'hasRecipient': SealedMessage
102128
'note': "Zcash seed"
103129
]
104130

105-
SKEY=$(envelope generate key)
106-
SEED_E_ENCS=$(envelope encrypt --key $SKEY $SEED_E)
131+
SEED_E_ENCPUB=$(envelope encrypt --recipient $PUBKEYS $SEED_E)
107132

133+
envelope format $SEED_E_ENCPUB
108134
ENCRYPTED [
135+
'hasRecipient': SealedMessage
109136
'note': "Zcash seed"
110137
]
111138

139+
140+
112141
envelope encrypt --recipient $PUBKEYS --recipient $PUBKEYS2 --key $SKEY $SEED_E | envelope format
113142
ENCRYPTED [
114143
'hasRecipient': SealedMessage
@@ -156,3 +185,9 @@ ENCRYPTED [
156185
'hasRecipient': SealedMessage
157186
'sskrShare': SSKRShare
158187
]
188+
189+
envelope sskr join
190+
ur:envelope/lstansfwlrhddwecheengronhhisesvshlrpzednprmkoehtrddrfgrsfgfgehdamefyjymehdrhhggrdwgtkkcabwfdzojeyahglugstllsykfncsjtwytpdtsbbdmhgdkimncafxpllgbkgojtmnvdtpdttdwtzehddatansfphdcxkpltendpolzcrtdickwmtpplmybbsnwefhinmntabzotlodirddkjlzsmdftztgaoyahtpsotansgulftansfwlshddasfvymnrlwncyueidmekiqdvwgtclledtnsmhcehhvwfyaologlfwhsvwlfvllevtpmiegduocngsuesspeolwefeamrlytaeptlogdeyisrdtkpsksjzbgcsgesoksmwhldygrtansgrhdcxstfzqzfhyadmlbimnnfpcxwtflmkrokkhedyfhhgsnlbtyaxlawsvezslnhhykgwoyamtpsotantkphddalrjzaeadaelaamcpktaogstpjnjkmyuooyhhsgospmonfyldrdjywpjzlgnbdiasrffgmoahosaxaxgwpf
191+
ur:envelope/lstansfwlrhddwecheengronhhisesvshlrpzednprmkoehtrddrfgrsfgfgehdamefyjymehdrhhggrdwgtkkcabwfdzojeyahglugstllsykfncsjtwytpdtsbbdmhgdkimncafxpllgbkgojtmnvdtpdttdwtzehddatansfphdcxkpltendpolzcrtdickwmtpplmybbsnwefhinmntabzotlodirddkjlzsmdftztgaoyahtpsotansgulftansfwlshddabsttwzgsgltbntwzgolnskidpakortrfltcldmdakedkntjpiypklggshseecafrutmwflwzhtgsbepfpenbrlwmhkqdluatgdlkgdadbwayfysedmtsdrweqdoxuttlgwtemktansgrhdcxtbnnssmenlsadihfurpdrogrdszemuprlbtkvanykibkswcwdibnrknegrtpuobwoyamtpsotantkphddalrjzaeadadcxtavtchadnbttehlnftkbntgrjnclnsynlovltlgrolcevddsgevezcsbmufyecadlpqzdl
192+
ur:envelope/lftpsotantjzoyadgdtburldbkjpjeclprcnwpfnsrcakkgdwmoyaatpsoimhtiahsjkiscxjkihihieguaturnb
193+

0 commit comments

Comments
 (0)