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
10
votes
1 answer

How can I get notified when money has been sent to a particular Bitcoin address on a local regtest network?

I want to programmatically detect whenever someone sends Bitcoin to some address. This happens on a local testnet which I start using this docker-compose.yml file. Once the local testnet runs, I create a new address using docker exec -it…
Glory to Russia
  • 17,289
  • 56
  • 182
  • 325
8
votes
0 answers

Generating a segwit address and private key with bitcoinj (paper wallet)

It is possible to generate a valid legacy bitcoin key pair with the following code which is using bitcoinj master branch: import org.bitcoinj.core.Address; import org.bitcoinj.core.DumpedPrivateKey; import org.bitcoinj.core.ECKey; import…
ccpizza
  • 28,968
  • 18
  • 162
  • 169
7
votes
1 answer

Generate Ethereum addresses in HD Wallet using public key only (bitcoinj/web3j)

I trying to generate Ethereum addresses for the HD Wallet keys implemented with bitcoinj library, but I got confused: DeterministicSeed seed = new DeterministicSeed("some seed code here", null, "", 1409478661L); DeterministicKeyChain chain =…
Andrew
  • 179
  • 2
  • 9
7
votes
2 answers

How can I receive notifications about new blocks using bitcoinj

I am trying to receive notifications about new blocks in the Bitcoin blockchain. I am using this code, but this prints hundreds of blocks from 2010 or so upwards. import org.bitcoinj.core.*; import org.bitcoinj.net.discovery.DnsDiscovery; import…
Ray Hulha
  • 10,701
  • 5
  • 53
  • 53
6
votes
1 answer

Recommeneded light weight Bitcoin library for an Android app

I am looking for a light weight Bitcoin library for an Android app. I basically need a Bitcoin library that lets me create a private/public key pair (or preferably a wallet with keys that can be serialized). To be able to set the most appropriate…
Amielix
  • 69
  • 1
  • 2
4
votes
1 answer

How to watch for transactions for an address in Bitcoinj (java)?

My goal is to watch a public bitcoin address and print to the console whenever money is sent to that address. That's all. I'm taking an address previously generated in Bitcoin Core, for now. I'm doing the following: NetworkParameters params =…
Coty
  • 143
  • 1
  • 11
3
votes
0 answers

How to send bitcoin offline or on localhost using bitcoinj liberary

I am developing a POC application where I will have multiple bitcoin wallets of different users. I am looking for any way to send bitcoin from one wallet to another wallet on localhost itself, without using network to avoid network fees. For better…
Abhishek
  • 648
  • 7
  • 8
3
votes
0 answers

Checking a wallet's balance (bitcoinj)

I am trying to create a p2p android wallet for bitcoin using bitcoinj. I created an address and added it as a wachedAddress in the wallet. When I add some coins from http://tpfaucet.appspot.com/ my listener shows me that 0.02 coins have been added…
Gutyn
  • 461
  • 4
  • 22
3
votes
1 answer

BitcoinJ: Is it possible to always use the same receive address?

I need to create a wallet that receives coins from a third party that never changes. Reading the wallet documentation, I've understood there is a method that returns the public receive address: Address address = wallet.currentAddress(); Then, the…
j3d
  • 9,492
  • 22
  • 88
  • 172
3
votes
1 answer

Sending Bitcoin to 2 addresses in one transaction?

I am new to Bitcoin network transactions understanding. Can I send Bitcoin to one address and another amount to another address within the same bitcoin transaction?
3
votes
0 answers

Creating wallets with bitcoinj and public key/address

I am new to Bitcoin and bitcoinj and would like to create 2 wallets and exchange some bitcoins among them. I went trough the tutorial on how to create a WalletAppKit using bitcoinj and I managed to create 2 wallets and transfer some test coins among…
Alex1987
  • 31
  • 1
3
votes
3 answers

Checking wallet balance with bitcoinj

I'm attempting to learn the bitcoinj API and I've written the test code below. I created an account on: http://tpfaucet.appspot.com/ so I can use fake coins and test sending/receiving. My account has 14 fake BTC's shown when I log in to the URL. …
Amir Afghani
  • 37,814
  • 16
  • 84
  • 124
2
votes
0 answers

How to send transactions from existing wallet with bitcoinj library?

We are trying to use bitcoinj 0.15.10 library to manage Bitcoin wallet. The problem we encountered is how do we connect existing wallet with our code so that we can make transactions. We have tried everything we could find in documentation and in…
2
votes
0 answers

Connect to custom bitcoin node with bitcoinJ

I have full bitcoin testnet core on my server and I am accessing it over dyndns address. I am creating Android bitcoin wallet bitcoinJ and now I am stuck with connecting to my server and using it for making transactions. Is there a way to use…
justStarting
  • 119
  • 1
  • 12
2
votes
1 answer

BitcoinJ generate address from private key

I'm facing an issue regarding generating address from private key. I got the master private key from electrum as well as from bitcoin core that is starts from xprv9s21xxxxxxxxxxxxxxxxxxxxxxxxxxxx in bitcoinJ: ECKey key=ECKey.fromPrivate(prv); // it…
Muhammad Saad
  • 713
  • 1
  • 9
  • 31
1
2 3 4 5 6