Sunday, December 22, 2024

javascript – Tips on how to use BlockCypher’s check community with BitcoinJS-lib?

Making an attempt to make a PSBT by way of BitcoinJS-lib.

I am utilizing BlockCypher’s inner testnet (bcy/check) as a result of I’ve no selection: actually each different testnet faucet I examined was damaged.

Utilizing BlockCypher’s API to make new addresses, they provide you an handle, personal, public and wif

(their documentation does not point out the wif, however it does certainly give one…)

This is an instance response

{
  "personal": "9125ea9f573e23ce178d98cc2ec2a78655bd030c14b525729a026d6570b411c8",
  "public": "03f1fbc34305c61d7638c449030c32a66eb36726c208fca9962923a98ca75d77fe",
  "handle": "C1E96vE5GvKd5kXU4T4hhF6QioZzACrmdD",
  "wif": "BtCBNtS2noEXwm4rJi9nyiVbmZJMR9CEBMbF5Uz6JTSaR9EQn8jS"
}

Nevertheless none of this data is usable on it is personal as a result of the signal features of BitcoinJS-lib anticipate a Signer (KeyPair) class object.. giving it a non-public key on it is personal does not work.

i.e. psbt.signInput(0, privateKey); ends in: Error: Want Signer to signal enter

I attempted to make a KeyPair out of a WIF, however as a result of BitcoinJS-lib lacks the bitcoin.networks configuration applicable for bcy/check it at all times fails to resolve..

ECPair.fromWIF(wif, bitcoin.networks.testnet); // Error: Invalid community model
ECPair.fromWIF(wif, bitcoin.networks.important); // Error: Invalid community model
ECPair.fromWIF(wif); // Error: Invalid community model

The error message suggests the WIF shouldn’t be attainable on these tried networks.

How do I make a KeyPair for bcy/check ?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles