Questions tagged [bitcoinj]
A Java library for processing Bitcoin, stores blockchain headers only
251
questions
0
votes
0
answers
19
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 ...
0
votes
0
answers
22
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 ...
0
votes
0
answers
195
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) {
...
0
votes
0
answers
115
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://...
0
votes
0
answers
55
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 -...
0
votes
0
answers
94
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
0
answers
22
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
1
answer
205
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 ...
1
vote
1
answer
67
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
1
answer
84
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 ...
1
vote
1
answer
157
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
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?
...
1
vote
1
answer
60
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
1
answer
72
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
0
answers
44
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
1
answer
345
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
1
answer
192
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
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 ...
0
votes
1
answer
221
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....
1
vote
1
answer
55
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
0
answers
186
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
1
answer
131
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
0
answers
44
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
1
answer
74
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
1
answer
226
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
0
answers
128
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
2
answers
71
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
1
answer
226
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
1
answer
471
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
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 ...
0
votes
0
answers
144
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
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: ...
0
votes
1
answer
219
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
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 ...
2
votes
0
answers
114
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
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=...
0
votes
1
answer
773
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
2
answers
387
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
1
answer
92
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
1
answer
168
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
1
answer
790
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
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 ...
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<...
1
vote
0
answers
45
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
0
answers
56
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
1
answer
241
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
2
answers
85
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
0
answers
56
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
1
answer
551
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
1
answer
316
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.