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

Add option to create wallet from seed or audit key #164

Merged
merged 13 commits into from
Sep 13, 2024

Conversation

aguycalled
Copy link
Collaborator

@aguycalled aguycalled commented Aug 7, 2024

This PR adds the option to create a wallet from a master key or an audit key. The master key of a wallet can be obtained using the RPC command getblsctseed; while the audit key can be obtained with getblsctauditkey.

Two options to create a wallet:

  • Using the navio-wallet tool together with the option seed. Example:
    navio-wallet -blsct -chain=blsctregtest -wallet=wallet_name -seed="71187dc33c03914c630e87b205777d51f7bd2749bc1164795e0134544d43d9ee" create
  • Using the rpc command createwallet. Example:
    navio-cli --blsctregtest -named createwallet wallet_name=wallet_name blsct=true seed="71187dc33c03914c630e87b205777d51f7bd2749bc1164795e0134544d43d9ee"

mxaddict
mxaddict previously approved these changes Aug 9, 2024
Copy link
Collaborator

@mxaddict mxaddict left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good

@aguycalled
Copy link
Collaborator Author

Working for me:

# sudo -u navio navio-wallet -blsct -testnet -wallet=w -seed= 6af514afff0602109742d6d818d607fa5242d7b6af514afff0602109742d6d818d60 create
Topping up keypool...
Wallet info
===========
Name: w
Format: sqlite
BLSCT: yes
Descriptors: no
Encrypted: no
HD (hd seed available): yes
Keypool Size: 64
Transactions: 0
Address Book: 0
# sudo -u navio navio-cli loadwallet w
{
  "name": "w"
}
# sudo -u navio navio-cli -rpcwallet=w getblsctseed
6af514afff0602109742d6d818d607fa5242d7b6af514afff0602109742d6d818d60
# sudo -u navio navio-cli -named createwallet blsct=true wallet_name=w2 seed=6af514afff0602109742d6d818d607fa5242d7b6af514afff0602109742d6d818d60
{
  "name": "w2"
}
# sudo -u navio navio-cli -rpcwallet=w2 getblsctseed
6af514afff0602109742d6d818d607fa5242d7b6af514afff0602109742d6d818d60

@aguycalled aguycalled changed the title Add option to create wallet from seed Add option to create wallet from seed or audit key Aug 9, 2024
mxaddict
mxaddict previously approved these changes Aug 10, 2024
Comment on lines -989 to -994
GetMockableDatabase(wallet).m_pass = false;
mtx.vin.clear();
mtx.vin.emplace_back(good_tx_id, 0);
BOOST_CHECK_EXCEPTION(wallet.transactionAddedToMempool(MakeTransactionRef(mtx)),
std::runtime_error,
HasReason("DB error adding transaction to wallet, write failed"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what this was testing, would like to know more if you can explain

@aguycalled aguycalled merged commit 0f72696 into master Sep 13, 2024
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants