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
23 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
23 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
41 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
229 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
24 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
58 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
27 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
41 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
35 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
49 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
41 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
58 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
79 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
30 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
42 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
71 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 ...
2
votes
1answer
347 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
49 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
34 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
71 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
20 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
359 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
47 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
27 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
30 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
52 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 ...
1
vote
1answer
111 views

How can you calculate the inverse of S component of signature, while you cannot do it in ECC to calculate private key from public key?

When verifying the signature in bitcoin, we calculate S^(-1) * hash(m) * G + S^(-1) * R * pub_key and verify that this is equal to the temporary public key. Given the same logic, why can't we use it ...
0
votes
0answers
37 views

OP_CHECKSIG NULLFAIL with btcdeb

I'm using btcdeb to understand script. I pick a old random P2PKH transaction form mainnet, and paste unlocking script e locking script inside. I know that this script is ok, because I can check on ...
0
votes
0answers
19 views

Swift implementation of bitcoin transaction creation

Is there a well known and widely used Swift implementation for creating raw Bitcoin transactions and getting their hash (SegWit and Non-SegWit) of signing? If not, is there a reference document that ...
1
vote
1answer
138 views

Why hash witness script instead of pubkey script in signature?

When a segwit input is signed, the signature will commit to the witness script (or a p2pkh-like script in case of p2wpkh). This is specified in BIP143: For P2WPKH witness program, the scriptCode ...
2
votes
1answer
68 views

Are sipa's standardized schnorr signatures incompatible with blind signatures?

Here, sipa proposes a standardization of schnorr signatures: https://github.com/sipa/bips/blob/bip-schnorr/bip-schnorr.mediawiki For example, sign() returns Sig{R,s} which can be encoded with 64 ...
1
vote
1answer
28 views

Would signature aggregation reduce the largest feasible blocksize

If a Schnorr signature aggregation scheme were to be integrated into Bitcoin. Would the reduction in witness data versus non witness data (need less bytes for a signature therefore witness data usage ...
1
vote
1answer
28 views

which was the purpose of changing the signature of a TX? or it was just a bug before segwit?

Was there any purpose in changing the signature of a transaction? Or it was a bug before segregated witness? Does segregated witness disable some wanted feature?
1
vote
2answers
338 views

Nonce usage in ECDSA signing algorithm

I'm trying to understand the signing function secp256k1_ecdsa_sig_sign(), and I'm curious about the nonce usage here. static int secp256k1_ecdsa_sig_sign(const secp256k1_ecmult_gen_context *ctx, ...
1
vote
1answer
233 views

tiny-secp256k1 and ECDSA signing determinism

I noticed in bitcoin when using the tiny-secp256k1 library to sign the signature for a signature hash of an input, the signature is always the same. However in other ECDSA secp256k1 libraries (im ...
0
votes
1answer
54 views

Representation of coordinates in signature. OpenSSL

I want to calculate the v-value from the signature obtained using the OpenSSL ECDSA_do_sign function. I found that this value is calculated using the parity of y-coordinate of r. Here I also found ...
2
votes
1answer
208 views

Bitcoin ECDSA signature in the compact format

I would like to understand how to get Bitcoin ECDSA signature in a compact format, when it's exactly 65 bytes. In the bitcoin-core repository, secp256k1_ecdsa_recoverable_signature_load is ...
2
votes
1answer
234 views

How to determine first byte (recovery ID) for signatures (message signing)?

I do realize that in bitcoin when we return the signature result for signing a message the first byte includes information for recovering the public key required for verification using a formula like ...
0
votes
1answer
162 views

Why are the inputs of Bitcoin transactions signed?

This is my understanding of what a transaction looks like: inputs: input0: txid: <funding tx0 TXID> outputID: <output ID of UTXO in the funding tx0> scriptSig: <...
2
votes
1answer
96 views

NBitcoin get signature, use spending P2SH transaction with non-standard script

After creating a new NBitcoin transaction (with a single pay-to-script hash input and multiple outputs), is there any way to calculate the transaction signature and manually put it in the inputs[0]....
0
votes
1answer
39 views

Multi-sig signature computation

I don't understand, how multi-sig signatures are generated. I've seen that inputs redeeming a multi-sig output, can be signed and signed over repeatedly, with different private keys using bitcoind's ...
3
votes
3answers
160 views

allowed DER encoding format violations for signatures in bitcoin: implications for libraries?

I have recently changed verification code in python-bitcointx to use libsecp256k1 library. In the python-bitcoinlib code (that python-bitcointx is a derivative of), openssl functions were used for ...
4
votes
1answer
298 views

How is Public Key extracted from (message, digital signature, address)

I'm under the impression that a public key is revealed when you sign a message. Given these 3 inputs. P2PKH Address, Digital Signature, Message. Is the public key exposed? If so, how do you extract ...
1
vote
2answers
26 views

What happens when the verification of a manipulated transaction fail?

If a malicious miner changes the amount in a given transaction, the hash value of the block changes. Thus, he has to find the required hash value again in that block. Let's say he successfully found ...
0
votes
1answer
60 views

Signature generation

I am trying to unwrap bitcoin transaction generation process. A bit confused about signing part. My understanding is the transaction is sha256'd, then sha256'd one more time, then ECDSA'd. Based ...
1
vote
1answer
49 views

Transaction Malleability, if i want to change signature, what part should I change, so that it would remain valid?

I know what transaction malleability is, but I don't understand how someone can change my signature so that it would remain valid. For example, If I want to change signature what part should I change, ...
0
votes
1answer
150 views

How to add a signature to a transaction which I can broadcast

I am using ledger and multi sig to sign a transaction I got signature hash where both party signed the transaction. How can I attached this signature to the transaction so that I can broadcast it to ...
0
votes
1answer
38 views

Retrieve money back from wrong prefix address

Normally, p2pkh address is generate by Base58(Prefix+ PublicKeyHash + Checksum), and prefix is set 0x00. What if by accidently, prefix is set 0x05, then the address prefix becomes 3, which becomes ...
0
votes
1answer
88 views

P2PKH - Sharing a wallet address does not reveal my pub key?

Is it technically correct to say that if I share my address with the network, nobody has access to my pubkey still? But if I share a valid signature to a P2PKH UTXO, someone can derive my pubkey and ...
1
vote
1answer
55 views

For a transaction with a single input and output, is there a difference between SIGHASH_ALL and SIGHASH_SINGLE|SIGHASH_ANYONECANPAY

I have an signing implementation that already works for SIGHASH_ALL, and I'm trying to also support SIGHASH_SINGLE|SIGHASH_ANYONECANPAY. I'm referencing https://en.bitcoin.it/wiki/OP_CHECKSIG for the ...