Questions tagged [signature]

This tag should be used for questions regarding digital signatures. 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
0
votes
0answers
24 views

How does HASHSIG work?

I am reading an article about how HASHSIG works, but i don't understand this: Before the signature is computed, several temporary changes are made to the transaction: The signature script of the ...
1
vote
1answer
37 views

What goes in the tx hash preimage when signing with 0x83 (SINGLE|ANYONECANPAY)?

I have script to create a P2WPKH to P2WPKH transaction (1 input, 1 output) and sign it with the sighash type 0x01 SIGHASH_ALL. Which fields would I need to change in the tx digest preimage to turn ...
1
vote
2answers
196 views

What are the DER signature and SEC format

I often see those 2 elements in bitcoin documentations and tutorials but I have not yet find a proper definition on the internet for DER signature and SEC format.
0
votes
1answer
26 views

What is the signature digest for Segwit outputs

(Assume there's no OP_CODESEPERATOR) For standard P2PKH, the signature digest is generated this way: NewTransaction settle the TxOuts well set all TxIn scripts to empty insert the Previous Locking ...
5
votes
2answers
173 views

Can signature be re-used to cash out everything in the address?

I Know for the P2PK locking script it was like this [pubkey] <OP_CHECKSIG> and then an unlocking script is provided as simple as this: [sig] But if it works like this, others can simply grab ...
0
votes
1answer
28 views

Do transactions need to be signed

I always thought a transaction can be accepted when all its inputs are correctly provided with their unlock script (which usually contains a signature) ——yes transactions may also be rejected with ...
0
votes
1answer
32 views

Query Reagrding DER Signature

(For Bitcoin TestNet Only) I am working on Signed Transaction which consists More than One Inputs and More than One Outputs (Unsigned HEX Data). after that i have generated two DER Signature of both ...
1
vote
1answer
55 views

How to verify a signed message in Java?

I want to verify, in Java, a signature produced with bitcoin core's signmessagewithprivkey (equivalent to the verifymessage). I noticed a bitcoinj method similar to the bitcoin core's verifymessage - ...
3
votes
1answer
53 views

Why does a same transaction signed separately have different witness values?

I signed a bitcoin testnet transaction using nbitcoin library and got an output: ...
3
votes
1answer
42 views

Signing a raw transaction with multiple inputs

So I am creating a simple P2PKH transaction and after I researched about this found few useful posts and answers here; I was able to successfully spend a a single P2PKH UTXO but it is really getting ...
0
votes
1answer
19 views

Difficulty in verifying bitcoin-core signing keys

How can I verify bitcoin0.19 signature bwith gpg? I read I should use gpg --recv-keys signingkey, but I don't understand where is the file signiggkey. I tried to download Bitcoin Core Release Signing ...
2
votes
1answer
128 views

Bitcoin and encryption

To the best of my understanding Bitcoin uses encryption to create the digital signature, basically, by encrypting the hashed message (transaction?). Would like to get your expert opinion to my claim ...
0
votes
1answer
39 views

Cannot sign txn with change address using bitcoinjs-lib psbt

I am having a difficult time figuring out how to sign a spend from a change address. I get Error: cannot sign for this input with the key <value>. The initial transaction works fine, where I ...
1
vote
0answers
38 views

How can I check my transaction signature is correct?

I have tried recreating the exact transaction from "Appendix B: Funding Transaction Test Vectors" from BOLT 3 from the Lightning RFCs. My transaction looks exactly the same when parsed, except my ...
0
votes
0answers
40 views

Getting Error “Unable to sign input, invalid stack size (possibly missing key)”

I have created a key from using coinstring, and then imported it into my wallet. Then I ran: bitcoin-cli signrawtransactionwithkey "$rawtxhex" "[\"$mykey$\"]" But it results in: Unable to sign ...
1
vote
0answers
29 views

Is possible extract the original script P2MS from the transaction locked with the P2SH address?

This is a stupid question because if the P2SH contains the hash160 (and the hash160 contains the sha256) of the P2MS doesn't possible return to the original hex P2MS. So, but for verifying the P2SH I ...
2
votes
0answers
62 views

How to Validate Signature with SigScript length 8b?

I created a raw Transaction: ...
2
votes
1answer
85 views

how difficult is it to generating an ECDSA (or Schnorr) signature with a certain number of leading zeros?

If both the public key and the private key are known ahead of time (public knowledge), and the goal is to choose a message/nonce that generates a signature with, for example, a certain number of ...
0
votes
1answer
38 views

Multiple inputs with one signature

From this question I've learned that a transaction with N inputs requires N sign operations. But what if there a huge amount of inputs? E.g. I have a coffee shop and I sell 5000 pcs coffee every day ...
6
votes
1answer
427 views

Will Schnorr Multi-signatures completely replace ECDSA?

I stumbled upon the fact that schnorr signatures will most probably replace the current ECDSA system in a future BIP. Is it worth learning about ECDSA or this will become obsolete/useless/confusing ...
0
votes
2answers
94 views

Difference between Sign Message and Sign Transaction

Using "Sign Message" one can prove ownership of an address. This happens by signing a human-readable string using the private key belonging to the address. The owner then provides the address, message ...
1
vote
0answers
59 views

How to sign an Altcoin transaction manually with 2 inputs and 2 outputs

So i'm working with the altcoin denarius which has the following raw TX structure. This is a transaction I am try to sign: Original: ...
0
votes
1answer
39 views

Source and (mis)handling of the private key for a basic tx

I'm looking to get "hands on" with signing, however when I adapt Runeks' thorough answer at https://bitcoin.stackexchange.com/a/5241/89798 my code invariably fails reporting that I've used the wrong ...
1
vote
1answer
108 views

Verifying a bitcoin Signature and what is the transaction data that is signed?

Given a bitcoin transaction where it is able to redeem it's UTXO's, how can I verify in Java if the signature is actually a valid signature or not. I was trying to use the Bouncy Castle library where ...
0
votes
0answers
48 views

Bitcoin Transaction Generation: Signature Verification Error

I have the following raw transaction (basic P2PKH) which I am trying to send to the Bitcoin Testnet 3: ...
0
votes
1answer
31 views

What is the relationship between the Digital Signature and the Public Key

So, I can see this is in the unlocking script: <Cafe Signature> <Cafe Public Key> Taken from mastering bitcoin. What is the difference between the two? I don`t find it easy to google.
2
votes
1answer
121 views

How to calculate p2wsh signature?

I read the bip143, but didn't understand how to calculate the scriptCode of p2wsh. bip143 told us: A new transaction digest algorithm is defined, but only applicable to sigops in version 0 witness ...
2
votes
1answer
257 views

I tried to recover the public key from the signature, but I failed

I used data that comes from https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki#p2sh-p2wpkh. It is easy to know how to get sigHash. But when I try to recover public key, everything out off ...
0
votes
1answer
31 views

How to check a signature on an arbitrary message?

I'm looking to have a p2sh transaction that inside the redeem script there is OP_CHECKSIG (or any other op-code) that verifies a signature on an arbitrary message (not a transaction). I have been ...
0
votes
2answers
79 views

Raw SegWit TX look solid and verifies, but is rejected. Need help figuring out why

Consider the following transaction expressed as hex: ...
0
votes
1answer
42 views

P2WPKH - which private key is used to generate signature?

I am looking at the BIP143 P2WPKH example. I am kind of following until the generation of the sigHash: c37af31116d1b27caf68aae9e3ac82f1477929014d5b917657d0eb49478cb670 but then that is used to ...
0
votes
1answer
57 views

ScriptSig does not validate with seemingly valid signature

I am trying to build raw transactions from scratch to improve my understanding. For comparison I am using the hexoutput from https://coinb.in/ as I can choose Testnet on there. I am trying to ...
2
votes
1answer
42 views

Why is a library's signature of a segwit tx different from Bitcoin Core signature?

I have been writing a (yet another) Bitcoin python library primarily for educational purposes; for me and my students. Signing a non-segwit transaction results in a signed tx that is identical to ...
0
votes
1answer
52 views

How does Bitcoin makes sure that nobody can duplicate a transaction?

I understand that when creating a transaction, you send in data, the hash of that data, and a signature that is created using the hash of the data and your private key. However, what is stopping ...
0
votes
1answer
85 views

How to manually sign a transaction with multiple inputs and multiple outputs?

I'm developing transaction constructor, but i faced several problems. To some of which i found answer in How to sign a transaction with multiple inputs?, for the rest i'll try to explain: When we ...
3
votes
1answer
61 views

What is the rationale for inclusion of previous amount in SegWit signing process?

When spending a P2PKH output, the "data" we hash only includes the output script from previous transaction but when spending a P2WPKH (the new serialization) we also include the amount field from ...
0
votes
2answers
224 views

Why did repeated “R” values occur in Bitcoin transactions before?

Please explain why earlier the repeated values of "R" occurred in Bitcoin transactions. For example, this transaction has a repetition of the value "R": https://www.blockchain.com/btc/tx/...
0
votes
0answers
41 views

Signing a Tx that has multiple UTXOs

Using Go language, I am trying to create a BTC transaction, using multiple UTXOs. I am adding the UTXOs by doing this: Tx.AddTxIn(TxIn) creating the TXOuts one for the amount to send out and one for ...
1
vote
1answer
47 views

What is the O(n^2) signature hashing problem and how does SegWit solves it?

One of the many benefits of SegWit is that it solves the O(n^2) signature hashing problem. What exactly is the O(n^2) hashing problem and how segregating signatures to separate witness field solve it?
0
votes
2answers
167 views

How to extract raw 64 byte EC signature from an ASN1/DER encoded signature (which ranges from 70 - 72 bytes)

I see that my ASN1/DER signature contains the individual r and s values, is there a way to derive the generic 64byte signature? edit: Ive looked through the DER/ASN1 spec, seems that what Im looking ...
4
votes
1answer
472 views

If I set assumevalid=0 after syncing the blockchain will Bitcoin Core go back and validate historical blocks?

I originally synced my node using the Bitcoin Core default assumevalid value. If I set -assumevalid=0 in bitcoin.conf and restart my node, will my node go back and validate historical blocks?
0
votes
1answer
56 views

Following SegWit implementation, is BIP-146 signalling and implementation still on the docket?

Is BIP 146, which defines using the low S value, still on the docket to be signalled and implemented given that SegWit fixed the txid malleability issue by moving the witness outside the transaction? ...
0
votes
2answers
40 views

Public Addresses: '3' vs '1' in front [Bitcoin]

I just wanted to confirm, is it true that for a bitcoin (public) address it should always have a '1' in front of it. For certain transactions though I see that there is a '3' in front. How is this ...
4
votes
1answer
132 views

Low-s value in bitcoin signature

What are the problems related in using the "normal" ( bigger than N/2) value of the s number in transaction signature and why we use the lower one? Is it about the math behind the ecdsa?
2
votes
0answers
24 views

Script and DER in P2PKH

Im trying to figure out the script and DER In P2PKH, the "first part (scriptsig)" push in stack (<sig><pubK>) because is it DER? Instead the "second part (scriptPubKey)" you can map the ...
2
votes
2answers
426 views

How can my private key be revealed if I use the same nonce while generating the signature?

I know it is well understood that it is not a good practice to use the same nonce while generating the signatures, but I am not getting the math right. Assume I have some UTXOs that are controlled ...
0
votes
1answer
60 views

Signature digital algorithm in bitcoin, to what will it change in the future?

in follow-up to the question: 85202 There, @Ugam Kamat wrote ""ECDSA is the first thing that can get vulnerable with quantum computer. signature will need to move to post quantum world much before ...
0
votes
1answer
30 views

Destination address(es) when redeeming an HTLC

Starting from this text at https://en.bitcoin.it/wiki/Script: "The script for a typical Bitcoin transfer to destination Bitcoin address D simply encumbers future spending of the bitcoins with two ...
2
votes
1answer
31 views

Why is the Schnorr verification formula working and actually verifying the validity of a signature?

Reading the bottom of page 2 of the Musig Paper we can find that a Schnorr Signature for a cyclic Group G of prime order p with generator g is a tuple (R,s) where R = gr for a random secret r and s=...
0
votes
1answer
77 views

Bitcoin Signatures are susceptible to quantum attacks - how exactly and with what practical impact? [duplicate]

@PieterWuille wrote in another thread: "" The hashing algorithm is probably the most quantum-resistant piece of cryptography right now in Bitcoin. Barring any specific breaks, SHA256 and RIPEMD160 ...