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

Fix for descriptors in setup_signet.sh #1

Open
benthecarman opened this issue Apr 6, 2023 · 1 comment
Open

Fix for descriptors in setup_signet.sh #1

benthecarman opened this issue Apr 6, 2023 · 1 comment

Comments

@benthecarman
Copy link
Contributor

benthecarman commented Apr 6, 2023

In setup_signet.sh it says that it is not working for descriptors. This is because when putting a private key in a descriptor it needs to be WIF encoded.

here is a bash script for converting

  # Descriptors take private keys in WIF format

  # Add the testnet prefix 'ef'
  prefix_key="ef$PRIVKEY"
  # Double sha256 hash of prefix key
  double_hash=$(echo -n $prefix_key | xxd -r -p | openssl sha256 | awk '{print $2}' | xxd -r -p | openssl sha256 | awk '{print $2}')
  # Take first 4 bytes of double hash as checksum
  checksum=${double_hash:0:8}
  # Append checksum to prefix key
  checksum_key="$prefix_key$checksum"
  # Convert the final key into base58 encoding
  WIF_KEY=$(echo -n $checksum_key | xxd -r -p | base58)
@rsafier
Copy link
Contributor

rsafier commented May 23, 2023

ref where descriptors appear to being used in mining (untested): https://github.com/BitPolito/bitcoin-testing-tools/blob/main/bitcoind_signet_miner_plugnplay/bitcoind-entrypoint.sh

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

No branches or pull requests

2 participants