Questions tagged [signature]

A digital signature proves that the owner of a private key produced or endorsed a given message. These are used in transactions to prove that an output can be spent in a transaction.

Filter by
Sorted by
Tagged with
3 votes
0 answers
13 views

Creating a raw Segwit transaction from scratch and getting Signature must be zero for failed CHECK(MULTI)SIG operation

I am trying to create a Segwit transaction on TESTNET from scratch while referencing an online guide: https://medium.com/coinmonks/creating-and-signing-a-segwit-transaction-from-scratch-ec98577b526a ...
thotheolh's user avatar
  • 197
0 votes
1 answer
63 views

I Get "Non-canonical DER signature" Error

it was asked few times in BSE and they were pointing the problem to the sighash which was not appended to the transaction but i did it and still have problem. i had a problem with amount of fee and ...
user avatar
2 votes
1 answer
71 views

Which private key is used in Taproot transactions?

The transaction only has one input, where its scriptPubKey is --> Op_1 Q , where Q is the tweaked public key. Let p = private key, P = Public key, q = p + tweak, Q = tweaked Public key To create ...
J S's user avatar
  • 35
1 vote
1 answer
54 views

Nonstandard witness when building a transaction

i try to spend a P2WSH 2of2 multisig input in Python for learning purposes. When i check my assembled TX with testmempoolaccept i get "bad-witness-nonstandard". This is my function to ...
f321x's user avatar
  • 11
-1 votes
0 answers
41 views

Error with signed bitcoin transaction PHP 7.2.34

Kindly help with this issue. I am trying to create a bitcoin transaction but keep getting:- Error: non-mandatory-script-verify-flag (Script failed an OP_EQUALVERIFY operation) . I believe I'm using ...
TrustCode's user avatar
2 votes
1 answer
98 views

Recreating bitcoin core signature

I am trying to recreate the exact same signature as Bitcoin Core. I have installed bitcoin-core/secp256k1, but I get sometimes different signature as Bitcoin Core (which are valid). I read that since ...
Pawel's user avatar
  • 91
0 votes
1 answer
46 views

Is atomic swap flawed?

I'm reading this paper on atomic swap between BTC and XMR: https://arxiv.org/pdf/2101.12332.pdf and wonder if atomic swap with BTC is flawed by design. My understanding is that, if Alice locks up XMR ...
John M.'s user avatar
  • 121
2 votes
1 answer
167 views

Certain spent P2PKH outputs give error: Non-canonical DER signature

Certain rare spent P2PKH outputs give error: Non-canonical DER signature when I try to verify the spent output using both btcdeb (version 5.0.24) and bitcoinconsensus (version 0.20.2, using Rust ...
Alec Matusis's user avatar
1 vote
1 answer
109 views

Is the signature check performed when the signature is the empty vector?

In this answer Vojtěch Strnad wrote the following: OP_CHECKSIGADD always performs one check per signature, since unused public keys are required to be paired with an empty witness item and are ...
Cosmos's user avatar
  • 199
1 vote
0 answers
74 views

Bip32 Root Key in Metamask Signature? [closed]

I recently fell victim to an inferno contract that took a significant amount of my ERC-20 coins. I realize that this is a Bitcoin site, but a white hat hacker approached and offered to help, and told ...
rnaka's user avatar
  • 11
4 votes
1 answer
238 views

How is this transaction valid?

Transaction in question: 16ac7736552c5791cff5643e6104c76c24018236b2193e014b308efea4f32f81 The P2SH input has a strange redeem script: OP_DUP OP_HASH160 OP_PUSHBYTES_20 ...
Vojtěch Strnad's user avatar
0 votes
1 answer
103 views

What does a digital signature scheme need to have in order to be used (indirectly) in Bitcoin?

Here (see the comments) Pieter Wuille described digital scheme as a collection of three algorithms: (key generation, signing, verification) Since Bitcoin uses ECDSA (pre-Taproot outputs) and Schnorr (...
LeaBit's user avatar
  • 920
2 votes
1 answer
54 views

In the PrivateKey sign() method why are s and N-s equivalent solutions?

In the PrivateKey sign() method (Chapter 3 page 70) s is calculated like this # s = (z + re)/k s = (z + r * self.secret) * k_inv % N if s > N / 2: s = N - s Why does s and N - s work? Closest ...
Jon's user avatar
  • 23
2 votes
1 answer
123 views

Is it correct to say that "each transaction input is signed independently"?

On Chapter 6 - Transactions of Mastering Bitcoin it is said: Note that each transaction input is signed independently. This is critical, as neither the signatures nor the inputs have to belong to or ...
Pedro Martins Timóteo da Costa's user avatar
0 votes
0 answers
40 views

Sending transaction error: -26: non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation)

I'm not sure what the problem is here, everything seems correct, but I'm new to this and I'm obviously missing something. Can someone pinpoint the issue causing the error? Hex: ...
user2848020's user avatar
1 vote
0 answers
40 views

Sign unsigned transaction with TrustWalletCore Swift

I'm trying to understand how we can sign unsigned transaction in hex format. We use TrustWalletCore, I receive an unsigned tx in hex format, then we decode it to data with let dataToSign = Data(hex: ...
Sergey Udalov's user avatar
2 votes
1 answer
325 views

How to manually verify an ECDSA signature in Python?

Maybe I got the formula wrong but I heard that x = (z*s^-1)*G+(r*s^-1)*K is the equation for verifying an ECDSA signature but my code says signature is invalid but the values are from a valid bitcoin ...
Alexio puk2sefu's user avatar
1 vote
2 answers
206 views

Can someone explain how to get from SigScript to something readable

In the transaction https://blockchain.info/tx/32e8677c968981549acc25f46641c74a3055d949c90bd22c15a5236bf92a622d the first input has the following SigScript ...
user2334659's user avatar
6 votes
1 answer
176 views

Why are hashSequence and hashPrevouts computed separately?

When a Segwit transaction is signed, among the many hashes that are calculated to create the data that is going to be signed, the hash of the concatenated [input + index] is calculated (hashPrevouts) ...
mathboi's user avatar
  • 183
0 votes
1 answer
83 views

How was this transaction validated?

I'm having trouble understanding how the following transaction was valided (Block 364845 July 2015) : 2c6c27639e79038cf446e795e267dc8abbe96d1f21cdd17518cc6b57ad2d86d9 It has one input, and is ...
mathboi's user avatar
  • 183
1 vote
2 answers
281 views

Strange double-spending attack possibility

In Bitcoin you can have different UTXO with different public keys in a single transaction. So suppose someone broadcasts a transaction with sending 10000 BTC. Theoretically I can copy this transaction,...
Denys Malovanyi's user avatar
0 votes
0 answers
37 views

signing input for spend funds locked by this script

Please explain how to sign input for raw transaction with privet key corresponding to 1st or 2nd public key in this script "asm": "OP_IF 1694275749 OP_CHECKLOCKTIMEVERIFY OP_DROP ...
alnostru's user avatar
0 votes
1 answer
143 views

Would two related nonces cause the private key to leak?

Let there be two signatures made with the same private key(d) using two nonces {k1, k2}. Would knowing that k1*u+f=k2 be sufficient to reveal the private key(d)?
Joakim20's user avatar
1 vote
0 answers
61 views

Error when trying to broadcast multi input tx (Programming Bitcoin by Jimmy Song)

I am reading Programming Bitcoin (chapter 7 exercise 5) and I have created a 2 inputs 1 output transaction on testnet which I have signed and it now verifies as true. When I go broadcast the ...
user144329's user avatar
1 vote
1 answer
81 views

Bitcoin Multisig tx signing

I've generated a 2-of-3 P2SH Multisig address (testnet) and am attempting to manually reproduce the signatures to spend from it. While I can replicate the signature for the first key, as produced by ...
Pawel's user avatar
  • 91
0 votes
1 answer
57 views

Do p2pk and SIGHASH_SINGLE still working nowadays?

Seems like p2pk - pay to public key may be working or not in modern wallet apps. Is it still working or not? EDIT: Can old p2pk addresses be used to move balance to new addresses (for example bc1q...)?...
pbies's user avatar
  • 141
1 vote
1 answer
210 views

What is the transaction hash preimage for different values of SIGHASH (not SIGHASH_ALL) in P2PKH?

I have a few questions regarding the transaction hash preimage when signing with different values of the SIGHASH flag in the case of the P2PKH script. I know what the transaction hash preimage looks ...
dassd's user avatar
  • 1,049
1 vote
1 answer
90 views

Taking the existing INPUT and changing the OUTPUT to steal bitcoins. Is this a possible bitcoin theft scenario and how to prevent it?

I'm relatively new to Bitcoin and I'm wondering how Bitcoin defends against the following scenario and if it's even possible. Before I start with the scenario, just two notes: 1. There is a lot of ...
dassd's user avatar
  • 1,049
1 vote
1 answer
135 views

Error Validating Segwit Transactions using Python Blockcypher API: Error Running Input Script

As the title states, I'm trying to send a Litecoin transaction using the Blockcypher API Python SDK, and using Bitcoinlib for key management. I have extensively reviewed the documentation and source ...
Cursed's user avatar
  • 11
1 vote
0 answers
85 views

How to fix this error?: Signature must be zero for failed CHECK(MULTI)SIG operation (code -26)

I'm trying to unlock money from P2SH 2NG4PEU9rya1fcqAfSvQQAteaUkvc54J1fF, but the library is not used by https://www.youtube.com/watch?v=U2bw_N6kQL8 When I combine the Tx, I hash the Tx with SHA256 ...
Mum Jokmok's user avatar
1 vote
0 answers
81 views

Recovered bitcoin public keys do not verify the signature

I need to recover public keys on the bitcoin chain for a project, my current flow is like this: Get hash + signature from bigquery -> Use nodeJS secp256k1 module (native bindings) to import ...
Ano's user avatar
  • 11
1 vote
0 answers
54 views

walletprocesspsbt rpc not signing psbt tx

After extensive regtest testing I've been unable to reproduce this issue. This is a gist to regtest psbt commands that do work. https://gist.github.com/miketwenty1/ecb9acdbca858878f1856b75493fef4c ...
Michael Tidwell's user avatar
1 vote
1 answer
73 views

Is the Z value generated before the (r, s) values?

I just want to confirm my understanding of signatures for P2PKH transactions. The signature hash, z, is generated before generating the r and s values of a DER signature, correct?
jiamijiang's user avatar
1 vote
1 answer
391 views

Transaction keep beeing rejected "non-mandatory-script-verify-flag"

I'm developping Bitcoin integration for Microsoft Dynamics Business Central to offer enterprise capability to apply Bitcoin receivable and payable to accounting. To send a transaction, I'm using ...
Maxime CATY's user avatar
2 votes
1 answer
93 views

Why inputs' scriptSig are stripped before the whole transaction being signed?

In this video, the lecturer explains that before the whole transaction get signed, the scriptSig part of inputs are removed, and this causes the ability to perform transaction malleability attacks. My ...
Amir reza Riahi's user avatar
2 votes
1 answer
135 views

Where are transaction signatures beside the scriptSig?

To spend a UTXO, we need to sign it (have the scriptSig). Then we can spend that UTXO to any address we want, which it wasn't included in the signature we produced for unlocking the UTXO. So we should ...
Amir reza Riahi's user avatar
0 votes
0 answers
38 views

What does it mean when R, S values begin with zeroes?

I was hired to fix some typos in a WIF but I went into analyzing transactions instead then I found 3 R values that begin like this: 008505 008391 00a542 Then 2 S values begin like this: S: 00db19 S: ...
terry franklin's user avatar
-1 votes
1 answer
89 views

"Signature must be zero for failed CHECK(MULTI)SIG operation"

I want to broadcast signed transaction but I get this error how can I solve this I get this everytime. "Signature must be zero for failed CHECK(MULTI)SIG operation" RAW hex ...
K. Khurshudyan's user avatar
1 vote
1 answer
2k views

python-bitcoin-utils - sendrawtransaction RPC error: {"code":-25,"message":"bad-txns-inputs-missingorspent"} when trying to broadcast my tx?

I am trying to create a bitcoin transaction to send all of the funds from tb1qj6zz96g8xgrwpgmdlvmkrjlwzz54sf47086yc9 to tb1qxgm8j0cq7tnftef3t563psl56gtmzxanm5c9uy. ...
ChristianOConnor's user avatar
2 votes
2 answers
207 views

Is there a set length that a signature can be?

I'm reading this page which describes the following method of creating a stack: OP_0 <A sig> <B sig> OP_2 <A pubkey> <B pubkey> <C pubkey> OP_3 Sig Stack Pubkey ...
bitcoinluvr6969's user avatar
3 votes
1 answer
164 views

Validation of segwit v0-v1 tx automatically adds OP_CHECKSIG?

When I create a segwit transaction v0 (P2WPKH) or v1 (P2TR key-path spend) I do like that (let's spend a P2TR output): Locking Script (of the P2TR output I'm spending): OP_1 PK_size PK Witness: 1 (...
alemaz98's user avatar
  • 143
0 votes
1 answer
60 views

Continuation question about nonce randomness and verification of the randomness by signing parties

Original: Can a signer recover their own signature's nonce `k`? Note that under normal circumstances it is infeasible to randomly generate the same nonce, so either a non-random nonce has to have ...
Poseidon's user avatar
  • 693
1 vote
1 answer
302 views

Can a signer recover their own signature's nonce `k`?

I am proofreading a blog post about nonce reuse. One point that comes up is whether someone could recover another person's private key if the other user reuses the same nonce. In that context, it was ...
Murch's user avatar
  • 74.5k
2 votes
1 answer
182 views

Error validating transaction: unexpected witness payload for non-witness script in a P2TR using script path

I am trying to create a raw transaction P2TR, spending a Taproot UTXO using the script path. I did the following: Create a random private key d and corresponding pubkey P (the internal pubkey) ...
alemaz98's user avatar
  • 143
4 votes
1 answer
1k views

non-mandatory-script-verify-flag (Invalid Schnorr signature) when I try to send a P2TR tx on testnet

I'm learning to create tx from scratch in order to understand better how bitcoin tx works and how they are structured. I learnt to create tx with legacy address, segwit v0 and I am now learning ...
alemaz98's user avatar
  • 143
5 votes
1 answer
405 views

Bitcoin Core file with the signing keys was removed from repo. How is the process supposed to be now?

Yesterday this PR was merged into the Bitcoin repository, and the process described at https://bitcoincore.org/download mentions that to validate the source code, you must download the txt file with ...
decentralized.b's user avatar
1 vote
0 answers
131 views

Is Curve25519 better option than Secp256k1?

Are signatures over Curve25519 better than over Secp256k1 or are there major drawbacks? How do, for instance, EdDSA/Schnorr using Curve25519 compare with ECDSA/Schnorr for Secp256k1?
Son Kaos999's user avatar
4 votes
2 answers
495 views

Signing taproot key-path transaction from rust-bitcoin

I'm trying to make a taproot HTLC using rust-bitcoin for an atomic swap protocol. My plan is that in the "happy case" of my protocol, the coins are spent with the key-path, and then there is ...
rijndael's user avatar
1 vote
1 answer
181 views

Anti-exfil protocol can't be verified on multiple hardware wallets

Regarding the nonce side channel attacks detailed in posts like this one by Blockstream. Which references this mailing list by Pieter Wuille. The idea is to add another layer of protection against a ...
reggieadams's user avatar
1 vote
1 answer
33 views

LN-Channel: Do I have to use new private keys for each HTLCs out of security?

I have a question regarding the security of HTLCs in a LN-channel. In a LN-transaction with multiple HTLCs (routings) to the destination one is using the signature of each node provider so that the ...
Robee's user avatar
  • 11

1
2 3 4 5
10