Questions tagged [bitcoinj]

A Java library for processing Bitcoin, stores blockchain headers only

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

How to get UTXOs using Bitcoinj

I want to be able to create raw BTC transaction in Java. I'm using BitcoinJ library. And this raw transaction I will broadcast to blockchain. Here is my code: NetworkParameters params = ...
user avatar
0 votes
0 answers
8 views

bitcoinj startAsync() causes app to fail repeatedly

I have no experience with android programming. I am just trying to build a simple wallet. Following is the trial code: import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; ...
user avatar
0 votes
0 answers
20 views

pokkst/litecoinj message verification problem - Address.fromKey() returning wrong address

I have a problem with java library pokkst/litecoinj. I am using the regular bitcoinj library to verify signed messages with success. As pokkst/litecoinj is a fork of bitcoinj I have expected it to ...
user avatar
  • 101
0 votes
0 answers
26 views

Bitcoinj - Creating child public keys from a base 58 parent public key

We're trying to derive a list of child address public keys from a parent public key with path "m/44H/0H/0H". The parent public key is derived using the HD seed. Is this possible? Example ...
user avatar
0 votes
0 answers
250 views

How to create a Bitcoin wallet on a local testnet using bitcoin-cli?

I am trying to implement a business process in scope of which test BTC is sent to a particular address from Java using code like public void sendBtc(BigDecimal btcAmount, String targetBtcAddress) { ...
user avatar
1 vote
0 answers
146 views

Generating HD Wallet Addresses in Java Using Bitcoinj

Is there some method that can be used to get the address, private and public key for any type of supported coin in a HD wallet? I can correctly generate these for Ethereum, which I verified on https://...
user avatar
0 votes
0 answers
59 views

BitcoinJ Regtest : Error in addWallet & transaction fetch

I am trying bitcoinj for the first time. I tested a simple java program as follows: step 1: I install a Bitcoin Core and run the following bitcoind.exe -regtest -txindex –reindex bitcoin-cli.exe -...
user avatar
0 votes
0 answers
116 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 = "...
user avatar
0 votes
1 answer
231 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 ...
user avatar
  • 1
1 vote
1 answer
71 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, ...
user avatar
  • 13
0 votes
1 answer
92 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 ...
user avatar
1 vote
1 answer
174 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 ...
user avatar
0 votes
0 answers
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? ...
user avatar
1 vote
1 answer
65 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 ...
user avatar
0 votes
1 answer
74 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 ...
user avatar
1 vote
0 answers
47 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 ...
user avatar
1 vote
1 answer
372 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: ...
user avatar
0 votes
1 answer
219 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 ...
user avatar
1 vote
0 answers
21 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 ...
user avatar
0 votes
1 answer
241 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....
user avatar
1 vote
1 answer
56 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'...
user avatar
0 votes
0 answers
191 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'...
user avatar
  • 261
1 vote
1 answer
141 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 ...
user avatar
  • 31
1 vote
0 answers
46 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 ...
user avatar
  • 31
0 votes
1 answer
77 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 ...
user avatar
  • 31
0 votes
1 answer
244 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 ...
user avatar
1 vote
0 answers
131 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 ...
user avatar
  • 261
0 votes
2 answers
74 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 ...
user avatar
  • 1
0 votes
1 answer
245 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<...
user avatar
1 vote
1 answer
481 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 - ...
user avatar
  • 701
1 vote
0 answers
62 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 ...
user avatar
  • 31
0 votes
0 answers
145 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 ...
user avatar
  • 31
0 votes
0 answers
81 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: ...
user avatar
  • 13
0 votes
1 answer
231 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 ...
user avatar
  • 103
0 votes
1 answer
46 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 ...
user avatar
2 votes
0 answers
117 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 ...
user avatar
  • 21
0 votes
0 answers
60 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=...
user avatar
0 votes
1 answer
793 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- ...
user avatar
0 votes
2 answers
388 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()....
user avatar
  • 1
1 vote
1 answer
93 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 ...
user avatar
1 vote
1 answer
175 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 ...
user avatar
  • 13
1 vote
1 answer
802 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 ...
user avatar
  • 158
0 votes
1 answer
72 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 ...
user avatar
2 votes
1 answer
2k 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<...
user avatar
1 vote
0 answers
46 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, ...
user avatar
1 vote
0 answers
59 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 ...
user avatar
  • 11
1 vote
1 answer
243 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.
user avatar
  • 11
0 votes
2 answers
87 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....
user avatar
  • 111
1 vote
0 answers
57 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 ...
user avatar
1 vote
1 answer
553 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, ...
user avatar
  • 11

1
2 3 4 5 6