Questions tagged [bitcoinj]

Bitcoinj is a Java implementation of the Bitcoin protocol, which allows it to maintain a wallet and send/receive transactions without needing a local copy of Bitcoin Core.

bitcoinj is a implementation of the protocol, which allows it to maintain a wallet and send/receive transactions without needing a local copy of Bitcoin Core. It comes with full documentation and some example apps showing how to use the library.

Features:

  • Connect to the P2P network and download/parse/verify the block chain.
  • Highly optimised lightweight simplified payment verification (SPV) mode. In this mode, only a small part of the block chain is downloaded and verified, making bitcoinj suitable for usage on constrained devices like laptops, smartphones or cheap virtual private servers.
  • SPV wallets can sync with the blockchain in seconds, even from a cold start.
  • Experimental full verification mode, which does the same verification work as Bitcoin Core. In this mode, the unspent transaction output set (UTXO set) is calculated and, thanks to a PostgreSQL store, can be indexed into a database allowing for fast lookup of balance by address.
  • A wallet class with encryption, fee calculation, pluggable coin selection/coin control policies, extensions support and event listeners that let you stay up to date with changes in your balance.
  • Easily implement apps that use Bitcoin's contracts features.
  • Support for micropayment channels that let you set up a multi-signature contract between client and server, and then negotiate over how much value is sent on the channel, allowing rapid and fast micropayments that avoid miner fees.
  • Provides both async and thread-per-connection for network IO, allowing you to choose between scalability and blocking-only features like / proxying.
  • Strong BitcoinStandards support.
  • Command line tool for working with wallet and chain files.
  • Example apps, thorough API documentation and articles explaining the design and layout of the library.

Home Page: https://code.google.com/p/bitcoinj/

GitHub: https://github.com/bitcoinj/bitcoinj

86 questions
2
votes
1 answer

Using zCash through BitcoinJ

Using zCash with BitcoinJ seems a reasonable advance for me, since I need to monitor various currencies for an academic project. Currently I run a full node with zCash along with BitcoinJ for Bitcoin and Litecoin using network params from the…
barfoos
  • 706
  • 2
  • 12
  • 26
2
votes
3 answers

Reading & Parsing Blockchain DAT files

I'm working on some code that reads the DAT files in the Blockchain, and I was trying to use bitcoinj because it seemed fairly straightforward. However, I can't seem to get it to actually read the blocks within the DAT file. I've tried many…
cgivre
  • 513
  • 4
  • 21
2
votes
1 answer

Right way to make payment via bitcoinj

I am trying to make transaction via bitcoinj (version 0.14.3) and i am expecting to get change back after payment. I am working with testnet, it's not real bitcoins. I have next code: Transaction tx = new Transaction(this.networkParameters); Coin…
yar_resh
  • 41
  • 5
2
votes
0 answers

Bitcoin poisson density into code

The following is from the Bitcoin whitepaper. The goal was to calculate the probability (P) an attacker could get lucky and override z number of blocks with q is the percentage of the network in control. I'm interested in moving backwards from…
kiaraRobles
  • 587
  • 1
  • 4
  • 14
2
votes
0 answers

Cloud SQL/MySQL, App engine and bitcoinj

I'm developing a web app that uses app engine (java) as a backend. I need the backend to listen for received transactions and broadcast transactions on the bitcoin network. I have bitcoinj set up to handle this functionality but I can't seem to get…
kreshendo
  • 384
  • 2
  • 18
2
votes
2 answers

Android UI freeze when service is downloading progress

I'm using the library bitcoinj to create a Android wallet. The case is that I want the blockchain to be downloaded in the background so that the user can start using the other features of the app, but when it starts the download and opens a new…
Ander Acosta
  • 1,060
  • 1
  • 12
  • 25
2
votes
1 answer

bitcoinj Connect P2SH input transaction to the output transaction

I have created P2SH address and send coins to the address https://www.blocktrail.com/tBTC/address/2N8Xu6rNAwssXtP2XPjSTuT2ViWQoPeHr3r Next I want to send coins from 2N8Xu6rNAwssXtP2XPjSTuT2ViWQoPeHr3r address. How to prepare P2SH transaction and…
mmm mmm
  • 37
  • 2
2
votes
1 answer

Bitcoinj will not compile onto Nexus 5 with Android Studio

I am building an app using Bitcoinj and I am trying to run it on a Nexus 5. When using grade to build Bitcoinj - compile 'org.bitcoinj:bitcoinj-core:0.12' - and subsequently running the app on the phone, I receive this error... "Failure…
2
votes
2 answers

bad apk when using bitcoinj from maven central

I just tried to switch from a local bitcoinj jar to a version pulled from maven central and face a strange problem. The resulting apk's device compatibility marking is broken. this section shows the change I tried: // compile…
ligi
  • 39,001
  • 44
  • 144
  • 244
2
votes
1 answer

Watch address with bitcoinj

I'm trying to use bitcoinj as a simple address watcher. I'm using WalletAppKit, into which I add address: Address address = new Address(params, "mu69XXXYYYZZZggrHgaH"); kit.wallet().addWatchedAddress(address); I used ForwardingService as an example…
shmoula
  • 1,053
  • 2
  • 10
  • 33
1
vote
3 answers

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 = "KyyJ5vVWjZck5nsAgDWvoN1u7Q8qp5FzE8WiCq97MbnRgdLesqJZ"; NetworkParameters…
Lakshitha Kanchana
  • 844
  • 2
  • 12
  • 32
1
vote
1 answer

What exacly is BITCOIN_SEED_NONCE in Bitcoin Source code?

I'm studing blockchain and I'm curently looking at how to DNS Seed Nodes work. I understand that crawler grabs nodes via magic messages but I can't figure out where one value came from Bitcoin source code and what is use of it. #define…
Madiator2011
  • 141
  • 4
1
vote
2 answers

getting wallet balance using BitcoinJ

I am trying to get a wallet balance using BitcoinJ, this is the code i am trying but it always returns 0 BriefLogFormatter.init(); NetworkParameters params ; String net = "testnet"; //choosing network if (net.equals("testnet")) {params =…
EAOE
  • 65
  • 6
1
vote
1 answer

BitcoinJ Request Specific Amount

I'm a java developer implementing bitcoinj in an app that I'm currently working on. However, I could not find an option to specify the amount when creating a receive address. Is it possible, and if possible, how can I do it.
DSA User
  • 11
  • 3
1
vote
1 answer

How to use NativeSecp256k1 wrapper from Bitcoinj in Android?

As I understand bitcoinj library contains wrapper for bitcoin-core functions - NativeSecp256k1. I am trying to call one of methods from this wrapper: NativeSecp256k1.secKeyVerify(byteArrayOf(...)) But I got a crash:…
BArtWell
  • 4,176
  • 10
  • 63
  • 106