Skip to content

Commit 4987d39

Browse files
clean up and todos
1 parent 722c9e9 commit 4987d39

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,17 @@ To build and test the Rust components of the project, you can use the following
6363
* `import btwallet`
6464

6565

66+
# TODO
67+
* password for encrypting the wallet
68+
* create coldkey
69+
* wrap signing into a fn and expose to python
70+
using - create_hotkey, use sr25519::Pair =
71+
derive_sr25519_key(&seed, &derivation_path).expect("Failed to derive sr25519 key"); to sign a message
72+
ex:
73+
let keypair = create_hotkey(mnemonic, "hello"); // we will need to return the keypair from create_hotkey
74+
let signature = keypair.sign(message);
75+
76+
77+
6678

6779

src/keypair.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ pub struct Keypair {
3333

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

0 commit comments

Comments
 (0)