7 votes
Accepted

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

Hopefully, bitcoinj will now be maintained by other people that based projects on it. From what I've read and the commit list it seems that Andreas Schildbach, who also initiated the Bitcoin Wallet ...
  • 65.4k
7 votes
Accepted

How to sign raw transaction given a private key and SHA hash (in java)

This answer does not attempt to sign a transaction, but simply focuses on successfully calling the sign method of the ECKey class, i.e. making your code work. I am not yet familiar with the ...
6 votes
Accepted

How to retrieve the from and to wallet addresses of a transaction?

Which part / field of the input refers to the hash of the output? The outpoint contains a txid (32 bytes) and vout (4 bytes), which specify the output you're spending. This is not the sending ...
  • 28.9k
5 votes

Sending bitcoins to same address

You can send bitcoins to the same address you are sending from, if you create a raw transaction manually, or if you use a wallet that does not create a new change address each time a transaction is ...
  • 1,334
5 votes

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

Bloom filters are probabilistic, each attempted match you make with it has a specific chance of being a false positive. The rate of false positives is determined by the construction of the filter (how ...
  • 15.2k
5 votes
Accepted

Encoding my Bitcoin Address with Base58 encoding

Yes. ECKey key = ...; String addr = key.toAddress(MainNetParams.get()).toString(); https://bitcoinj.github.io/javadoc/0.12/org/bitcoinj/core/ECKey.html#toAddress-org.bitcoinj.core.NetworkParameters-
  • 28.9k
5 votes

How do I sign and send a raw transaction using BitcoinJ?

I'm not an expert in this field by any means (and my error message was different), but I spent last week trying to make Bitcoinj sign a transaction and send in raw form (i.e. without using transport ...
4 votes
Accepted

How do we verify the signature on a raw transaction using Bitcoinj?

You're interested in the following API calls: public List<TransactionInput> Transaction.getInputs() public Script TransactionInput.getScriptSig() throws ScriptException public void Script....
  • 28.9k
4 votes

How to get senders address with bitcoinj (no duplicate)?

For future reference: In bitcoinJ (java version) the input/output addresses of transactions are located in TransactionInput and TransactionOutput objects. For example: for Transaction tx: List<...
  • 41
4 votes
Accepted

How to get balance from a specific address in bitcoinj?

I found the solution for this question. I used this class: /** * This class implements a {@link org.bitcoinj.wallet.CoinSelector} which attempts to select all outputs * from a designated address. ...
4 votes
Accepted

Are public keys and their corresponding hash values both added to a BitcoinJ Bloom filter?

Does the current release of BitcoinJ add both a public key and its hash value to its Bloom filters? If not, which release stopped it from occuring? Yes. The following code implements it: /** Inserts ...
  • 28.9k
4 votes
Accepted

Do all implementation of Deterministic RFC6979-compliant ECDSA signatures generate the same signed transaction given the same data?

So if I were to create the same transaction using bitcoinjs and bitcoinj, the end result of the signed transaction would be the same with both libraries, is that correct? They certainly should. That'...
  • 13.8k
4 votes
Accepted

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

Both lightning channels and duplex micropayment channels (DMC) are proposals to create bidirectional micropayment channels, that is, micropayment channels that can be used in both directions (a user A ...
  • 1,573
4 votes

How to retrieve the from and to wallet addresses of a transaction?

The scriptPubKey contains the public key used to synthesize the public address. Here are two pedantic approaches, not using bitcoinj, applying bx commands to synthesize the public address of interest ...
  • 2,947
4 votes

Problem with full node

From my experience the process of syncing the blockchain is CPU bound, not IO bound (You can check this on Linux by running the top command). bitcoinj has two ways of verifying signatures, either ...
4 votes
Accepted

Why the bitcoin address is not valid in any of the testNet faucet

Testnet uses a different address format than the main network. Testnet addresses start with an "m" or "n". The address you are using starts with a "1" and is therefore for the main network. This is ...
  • 1,573
4 votes
Accepted

How to develop with the Bitcoin cash?

There is a bitcoinj.cash project currently being put together. The code is not ready for use but should be by next week: https://github.com/bitcoinj-cash/bitcoinj
4 votes

What is the difference between bitcoin core vs bitcoinj vs bitcoind vs bitcoinqt?

bitcoind, and bitcoin-qt are all part of the same program. Bitcoind and bitcoin-qt are both Bitcoin Core and do the same thing except that bitcoind has no GUI. Both are part of the Bitcoin Core ...
  • 63.3k
4 votes

convert 12 word seed into 24 word seed

This is not possible. The mnemonic words are an encoding of the entropy used in the seed, essentially. A 12 word seed has less entropy than a 24 word one, so you cannot get 24 words out of it. ...
  • 16.6k
3 votes
Accepted

Bitcoinj How to create multi-signature address using bitcoinj

ECKey keyA = <something> ECKey keyB = <something> ECKey keyC = <something> Transaction aTransaction = new Transaction(params); List<ECKey> keyList = ImmutableList.of(keyA, ...
3 votes
Accepted

Even if transaction fee is set to BTC 0.00001, transactions remain unconfirmed

CoinWallet began a different kind of stress test within the past several days. After concerns about the method in which it conducts stress tests being a violation of laws in the UK, it decided to ...
3 votes

How to get hex string from transaction in bitcoinj

A shorter version could be: String hex = DatatypeConverter.printHexBinary(tx.unsafeBitcoinSerialize()); Where the hex converter used is standard at least since Java 7: http://docs.oracle.com/javase/...
3 votes

Bitcoinj always gets 0 balance

Okay, so it's been a while since I've played around with BitcoinJ but the problem might be that you need to rebuild your BlockStore file. A BitcoinJ application is essentially made up of four main ...
3 votes
Accepted

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

I suppose you use the BitCoinJ library. You are not creating a signature the correct way; an ECDSASignature object should be initialized with the ECDSA signature parameters (r,s), not the actual ...
3 votes
Accepted

Transaction with `OP_RETURN` to a particular address

You can't make an OP_RETURN-based output out to any specific address, since the OP_RETURN opcode marks an output as invalid (thus provably unspendable). In fact, an OP_RETURN-based output will not ...
  • 758
3 votes
Accepted

The BTC shows 10^8 times more than what is received in the account

Apparently the app shows the amount as Satoshi (the smallest unit) instead of BTC. For internal calculations that's ok because it avoids rounding errors, but for input and output you should scale by ...
3 votes
Accepted

Sign transaction with multiple inputs using bitcoinj/peercoinj libraries

Good day! Finally I found a solution, I hope it will useful to someone. The problem was that I tried to sign inputs before adding outputs and other info into transaction. So now I add inputs with ...
3 votes
Accepted

How to verify a signed message by bitcoin core?

The preimage used when signing messages with Bitcoin Core is a combination of the "Magic" phrase: Bitcoin Signed Message:\n and the Message you are signing. However there is one caveat, being you must ...
  • 552
3 votes
Accepted

How can I determine the address from a private key?

Both "1LoVG.." and the other one are valid legacy (1...) addresses made using the same private key. They are different since one of them uses the compressed public key (you might want to ...
  • 9,859
2 votes
Accepted

Accept payments on someone else's behalf without being able to spend them

This is entirely possible with an optional additon to Bitcoin called BIP32. Unfortunately, BIP32 is not implemented by the standard client, but there are other clients that do implement it. Ask your ...
  • 28.9k

Only top scored, non community-wiki answers of a minimum length are eligible