2

When an input redeems a P2PKH output (pay to an address starting with a 1), the format of the input script (the scriptSig) is: [signature] [public key]. Because public keys are included in both standard input scripts (redeeming P2PKH outputs) and output scripts (P2PK), the Script.getPubKey() method has been written to return the public key in either input ...


2

Yes, you can encrypt the wallet It’s a good idea to encrypt your private keys if you only spend money from your wallet rarely. The Wallet.encrypt("password") method will derive an AES key from an Scrypt hash of the given password string and use it to encrypt the private keys in the wallet, you can then provide the password when signing transactions or to ...


2

I'm not an expert in this field by any means (and my error message was different), but I spent last week trying to make Bitcoinj sign a transaction and send in raw form (i.e. without using transport protocol which Bitcoinj provides) and here's what I've learned (the hard way): You can't sign transactions like that. If you call tx.addSignedInput in a loop, ...


2

Sounds like a watching wallet, but you need to save the wallet file as well as you're saving spv file. As per documentation


2

I was able to resolve the issue. public static String estFee(String amount, String receiver, WalletAppKit kit, NetworkParameters params){ try { String value2 = String.format("%.8f",Double.parseDouble(amount) * MainPage.handleFee); //String value1 = String.format("%.8f",Double.parseDouble(amount) - Double.parseDouble(value2)); ...


1

In case some one want to implements compression in their code: private static final String EVEN = "02"; private static final String ODD = "03"; public String compressPublicKey(String toCompress) { if (Integer.parseInt(toCompress.substring(128, 130), 16) % 2 == 0) return EVEN + toCompress.substring(2, 66); return ODD + toCompress.substring(...


1

Your signatures don't verify because in JCE you are using algorithm SHA256withECDSA which hashes the supplied data (re-hashes, since you are supplying a hash) before doing the kG.x,kinv(h+rd) computation, or the similar verification computation, whereas the spongy/bouncy ECDSASigner used in bitcoinj only does the latter, assuming the input is already the ...


1

Bytecode version 55 is Java 11. The JavaFX from openjfx that you are using was compiled with Java 11, but you are compiling with Java 8. Java 8 already includes JavaFX, so you don't have to add it via maven from openjfx. So you can either upgrade to OpenJDK Java 11, or remove the openjfx dependency from your project.


1

Bitcoin transactions don't have a sender's address. What you're doing is inferring what address previously controlled some or all of the funds involved in the transaction. But: Previously controlling the funds doesn't mean you found the sender. In case the coins were held by a custodial exchange, the address will be the exchange, and not the sender of the ...


1

A couple comments from inspecting the Transaction data you posted. 1) I checked the UTXO you are spending from, which is UTXO 9e7562d19165077d566af47bfbc18283629ed6799da8862660dfb037c353de11 Index 0 However, your transaction input is currently referencing the following UTXO: c33858b433ef445db35a84daa4da772895df7f03af4b31f21cfa199ea1c017d9 Index 0 Which ...


1

Changed Address My address has changed OK, your problem is that your address has changed. "My address" "My address" implies to me that you probably only have one address, otherwise you would probably have written "one of my addresses". It also implies that the address is associated with a person not with a wallet or private-key etc. I expect that ...


1

After searching for a while I found this type that takes a private key (in base58), required network parameters, and constructs the public address. Please refer: DumpedPrivateKey. This was enough for me at least. I construct an address from the key so formed using the toAddress method exported from the type key. DumpedPrivateKey vanityKey = DumpedPrivateKey....


1

Use WalletAppKit this class is Utility class that wraps the boilerplate needed to set up a new SPV bitcoinj app. Instantiate it with a directory and file prefix, optionally configure a few things, then use startAsync and optionally awaitRunning. i created the wallet and send the coins using your the faucet you have mentioned and its works fine and ...


1

I have write this sample code, hope this helps public class Main { private static NetworkParameters params = NetworkParameters.testNet3(); public static void main(String...args) { String mnemonic = "brisk wood symptom party betray ozone dad super beyond sea memory power pig business extra"; DeterministicSeed seed = null; try {...


Only top voted, non community-wiki answers of a minimum length are eligible