Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keys: only in debug mode now because of address bug #356

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/keys/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## THIS IS IN ALPHA WIP EXPECT RAPPID BREAKING CHANGES FOR NOW THIS IS A NOTES BUCKET

How "Key mangment should be done in the sdk"

the user hold onto the seed every class will create their own key via a set derivation path except for the device key. the derivation path for the device key should be by
Derivation Path

```ts
//store that private key

Expand Down Expand Up @@ -74,7 +77,6 @@ a program dev account does not need to be registered. Its main function is to de

can have all or any keys be


A note about verifying keys:

verifying keys are what is returned when a user registers an entropy account on chain this verifying key is what a signatures public key will be verified against. It is possible for a single entropy account to have many verifying keys so it is recommend that after registering an entropy account to store meta information about a particular configuration for example:
Expand Down Expand Up @@ -106,33 +108,27 @@ A seed is what we use to generate keys and a mnemonic is what a end user sees

generateMnemonic


generateSeed

mnemonicToSeed

seedToMnemonic
to present to end users a phrase


end user facing:

createEntropyAccount({seed, type: EntropyAccountType })



entropyAccountToSigner


```ts

/*this is pseudo code will not run if you try it*/

const storedAccount: EntropyAccountInfo = loadFromStorage()

const account: EntropyAccount = /*create a new account*/ createEntropyAccount(storedAccount)// or loads an account from storage
const account: EntropyAccount =
/*create a new account*/ createEntropyAccount(storedAccount) // or loads an account from storage
account.on('update', (fullAccountInfo) => persist(fullAccountInfo))

const entropy = new Entropy({ account })

```
5 changes: 3 additions & 2 deletions src/keys/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ export default class Keyring {
}

#formatAccounts (accounts: EntropyAccount): EntropyAccount {
const { seed, mnemonic, debug, type, admin } = accounts

const { seed, mnemonic, type, admin } = accounts
// this is because stuff is broken outside of debug mode so making it true always
const debug = true
const entropyAccountsJson = {
debug,
seed: seed ? seed : utils.seedFromMnemonic(mnemonic),
Expand Down