Questions tagged [bitcoinj]

A Java library for processing Bitcoin, stores blockchain headers only

Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

Generate P2SH bitcoin address from WIF in BitcoinJ Java

I'm trying to create P2SH-Segwit bitcoin address from the WIF private key. I'm using the BitcoinJ library in Java. See the following code. String base58PrivateKeyString = "...
0
votes
0answers
10 views

Bitcoinj Doesn't increase wallet value

this is the initialization of wallet and block and PeerGroup : Wallet wallet = new Wallet(params, KeyChainGroup.createBasic(params)); BlockChain chain = new BlockChain(params, wallet, new ...
0
votes
1answer
23 views

How to transform a private key into an ECKey?

I´d like to construct an ECKey from a hardcoded private key but it´s not working... First try If I run the code in this example the key import is working just fine. But since I actually want so send ...
0
votes
0answers
11 views

Error Starting bitcoincashj-core-0.14.7-bip47.3-bundled.jar PLS HELP

'''run: 08:47:53.543 [main] WARN org.bitcoinj.core.Context - Implicitly creating context. This is a migration step and this message will eventually go away. 08:47:53.543 [main] INFO org.bitcoinj.core....
1
vote
1answer
45 views

How to make transaction with many inputs and one output in BitcoinJ?

I'm trying to send all coins from my accounts (generated by HD Wallet) to one account with this code: fun sendAllFundsOnAddress(address: String) { val receiver = Address.fromString(params, ...
0
votes
1answer
26 views

Add bitcoin payments to java app using BitcoinJ

I need to add Bitcoin payment to my application using the BitcoinJ library, but I'm new to using Bitcoin. I have one thought To create a new address for each new user, but I don't know if this is the ...
0
votes
1answer
45 views

How to use bitcoinj to transfer btc from p2sh-p2wpkh

I wrote the code for transmitting btc from p2sh-p2wpkh based on the information I found, but when I tried to broadcast the original transaction in https://live.blockcypher.com/btc-testnet/pushtx/, an ...
0
votes
0answers
16 views

How to create signature for the payload (data)using private key in java with bitcoinj? [duplicate]

I have private key as 'cUN9LNcEC54HAbWAwUs6coPSc72TcQYzxf4qSqdHJPVKSapeHzFj' and payload as 'hello', now how to create the signature for this payload using private key in java with bitcoinj library? ...
1
vote
1answer
39 views

I encountered Signature is found in scriptCode exception when trying to make a BTC transfer

When I transferred a 0.001 BTC from miBEA6o6nZcaLZebR1dsDv4AMHRwJk1mbi to miV1sbmLM9fptRfWD5o8hs5L6ucUeJzmp5, the following error occurred: mandatory-script-verify-flag-failed (Signature is found in ...
0
votes
1answer
56 views

Is there a way to import bitcoin wallet into BitcoinJ?

I tried to create bitcoin wallet that could be available as from BitcoinJ as from standart desktop wallet client (Bitcoin.com client e.g.) but it seems that I don't get something important. I exported ...
1
vote
0answers
25 views

bitcoinj sendCoins method and Coin value

I'm trying to use bitcoinj to transfer the balance of the address derived from a random private key if that balance is non-zero. I generate the private key and derive the address fine, then I use ...
1
vote
1answer
150 views

How can I determine the address from a private key?

From the steps in the wiki, take this example private key: 0C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D When I import this into Electrum, I find these values: Address: ...
0
votes
0answers
26 views

Sign Multisignature Transaction with only 1 of the needed keys using BitcoinJ?

If I have an unsigned Raw Transaction whose inputs are from a multisignature wallet, can I sign the transaction with only of the N needed keys and having the output as raw transaction again using ...
0
votes
1answer
73 views

Create Raw Transaction in BitcoinJ offline starting from UTXO info

I would to create offline Raw Transaction (without signing it) in BitcoinJ. The information I know about the inout is UTXO's hash, index, amount, address, and script. I also know the receiver address ...
1
vote
0answers
19 views

(bitcoinj) How to determine which key/address to use to send funds?

I'm using Bitcoinj and am confused as to the numerous addresses it's generating. I want to be able to send funds from my wallet (for which I have my private and public key) but I am unsure as to what ...
0
votes
1answer
146 views

Importing bitcoinj mnemonic into electrum or deriving private keys from mnemonic

I am having a really hard time backing up my bitcoinj mnemonic and importing it somewhere else. I am backing up the mnemonic like so: Wallet wallet = Wallet.createDeterministic(params, Script....
0
votes
0answers
41 views

How to SignRawTransaction from p2sh with bitcoinj?

Looking for demo to signrawtransaction from p2sh with bitcoinj!!! This is bitcoinj code: org.bitcoinj.core.Transaction public TransactionInput addSignedInput(TransactionOutPoint prevOut, Script ...
0
votes
0answers
38 views

How to get transaction info by hash using bitcoinj?

I have a transaction hash (transaction does not belong to my wallet). How can I get information about this transaction through bitcoinj API? I need information like: number of confirmations sender &...
1
vote
1answer
32 views

getheaders request being ignored by peers [closed]

It seems my 'getheaders' request is being ignored by peers. I've followed the implementation: https://en.bitcoin.it/wiki/Protocol_documentation#getheaders without success. If I change it to 'getblocks'...
0
votes
0answers
112 views

Bad witness error in P2SH-P2WSH

I've managed to build a P2SH 2-of-3 multisig contract that works, ie I can create addresses, send coins to them, and spend the outputs. Now I'd like to transition that solution to a P2SH-P2WSH, but I'...
1
vote
1answer
60 views

Fail to sign the Segwit Transaction's input in bitcoinj

I want to spend from a segwit address and it has a P2WPH script, I created this transaction just like creating a normal P2PKH transaction, but just changed the address of the input to the segwit ...
1
vote
0answers
34 views

How to sign a 2-of-2 multisig address?

I want to implement 2-of-2 multisig in bitcoinj, and I implement the methods which are used to sign the first time and the second time. But there is a bug that using the same key for the first signing ...
0
votes
1answer
57 views

Error message still returned after transaction was indeed broadcast

I use bitcoinj to create the following method to broadcast a raw transacion in testnet, and I did see on bitcoin explorer that it has been broadcast. But even the transaction has been already ...
0
votes
1answer
112 views

How can I create the input of raw transaction through the previous UTXO hash and the unspent index in bitcoinj?

I want to create a raw transaction’s input and output, and sign it then broadcast to testnet. Now I know how to create the output, but I want to refer the transaction that I can input the UTXO hash ...
1
vote
0answers
103 views

Missing input returned from sendrawtransaction on P2SH multisig?

I'm playing around on regtest to build a flow for P2SH multisig. I'm getting "missing inputs" back from the sendrawtransaction RPC call, but I see inputs when I put it in a decoder. They each have a ...
0
votes
1answer
46 views

BITCOINJ: how to make my wallet aware again about change of my transaction status after my server restart?

Using bitcoinj, my server created a transaction and it was broadcasted on the blockchain. I can get its history using: walletAppKit.wallet().getTransaction(txHash) It is in Pending state. Then I ...
0
votes
1answer
150 views

spend from p2sh with bitcoinj

i am try to spend the coins on a p2sh first, i generate p2sh and send coins to that p2sh ECKey clientKey = new ECKey(); ECKey serverKey = new ECKey(); ECKey thirdPartyKey = new ECKey(); List<...
1
vote
1answer
347 views

How to verify a signed message by bitcoin core?

I want to verify, in Java, a signature produced with bitcoin core's signmessagewithprivkey (equivalent to the verifymessage). I noticed a bitcoinj method similar to the bitcoin core's verifymessage - ...
1
vote
0answers
54 views

How to implement 2/2 multi-signature transactions with bitcoinj

I am using bitcoinj to implement a 2/2 multi-signature transaction. Now I want to use bitcoinj to generate a 2/2 multi-signature address and its corresponding Redeem Script through the public keys of ...
0
votes
0answers
130 views

How to communicate with Bitcoin core 0.17 using bitcoinj for hd wallet creation?

Hi am building one hobby project and i want to perform some operations in my own bitcoin core 0.17 by using bitcoinj lib. so is there any way by which we can use bitcoin-core 0.17,bitcoinj for hd ...
0
votes
0answers
71 views

Create P2SH address is not same as address saved on rpc node

I have a private key and trying to create P2SH address on testnet like my node created but they're not same. Please help me a bit, thanks so much. PrivateKey: ...
0
votes
1answer
171 views

How to sign Bitcoin transactions using JCE?

I need to sign Bitcoin transactions using JCE primitives(no bitcoinj), but my signatures are not considered valid by bitcoinj. I tried to simulate this process. I created a random hash and signed it ...
0
votes
1answer
41 views

could'nt run wallettemplate project in bitcoinJ

I just forked bitcoinj and took the wallettemplate folder outside the bitcoinj folder to run it i've followed the steps in "getting started" docs now im stuck in trying to run the wallettemplate i ...
2
votes
0answers
99 views

spend founds from p2wsh address,non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 64)

i want spent coin from p2wsh address on btc testnet3 network, i use bitcoinj 0.15.2 build transaction and sign it, use 2/3 multiSig when i send raw transaction by bitcoin core 0.17.0 command line by ...
0
votes
0answers
52 views

Importing the keys Issue

I imported the private keys into my wallet and they appear to be added: This is the result when i run getImportedKeys(): [ECKey{pub HEX=...
0
votes
1answer
567 views

How can I generate public address from an xpub key in Java?

I have an xpub key with which I want to generate all addresses which have been used or will be used and then find out the keys which have balance. Here's a sample xpubkey with balance- ...
0
votes
2answers
318 views

how to get the sender's address in bitcoinj

I'm trying to modify the simple wallettemplate to get the sender's address in the transaction list. However since TransactionInput.getFromAddress() doesn't exist now and getConnectedOutput()....
1
vote
1answer
70 views

When downloading the blockchain my application is become unusable, is there an issue with my code or am I using the BitcoinJ library incorrectly?

I am building a Bitcoin wallet with the BitcoinJ Library, after looking at the example of fetching a transaction that they have shown on their github it shows that you need to download the blockchain ...
1
vote
1answer
141 views

Errors when building/sending multisig transactions

Going by the example here: https://bitcoinj.github.io/working-with-contracts I believe I've done everything correctly. Yet my program fails either to propagate correctly or because of a tx error and ...
1
vote
1answer
615 views

bitcoinj java library not decoding input addresses for some transactions

I'm trying to "extract" sender's addresses from OP_RETURN Bitcoin transactions, but my code is not working properly. getWalletAddressOfSender(final Transaction tx) public static Address ...
0
votes
1answer
69 views

How to protect bitcoinj wallet?

I am a new BitcoinJ user, I have few questions related about its wallet, can anyone please help: Is there any way to encrypt the .wallet file? will anyone obtain a copy of the file be able to spend ...
1
vote
1answer
1k views

How do I sign and send a raw transaction using BitcoinJ?

Transaction transaction = new Transaction(params); // 遍历未花费列表,组装合适的item double sum = 0; String address = null; List<Unspent> unspents = new ArrayList<>(); Map<...
1
vote
0answers
37 views

What to pass in Transaction Input using Bitcoinj library

URGENT - Need help with setting up Transaction Input and Output objects Transaction rawTransaction = new Transaction(params); txnAmount = Coin.valueOf(50000000); rawTransaction.addOutput(txnAmount, ...
1
vote
0answers
50 views

library for light-weight wallet : btcsuite or BitcoinJ [closed]

Do btcsuite + Neutrino(Lightning-lab) together provide sufficient foundation for light client capable to service onchain transactions (not multisig & not related to Payment Channels)? Or is it ...
1
vote
1answer
229 views

Changed address

My address has changed but I'm showing 0.00mbtc. when I lookup the information on Blockchain it confirms 0.00 but then States the address has yet to be used on the network. I'm confused, please help.
0
votes
2answers
76 views

Adding an external key pair to a local bitcoinj wallet

I need to add a vanity address to a local wallet that I maintain using bitcoinj APIs. I'm not able to search for the vanity using bitcoinj APIs directly, on my local PC, because my vanity is too fancy....
1
vote
0answers
53 views

Bitcoinj Spend from a address directly without wallet

I am stuck trying to send coins from arbitary privateKey in bitcoinj. How can I make the following function work without using the Kit or Wallet classes? @Override public String transferCoin( ECKey ...
1
vote
1answer
522 views

Bitcoinj wallet can't receive coins in Testnet3

I have a problem with bitcoinj. I have created a wallet and than trying to send coins to it in Testnet3 using this faucet: https://coinfaucet.eu/en/btc-testnet/ Coins sended, transaction confirmed, ...
0
votes
1answer
267 views

Get private-keys from bitcoinj

I'm using bitcoinj library for bitcoin. I want all private keys of all my generated addresses. How can I achieve that? Please help who knows this answer. Thanks.
0
votes
1answer
124 views

Can't see balance after some time

I'm trying to use bitcoinj library to receive bitcoin payments and monitor the balance on the address. My implementation is based on DeterministicKey watching public key. The code below is working ...

1
2 3 4 5 6