Skip to content

Commit

Permalink
keys: only in debug mode now because of address bug (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiebee authored May 27, 2024
1 parent 737c248 commit 63cd12a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
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

0 comments on commit 63cd12a

Please sign in to comment.