7 votes
Accepted

How to send bitcoin from an offline Bitcoin Core that doesn't have a synced balance?

The easiest way to do this by importing the address you generated on the offline Bitcoin Core client into an online fully synced Bitcoin-Core. The command is: bitcoin-cli importaddress <address>....
user avatar
  • 6,978
7 votes

What does "operation not valid with the current stack size" mean?

The signrawtransaction RPC will verify the input scripts of the transaction after it signs it. If the transaction has not been fully signed (i.e. it isn't complete), then the script verification will ...
user avatar
  • 62.4k
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 ...
user avatar
4 votes

Signrawtransaction is not working on bitcoin core V0.17.1

As the error message says, signrawtransaction is deprecated. Stop using it. Instead use signrawtransactionwithwallet (if the transaction you are signing uses keys from your wallet) or ...
user avatar
  • 62.4k
4 votes
Accepted

What exactly is hashed and signed in a segwit transaction

Figured out a few things: Segwit Signatures For segwit transactions one must sign the following (see BIP 143): Double SHA256 of the serialization of: 1. nVersion of the transaction (4-byte ...
user avatar
  • 7,090
4 votes
Accepted

rust-bitcoin Non-canonical DER signature

I believe the intention of your push_int(1) is to add SIGHASH_ALL to the transaction. However, one of Script's many needless inflexibilities is that the sighash flag actually needs to be part of the ...
user avatar
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 ...
user avatar
3 votes

What does "operation not valid with the current stack size" mean?

I have faced the same issue i was trying to creat a raw transaction with erronerous Vout (1 instead 0) bitcoin-cli createrawtransaction "[{\"txid\": \"...
user avatar
  • 1,101
3 votes

When and where to add extra information when signing P2SH raw transaction?

Bitcoin Core's signrawtransaction RPC does not know about the specific type of script you're trying to sign for, and won't be usable. You'll need to implement the signing logic yourself.
user avatar
3 votes

Error in creating bitcoin raw transaction

You provided the amount incorrectly. The amount is 0.54551 not 545500. This is important as Segwit inputs include the previous output's amount in the signature. Providing the wrong amount will result ...
user avatar
  • 62.4k
3 votes
Accepted

signed raw transaction does not conform?

What you're seeing is the extended transaction serialization format introduced in BIP144 (segregated witness). It adds a marker 0x0001 to indicate the presence of a witness after the version number, ...
user avatar
2 votes

Why are my Signature Scripts Different from my professors?

Signing the same piece of data with the same key typically produces different signatures unless you are using a deterministic signature scheme. Check if that is the case with the library you are using ...
user avatar
  • 3,235
2 votes

Do i need to sign each input in a raw transaction?

Do i need to sign each input in a raw transaction? Technically, yes. But software like Bitcoin Core Client signs all inputs where the private keys are known. And of course, leave unsigned/untouched ...
user avatar
  • 6,650
2 votes

Two transactions are signed by different private keys, and the value of "R" for these two transactions is the same?

Assuming the two private keys are unrelated, the answer is no. The reason for this is simple: there are 3 unknowns (the two private keys, and the single secret k value), but only two equations (the ...
user avatar
2 votes
Accepted

Signing a raw transaction with multiple inputs

and other input(s) should have "00" in place. Keep in mind that you replace the "scriptsig" with "empty" and the 0x00 is the size of the empty script. non-mandatory-script-verify-flag (Non-...
user avatar
2 votes
Accepted

Can't send raw transaction Bitcoin Core 0.19.1 - non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation)

That error message is irrelevant. SegWit introduced a new way of producing the hash digest for signing which requires the "amount" being spent to be included during hashing. This "amount" is the value ...
user avatar
2 votes

How to get Y from X

The secp256k1 curve equation is: Points (x,y) for which y2 = x3 + 7 mod p, where p = 2256-232-977 If we solve this for y, we get y = ±√(x3 +7) mod p. Of course, this is not a normal square root, but ...
user avatar
2 votes
Accepted

Sign raw transaction with key

It's currently not possible to export private keys from descriptor wallets. I don't think you needed to dump the key first in the first place, though. As far as I can tell, ...
user avatar
  • 64.5k
1 vote

Can a regtest bitcoind node use SignRawTransactionWithKey + prevtxs for a mainnet raw transaction?

No, you will get an Invalid private key error. Note that if you use a correct-network private key but it is the wrong key to sign the input you provide you get a different error: Unable to sign input, ...
user avatar
  • 4,676
1 vote

bitcoind multisig transaction not shown as multisig transaction / shown as "signed" by 2:3

Bitcoind cannot tell it is a multisig input until it is signed. Prior to signing, all p2sh outputs are identical, and can be any script. Most commonly, it would either be a multisig or a p2sh-p2wsh, ...
user avatar
  • 16.5k
1 vote

How to send bitcoin from an offline Bitcoin Core that doesn't have a synced balance?

It can be done offline and with no synced data. Start: .\bitcoind.exe -datadir=c:\bitcoin -prune=550 -noconnect Create transaction: .\bitcoin-cli.exe -datadir=c:\bitcoin createrawtransaction '[{\&...
user avatar
  • 36
1 vote
Accepted

Create a transaction from a wallet coins (UTXOs) with the bcoin library

createTX() doesn't sign the transaction. That is performed by sign() in wallet.js. If your private keys are offline anyway, what kind of unexpected behavior are you getting from createTX()? It wouldn'...
user avatar
  • 4,676
1 vote

Creating a raw bitcoin transaction and signing it with the private key using php and javascript

You also need to acquire the UTXO's which are spendable by your private key. The private key in WIF private key format provides the information required to derive the pubkeyhash found in P2PKH(...
user avatar
  • 2,433
1 vote

Could not sign Transaction with SignRawTransactionWithKey through the RPC (RegTest)

You are passing the parameter with signedTx incorrectly. A JSON-RPC param key must have a value that is either an array or an object. You are passing in a string. Instead you should pass in the ...
user avatar
  • 62.4k
1 vote
Accepted

signrawtransaction is not a function on bitcoin core V0.17.1

It looks like the new calls are not yet supported in btcClient. https://github.com/ruimarinho/bitcoin-core/issues/77 refers generally to your issue. v2.0.0 was released "a year ago" according to ...
user avatar
1 vote

Open source, how can I view "Transaction Create a new transaction" and "Sign Transaction"?

The original Bitcoin client did not have a debug console or many things that we see in modern Bitcoin software. Furthermore, it is a compiled software (C++ needs to be compiled) so you can't inspect ...
user avatar
  • 62.4k
1 vote
Accepted

Sign Bitcoin transaction with several inputs using bitcoinj. Broadcasting of transaction failed

Finally I found solution and what i was doing wrong. The way of signing tx is totally correct, the problem was occurred in the other thing. Before I want to broadcast tx I calculate fee per kb (not ...
user avatar
1 vote
Accepted

Why are my Signature Scripts Different from my professors?

ECDSA signing is not deterministic. A random number k "nonce" is used for signing, and a different nonce must be used for every signature made with the same private key. (Otherwise, the ...
user avatar
  • 9,849

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