or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing
xxxxxxxxxx
Entropy Keyring Design
The purpose of the keyring is to:
Setup paths
Where it comes to instantiating a Keyring there are 3 major pathways we are designing to support
Here's a visualization of all the paths (see them broken down in sub-sections below):
Path A - first time user
This user is brand new to Entropy, they want to get set up and running.
Their flow looks like this:
In code:
Notes:
keyData
here is deterministic (mostly)mnemonicToKeyData
takes care ofmnemonic
=>seed
=>keyData
(programMod, developer, etc)keyData.device
is NOT derived from theseed
mnemonic
seed
seed
is used withpaths
to derive each key inkeyData
dev
key without revealing aprogramMod
keyQuestions:
keyData
… how, where?mnemonicToKeyData
?type
for a particular key(s)mnemonicToKeyData
addkeyData.device
?keyData.device
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →keyData
formatstype
secret
public
address
programMod
?- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →account
- we "register" an account, accounts have addresses (derived from this secret?), and account key being the one which can modify the account seems right?Path B - returning user
This path assume a user already has a working
keyData
they have read from persistence.Flow looks like this:
Notes:
keyData
is not necessarily the same as the data generated from mnemonic, it could be: user-created, e.g. I make some new data for a new device:- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →mnemonic
alone, as the determinism is brokenQuestions:
Path C - recovering
This path covers the case that a user has lost their setup, but has a record of their
mnemonic
.This flow looks like:
In code:
Notes:
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →keyData.device
is unique to every device, so:keyData
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →keyData
was custom in some way, this recovery path does not work (see Path B, Note 2)API
new Keyring(keyData: Keydata) => keyRing
keyring.json() => keyData
returns
keyData
for persistenceTODO: "get key"
Should be able to access:
signer
needed for creating extrinsicsShould NOT be able to access:
e.g.
TODO: "get ephemeral key"
creates a disposable key intended for singal use encryption while signing:
e.g.
Helper functions
generateMnemonic() => string
bip39, no password?
mnemonicToKeyData(mnemonic: string, opts) => keyData
KeyData
opts
(rename) is added to specify the keys + paths to derive, e.gisValidKeyData(keyData) => boolean
mix: we should write this early because it makes the number of checks we need to do
everywhere else soooo much lighter if we can tightly check data before ingesting
Other Concerns
Admin / Registration / Sponsorhips
are curent way of thinking is to have an admin key and registration key
the key that pays for registartion and the key that gets set as the programMod
they can be one in the same (infact they are right now)
however they can also be different. In my personal case i would want them to be different
i think also for "sponsorship" reason we should allow them to be different
init
should take all "3" seeds but only requires programMod i'm still stuck on this name
hot swap keyring?
should you be able to set a different keyring to an already initialized entropy?