Skip to content

Commit

Permalink
clean up and todos
Browse files Browse the repository at this point in the history
  • Loading branch information
gus-opentensor committed Aug 26, 2024
1 parent 722c9e9 commit 4987d39
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,17 @@ To build and test the Rust components of the project, you can use the following
* `import btwallet`


# TODO
* password for encrypting the wallet
* create coldkey
* wrap signing into a fn and expose to python
using - create_hotkey, use sr25519::Pair =
derive_sr25519_key(&seed, &derivation_path).expect("Failed to derive sr25519 key"); to sign a message
ex:
let keypair = create_hotkey(mnemonic, "hello"); // we will need to return the keypair from create_hotkey
let signature = keypair.sign(message);





8 changes: 4 additions & 4 deletions src/keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ pub struct Keypair {

fn serialized_keypair_to_keyfile_data(keypair: &Keypair) -> Vec<u8> {
let json_data = json!({
"accountId": keypair.public_key.as_ref().map(|pk| format!("0x{}", hex::encode(pk))),
"publicKey": keypair.public_key.as_ref().map(|pk| format!("0x{}", hex::encode(pk))),
"privateKey": keypair.private_key.as_ref().map(|pk| format!("0x{}", hex::encode(pk))),
"accountId": keypair.public_key.as_ref().map(|pk| format!("{}", hex::encode(pk))),
"publicKey": keypair.public_key.as_ref().map(|pk| format!("{}", hex::encode(pk))),
"privateKey": keypair.private_key.as_ref().map(|pk| format!("{}", hex::encode(pk))),
"secretPhrase": keypair.mnemonic.clone(),
"secretSeed": keypair.seed_hex.as_ref().map(|seed| format!("0x{}", hex::encode(seed))),
"secretSeed": keypair.seed_hex.as_ref().map(|seed| format!("{}", hex::encode(seed))),
"ss58Address": keypair.ss58_address.clone(),
});

Expand Down

0 comments on commit 4987d39

Please sign in to comment.