Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
2answers
7 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
26 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
14 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
220 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
29 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
19 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
23 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
34 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
89 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
21 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
14 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
99 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
55 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
24 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
25 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
139 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
110 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
0answers
67 views

How to sign multisig transaction in Go

I'm trying to sign a multisig transaction (3 of 4 signatories) in Go using some btcd packages. The following function should sign the transaction: func SignMultisigTransaction(rawTransaction []byte, ...
0
votes
1answer
32 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
127 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
112 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
100 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
73 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
29 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
137 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 ...
3
votes
1answer
214 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
24 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
46 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
46 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, ...
1
vote
0answers
106 views

How verify p2sh spending transaction signature using public key with btcsuite?

I'm trying to verify inputs signatures in Go using Verify Signature script of package btcec. Decoding this p2sh spending transaction rawSpendingTxd := ...
0
votes
1answer
93 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
58 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
47 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 ...
1
vote
1answer
78 views

What happens if I use same k twice in DSA algorithm?

To sign a message , we choose nonce k but what happens if we use same k twice to sign a message using DSA algorithm?
1
vote
1answer
117 views

How OP_CHECKSIG knows the source of sig in pay to pubkey hash transaction

https://en.bitcoin.it/wiki/Script#Standard_Transaction_to_Bitcoin_address_.28pay-to-pubkey-hash.29 The last step of pay to pubkey hash transaction is to check the signature of the previous ...
1
vote
1answer
81 views

How does a Doge public key is created from a private key?

I am looking for the differences between the creation of Doge public keys and Bitcoin public keys when inserting a private key. I am trying to make a small web-app that signs messages. There are a ...
5
votes
1answer
199 views

What exactly is hashed and signed in a segwit transaction

I have an unsigned raw segwit transaction on my regtest network: ...
0
votes
1answer
98 views

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

Good day! I'm working with low level API to make tx and sign it offline. But after all preparations I try to broadcast it and than i get an error from network: 16: mandatory-script-verify-flag-...
0
votes
2answers
220 views

How are Bitcoin Signed Messages generated?

Ledger Nano S and other pieces of Bitcoin software and hardware can sign messages using the private key associated with an address. Doing this, I get the following output: -----BEGIN BITCOIN SIGNED ...
2
votes
1answer
923 views

What is the maximum size of a DER encoded ECDSA signature?

I've been told by a seasoned Bitcoin contributor that signatures in Bitcoin could be up to 75 bytes. I'm curious to find out how that maximum comes to pass. According to this answer on Why the ...
0
votes
0answers
45 views

Bitcoin testnet transaction getting dropped with prefix on S

So a weird thing is happening lately. The transaction of a particular format is being accepted by blockcypher but it is not getting confirmations, and therefore gets dropped after a day. So the ...
0
votes
1answer
49 views

Link to Algorithmic behind signatures verification [duplicate]

Does anyone know a good paper where the process of signature verification is explained (message+signature+public key = valid/not_valid) ??? And I mean it at a low level, with the code or pseudo-code ...
0
votes
1answer
59 views

What does a bitcoin transaction contain?

I'm learning about basic transactions and know that a transaction should contain: i) Signature of the sender using some operator: sign(private key,message) ii) Receivers Public key (wallet address) ...
1
vote
0answers
34 views

Can you use Schnorr to sign inputs individually?

Can personA build a transaction and sign his inputs, then personB signs his and that be added into one transaction using Schnorr. Or are SIGHASHes still needed?
2
votes
1answer
148 views

Why do we need public key as part of Witness in P2WPKH transactions?

As we want to minimize the data payload in a blockchain, which also led to concepts like SegWit, and is matter of discussion in Signature aggregation etc, I wonder why do we actually need to supply ...
0
votes
0answers
37 views

Can I sign hex-data using Ledger UI?

Is it possible to sign hex data, for example the hash preimage of a P2SH transaction, by using the Ledger Wallet UI? I can only see the option of signing ASCII data, i.e., text.
0
votes
1answer
193 views

How are P and ((z1*s2 - z2*s1)/(r*(s1-s2))) calculated?

Given: p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 r = 0xd47ce4c025c35ec440bc81d99834a624875161a26bf56ef7fdc0f5d52f843ad1 s1 = ...
4
votes
1answer
102 views

Why is my P2SH sigScript field prepended with 0x00?

I created a P2SH transaction and signed it using coinb.in. The sigScript field for this transaction is: da 00 47 3044 0220 ...
1
vote
3answers
410 views

Public key cryptography question - Is Private or Public key used to sign? Confusion between which key is used to sign and which is used to encrypt

I am relatively new to cryptography and blockchain and am learning about how public key cryptography works, and its application in Bitcoin's environment. I read two different articles , the 1st which ...