Questions tagged [bitcoinj]

A Java library for processing Bitcoin, stores blockchain headers only

Filter by
Sorted by
Tagged with
2
votes
0answers
139 views

Specific fee in transaction

Is there any possible way to send transaction with specific fee (not fee per kb) from wallet in bitcoinj? Where should I look to find a solution :)? My code: Address address = Address.fromBase58(...
1
vote
0answers
83 views

Java bitcoinj: semantics of 'decompress' on encrypted key

Calling the decompress method on an encrypted ECKey object yields an ECKey object which has no private key (only public). I personally would have expected to get the same encrypted key in uncompressed ...
1
vote
0answers
60 views

Reorganize chain

BitcoinJ: Is is possible to get somehow transactions from ReorganizeListener in block chain? I'm able to get list of new blocks which are represented by StoredBlock but from StoredBlock I can't get ...
3
votes
4answers
929 views

How to set fee in bitcoinj

Is any possible way to set fee to specific value in bitcoinj wallet? Right now I have something like this and I don't know when to set fee: Address address = Address.fromBase58(params, ...
4
votes
1answer
3k views

How to create raw transaction

I've started creating my own wallet in bitcoinj and I have serious problem. I want to create raw transaction without wallet object. So I wrote this piece of code: //String to a private key ...
1
vote
1answer
311 views

How long does it take for a SPV to intermittently sync (order of magnitude)?

Say I have a device that is mostly offline, with a SPV on it. Say once in a while (for instance once a week) I go online for about 20 minutes, and make a large number of transactions (which are ...
1
vote
0answers
403 views

Can I quickly check the cofactor of secp256k1 is 1

I was wondering if there was a quick way to check that the group underlying the elliptic curve secp256k1 was indeed cyclic with the usual point G a generator. I am given the prime number underlying ...
2
votes
1answer
800 views

How do you create a transaction from a UTXO in BitcoinJ?

Is there a way to construct and send a transaction in BitcoinJ without a wallet? I just want to build my transaction from a utxo and broadcast it.
0
votes
0answers
35 views

Java bitcoinj: ECKey hashCode() and equals() overrides inconsistent

In my recent endeavor to learn Scala, reading the Scala book by Martin Odersky et al. I remember being struck by the emphasis placed by the authors on the difficulty of properly overriding the equals ...
2
votes
0answers
121 views

Java bitcoinj: Failure of getPrivateKeyEncoded or getKey?

I have the feeling something is not right with the method getPrivateKeyEncoded (which returns a DumpedPrivateKey object) of the ECKey class. If I attempt to recover the orginal key from the ...
1
vote
0answers
135 views

BitcoinJ - Master Key from 12 word

Is there any posibilities to: 1. Create deterministic seed from 12 or 24 word 2. Create Private Master key from this deterministic seed 3. Create deterministic wallet using private master key in ...
3
votes
1answer
1k views

How can I create a raw transaction in hex format with Bitcoinj?

How can I create a raw transaction when I'm given the input scripts, input indexes, input txids, output script, output address and output amount? The method below works but it requires the method ...
1
vote
1answer
554 views

Bitcoin mining algorithm - target - Java

Default share difficulty is 1 (big-endian target for difficulty 1 is 0x00000000ffff0000000000000000000000000000000000000000000000000000) How to calculate this? How it look like on Java code? What ...
1
vote
2answers
2k views

how can I hardcode a private key in bitcoinJ - ECKey constructor?

Can someone please explain how to use the following constructor (listed here): ECKey(BigInteger priv, org.spongycastle.math.ec.ECPoint pub) Say my private key is: priv = "L4...5". How do I get ...
0
votes
0answers
31 views

End of Mining intention [duplicate]

If every block generated all 10 Minutes to validate a transaction, and the last bitcoin will generated in 2140. And there is no limitation of blocks.. Whats after 2140, because all miner have no ...
1
vote
1answer
125 views

micropayment channels, n-m addresses, interoperability

I just read bitcoinJ's working with contracts tutorial and I am puzzled as: it seems to me that n-m addresses are implemented in Bitcoinj using plain multisig (as defined in this bit of the developer'...
1
vote
0answers
78 views

C++ Proofofworklimit to bitcoinj util.DecodeCompactBits

What is equivalent bitcoinj util.DecodeCompactBits for below c++. Cbignum(~uint256(0) >>32) Cbignum(~uint256(0) >>20) Cbignum(~uint256(0) >>23) Cbignum(~uint256(0) >>22)
3
votes
1answer
433 views

How to send money to set of recipients using bitcoinj

I am creating a wallet app using the bitcoinj library. I have a use-case where I need to send bitcoins to multiple recipients in one transaction. Currently, I am creating multiple send requests for ...
5
votes
1answer
412 views

How are Lightning network, duplex channels, and micropayment channels related?

I'm new to Bitcoin and just became familiar with Micropayment channels. But how exactly do they relate to: Lightning network Duplex Micropayment Channels ? I am reading about these but can't find a ...
4
votes
1answer
520 views

Transaction with `OP_RETURN` to a particular address

How do I formulate a transaction with OP_RETURN to a particular address using the bitcoinj library? SendRequest req; Transaction transaction = new Transaction(Main.getNetWorkParameters()); ...
1
vote
1answer
1k views

How to use the BIP-32 keys

I am trying to built an application that uses the BIP-32. But I am not sure on how to use it. I have a passphrase with which I generate the Derived Private Key and Derived Public Key. If I share my ...
2
votes
1answer
277 views

Get transaction details using bitcoinj library

I am trying to develop an application using bitcoinj library. I want to get the bitcoin transaction details. The details, that I want to extract from a transaction includes the following. 1) Who ...
2
votes
0answers
225 views

Editing bitcoinJ for Android Altcoin App

So there is an altcoin created by another party and i want to edit the bitcoin-wallet app for android so that it connects to the new network. Is it enough to edit core/params/MainNetParams.java in ...
2
votes
1answer
173 views

Not receving Bitcoins to my testnet wallet

I am running the bitcoinj wallettemplate on testnet3. I have this address miAKWcmebJ7TYyZCYUx54djHsatVGdNZA8 , I tried out some websites which sends me testnet coins (Faucet). But I am not receiving ...
1
vote
1answer
284 views

Connect to regnet from my WalletAppKit Android app

I'm developing a simple app to learn how to use the bitcoinj library. I'm using the WalletAppKit object to simplify the process and I'm following the official documentation. When developing I prefer ...
4
votes
0answers
851 views

BitcoinJ - How to Create a wallet properly. (seeds, etc…) [closed]

I'm learning this as fast as possible for a project. However the documentation, I find is lacking and/or not super super clear. That said, Using BitcoinJ, I would like to know how to do the following:...
4
votes
3answers
234 views

get any transaction in p2p manner using bitcoinj

I'm pretty sure bitcoinj is capable of downloading any Bitcoin transaction from P2P nodes by broadcasting GetDataMessage because that's what it does in the peer.downloadDependenciesInternal method. ...
1
vote
0answers
59 views

check if transaction is spendable in bitcoinj

Is there some kind of check if incoming transaction is normally spendable by the bitcoinj wallet? I mean to check if there is no time lock and it's not multisig or whatever can prevent receiver from ...
1
vote
0answers
244 views

How can you make bitcoinj not use change addresses?

My question is related to bitcoinj library but not limited by it. bitcoinj will create new change address after every transaction. It will manage them transparently, but let say I want to use this ...
1
vote
0answers
57 views

transaction limits with bitcoinj library

After brief look into bitcoinj library, I found out that wallet class keeps all transactions in one big hash map. That make me think about transaction limits of this library. How many transaction can ...
3
votes
1answer
465 views

how do I get list of all “used” addresses in bitcoinj

Bitcoinj generates receiving addresses on demand and change addresses after each transaction. So how do I list all receiving addresses ? I guess I have to deal with KeyChainGroup and BasicKeyChain. I ...
1
vote
1answer
1k views

How to get list of all transactions in bitcoinj wallet?

I configured bitcoinj library so I can connect to network, replay blockchain, create addresses, receive and send bitcoins. I using FullPrunedDatabase as block store. I'm still missing how to find ...
2
votes
0answers
93 views

Why does bitcoinj need block headers and how it gets transactions

From log files and database it's obvious, that bitcoinj downloads block headers for whole blockchain history. If I'm not mistaken, it's only 80bytes hash. Why do we need to do this. I understand ...
2
votes
1answer
433 views

How to get fee in a transaction with unconfirmed inputs in bitcoinj?

I am trying to get the fee of incoming transactions in a wallet with bitcoinj. At times it was the commission using Transaction.getFee(), but this was throwing NullPointerException. I got to do a ...
4
votes
1answer
126 views

With Mike Hearn quitting Bitcoin, what seems to be the future of bitcoinj?

Mike Hearn has apparently sold all his Bitcoins. So what is to be expected about the development of bitcoinj? (and Java based clients in general).
2
votes
0answers
136 views

Send BTC with attachment using BitcoinJ

is there an example of how using BitcoinJ send BTC with an attachment? Lets say I want to write to blockchain "Vaclav Bilek Born 1991". If I understand it correctly, its just about sending minimum ...
1
vote
1answer
621 views

Decrypt my private key using KeyCrypter

I am trying to decrypt my private key bytes using the KeyCrypter interface. But i do not know how to implement and call the decrypt() function. Initially i encrypt the bytes of my Private Key of my ...
1
vote
1answer
400 views

ECKey.ECDSASignature creation

I have my ECKey key. In order to create an ECDSASignature object with BitcoinJ, we have to call ECDSASignature mySignature = key.sign(Sha256Hash input). Is the Sha256Hash input my message? Or is it ...
3
votes
0answers
478 views

Creation of P2SH MultiSig Input Script

In the createP2SHMultiSigInputScript() function of BitcoinJ according to this: public static Script createP2SHMultiSigInputScript(@NullableList signatures,Script multisigProgram) Create a program ...
2
votes
0answers
328 views

Creation of <20-byte hash of redeem Script> in a P2SH Transaction

According to this example: Redeem Script: 2 PubKey1 PubKey2 PubKey3 PubKey4 PubKey5 5 OP_CHECKMULTISIG Locking Script: OP_HASH160 <20-byte hash of redeem script> OP_EQUAL Unlocking Script: Sig1 ...
2
votes
2answers
1k views

Encoding my Bitcoin Address with Base58 encoding

I am trying to convert my Bitcoin Address with BitcoinJ in order to look like a normal address such as this: 1J7mdg5rbQyUHENYdx39WVWK7fsLpEoXZy. I haven't found anything exept for the Base58.encode() ...
1
vote
1answer
369 views

Verifing the given R/S pair (signature) against a hash using the public key

According to this function: public boolean verify(Sha256Hash sigHash, ECDSASignature signature) { return ECKey.verify(sigHash.getBytes(), signature, getPubKey()); } I do not understand ...
1
vote
0answers
206 views

How to use MySQLFullPrunedBlockStore with bitcoinj-core-0.13-bundled.jar

Initailly i am using bitcoinj-core-0.12.2.jar and bitcoinj-tools-0.12.2.jar on my project.Now i updated it with bitcoinj-core-0.13-bundled.jar because i am assuming that bitcoinj-core-0.13-bundled is ...
0
votes
1answer
353 views

How to get the MPK using bitcoinj and how to generate the addresses using the MPK?

I am trying to get the MPK of a wallet using bitcoinj. Can I get the DeterministicSeed, which is the seed of the wallet and get the MnemonicCode of 12 words. But I can't get the MPK. As I can make it ...
0
votes
0answers
257 views

Bitcoin multisig tutorial

I have five private keys (of type java.math.BigInteger) called a, b, c, d, e. Please provide some code template for the following. Create an address that has "3-out-of-5" spendability for the above ...
1
vote
1answer
69 views

How is a transaction verified in a micropayment channel?

Let's say Alice opens a micropayment channel with Bob and sends $10 into the multi sig transaction. How do we know that Alice has those $10? Or are we taking the risk of her double spending it?
2
votes
1answer
164 views

Bitcoin transactions reserve more coins than needed

I have a JavaWebApp wich uses bitcoinj 0.13.2 for sending bitcoins from a wallet to a particular address in a TimerTask. When the job starts, every minute I send 10000 satoshis to the address. The fee ...
2
votes
1answer
170 views

Differences between MemoryBlockStore and SPVBlockStore

What are differences between MemoryBlockStore and SPVBlockStore in bitcoinj? Which should be used for downloading the blockchain and why? Can I use same SPVChain format file for all wallets?
3
votes
2answers
790 views

Bitcoinj: Multiple wallets

In my Java application I am now required to handle multiple bitcoin wallets (HD wallets?). This means sending and receiving BTC. Unfortunately bitcoin is quite new for me, so there are some questions: ...
5
votes
2answers
476 views

SPV Bloom filter construction, are false positives taken from the blockchain or just due to matching with other addresses

It is my understanding that the false positive addresses generated by an SPV bloom filter do not need to necessarily be on the blockchain (ie. be addresses that have been used already). Is that a ...