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.

376 questions
Filter by
Sorted by
Tagged with
21k views

ECDSA: (v, r, s), what is v?

Deterministically signing a Tx with RFC6979 returns v, r, s, where r and s are the 2 values used in standard ECDSA signatures. v = 27 + (y % 2), so 27 + the parity of r, as pybitcointools indicates. ...
17k views

Signing Bitcoin transactions

There is a part of the Bitcoin protocol that I don't quite understand. When you make a transaction, and spend the output of a previous transaction for say 1 BTC, you provide a signature using the ...
5k views

What are the implications of Schnorr signatures?

Adam Back (adam3us) explained in March, 2014, but it is all math. There's another short post with advantages, though. This answer on crypto.SE claims that Bitcoin considered using Ed25519 which is ...
13k views

Why the signature is always 65 (1+32+32) bytes long?

A signature created by the Bitcoin-Qt client can always be decoded (base64) to a 65-byte array. This array seems (according to https://github.com/bitcoin/bitcoin/blob/master/src/key.cpp#L217) to ...
14k views

ECDSA r, s encoding as a signature

An ECDSA algorithm when signing a given messages produces a pair of outputs, r and s. How, given a sigStr from a Tx can one extract r and s? Are they just concatenated byte arrays of a specific length,...
6k views

How to sign a transaction with multiple inputs?

I have been able to program an application in python that sends valid transactions that spend 1 input, but I really can't get it to work with 2 or more inputs. So my question is, how exactly is the ...
2k views

Why use DER encoding for signatures?

A signature in secp256k1 is two 32 byte numbers. DER encoding a signature adds about 6-7 bytes. It also needlessly complicates things (is DER encoding used anywhere else?). In a transaction format ...
20k views

How does "Sign Message" work?

How does "Sign Message" option in the Bitcoin QT client work? I can't find any description or documentation of it. Do I have to use this option to sign some message when I receive bitcoins? If so, ...
652 views

Tx Malleability: Why is the Script not included in the Signed Hash?

Sipa lists sources of tx malleability here: https://gist.github.com/sipa/8907691 It is clear to me how a change in the signature itself or the signature formating leads to a different tx hash (1. &...
7k views

What is a step by step way to insert data in OP_RETURN?

I was following https://bitcointalk.org/index.php?topic=453086.0 for creating a message in OP_RETURN. I am able to decode my raw transaction, but on signrawtransaction it gives error: {"code":-22,"...
7k views

parsing bitcoin input and output addresses from scripts

can someone walk me through the process of combining script inputs and outputs to reveal the base58 encoded input and output addresses. take for example, block 728. this has two raw script inputs: ...
6k views

How does the ECDSA verification algorithm work during transaction?

I understand the basic concept ECDSA where if Bob wants to sign a message it generates a random number n, multiply it with the secp256k1, r = the x value , s = (H(x)dr)*n^-1 mod q. Also the ...
3k views

Problems with deterministic ECDSA based on RFC6979 in Bitcoin

Generating random number k in elliptic curve is crucial and in any transactions signature in Bitcoin, random number k is required to compute a point k*G. If this k is chosen not randomly, it instantly ...
479 views

Why was the Oct 2015 Transaction Malleability event possible in spite of BIP62/66?

The recent re-emergence of transaction malleability has been responsible for a large number of Txs which are being double spent (October 2015). /r/Bitcoin has posted some C++ code which @amaclin has ...
6k views

How to sign bitcoin transaction with 'bitcoind' and non-bitcoind-wallet private key?

I want to create and sign bitcoin transaction using only 'bitcoind' and 'bitcoin-cli'. I can create a transaction using createrawtransaction RPC API, but signing it using 'signrawtransaction' fails. ...
22k views

ECDSA Signature and the "z" value

The following link contains details on how to reverse the ECDSA signature if given two identical "R" values. http://www.nilsschneider.net/2013/01/28/recovering-bitcoin-private-keys.html I have read ...
8k views

How to verify Bitcoin Core Release Signing Keys

I use Gpg4win but I don't know the step to verify the Bitcoin Core Release. can you give me the instruction how to verify released? i git this resolte C:\WINDOWS\system32>gpg2 --keyserver pgp.mit.edu ...
6k views

What's the rationale of using ECDSA instead of RSA?

One major drawback of (EC)DSA is that it requires a good RNG, otherwise the private key may be accidentally exposed. This is also one of the major reasons (I found so far) why no(?) smartcard supports ...
5k views

Transaction signature generation

When one sets up a transaction, the input of the transaction needs to have a script with a signature to show that you can spend those coins. Which fields of the previous and current transactions need ...
2k views

Where does the random number come in to play when signing a transaction?

Just given all the news about this topic lately (Android security flaw), I'm curious about WHERE and WHY the random number is used during the signing of a transaction. I always thought a transaction ...
3k views

Is there a user-friendly tool for creating and signing raw transactions?

The title stands for itself. The only tool for doing so I know of is the bitcoind daemon, but it is for from user-friendly. A web-tool in JS would be ideal or a simple CLI tool with clear ...
625 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 ...
1k views

Replacing ECDSA (SECP256k1) with Schnorr signatures

On March 23, 2017 the Bitcoin Core team published a technology roadmap, expressing their intent to replace ECDSA (SECP256k1) with Schnorr signatures: https://bitcoincore.org/en/2017/03/23/schnorr-...
4k views

How to sign raw transaction given a private key and SHA hash (in java)

I have followed the instructions here to build my own bitcoin transaction. Redeeming a raw transaction step by step example required Currently my code can create a transaction and compute the SHA ...
1k views

Is it possible to add a transaction input to a transaction in the mempool?

Is it possible to add an input to a transaction that is in the mempool? For example, if someone is paying 1 BTC to their friend, I can get the raw hex data of this transaction from the mempool before ...
610 views

Why is there no such thing as a redirected, forged, or fake transaction?

In the past, we had numerous questions about "fake" or "forged" transactions. Such transactions could supposedly be created even without holding any bitcoins, yet would end up in the mempool or even ...
296 views

Can you always derive a public Bitcoin address from a message and a random signature?

Let's say my Bitcoin address is 1Nu5mzpUD9A7daZ76QJEsBfkBjCWVLh7pJ and I sign the message random-challenge with its private key. The result is : ...
3k views

How to verify the signature of a raw transaction

I know there are many tools to check an ecdsa signature of a bitcoin transaction and I understand the ecdsa algorithm. It takes three inputs, a hash of the transaction, the digital signature and the ...
3k views

How to sign a transaction hash in ruby?

I'm trying to sign (using secp256k1) a transaction as explained here. I'm using my own private key and an unsigned transaction as the input. I'm able to sign it using the JSON-RPC client, but when I ...
1k views

If addresses are hashes of public keys, how are signatures verified?

I've skimmed through the https://en.bitcoin.it/wiki/Protocol_specification and it seems that when sending someone bitcoins, I would sign the transaction data (not quite sure which parts exactly) with ...
345 views

Bitcoin multi-sign and the amount of storage it required

I read the paper "Threshold-optimal DSA/ECDSA signatures and an application to Bitcoin wallet security". The authors said that in the optimal threshold signature that they propose, players require ...
5k 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.
2k views

How are SIGHASH flags encoded into a signature?

This page describes SIGHASH flags: OP_CHECKSIG extracts a non-stack argument from each signature it evaluates, allowing the signer to decide which parts of the transaction to sign. Since the ...
357 views

Why is it important that nonces when signing not be related?

I understand that if nonces (usually denoted k in the signature algorithm) are related signing with the same public key that this reveals information about the private key. I would like to get a ...
1k 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 ...
2k views

Why can't bitcoin miners modify transaction outputs?

I am learning the Bitcoin protocol by reading the bitcoin developer reference documentation. As far as I know, a raw transaction consists of: Version (which is always 1) Inputs. Each input contains: ...
10k views

How do signatures work?

Just curious, if I send a transaction from one address to another, how do they verify it without knowing my private key?
431 views

There's a hard-coded 27 value in Bitcoin's encoding of Compact Signatures that I don't understand: https://github.com/bitcoin/bitcoin/blob/v0.7.1/src/key.cpp#L333 I get that the need to encode the ...
259 views

Are SegWit signatures all required to follow BIP143?

...or is there any way for a SegWit witness to contain a "legacy" signature?
1k views

generate a P2SH-P2WSH address and spend output sent to it

I am attempting generate a P2SH-P2WSH address and then spend an output sent to this address, but when I attempt signing I receive Invalid private key error from bitcoind (v0.15.1.0). So where am I ...
954 views

What exactly is hashed and signed in a segwit transaction

I have an unsigned raw segwit transaction on my regtest network: ...
280 views

What standard is used for the ECDSA to verify transactions?

Bitcoin used Elliptic Curve Digital Signature Algorithm. (see here). I'm wondering what standard is actually used for this Algorithm: which curve? which prime? Can anybody give me a reference? (Wiki ...
2k views

Step by step example to redeem a P2SH output required

I have been following BIP16 in creating a P2SH transaction. I want to create a simple (one signature) P2SH. I am getting an error when trying to broadcast the tx. Error is 16: mandatory-script-verify-...
1k views

What is the exact difference between a Bitcoin and Bitcoin Cash raw transaction to address sighash_forkid?

Bitcoin Cash apparently uses sighash_forkid, such that if you don't implement that into your raw transactions, the bitcoin cash network won't accept it. How would one need to alter (what to add and ...
6k views

How to sign a message using Bitcoin private key?

How does one create a proper signature for a given message using Bitcoin private keys? I have an input address of 5JeWZ1z6sRcLTJXdQEDdB986E6XfLAkj9CgNE4EHzr5GmjrVFpf or ...
2k views

Bitcoin how to get X value from Y

How to get X value from Y? ECDSA x,y coordinate validity verification doesn't seem to work X = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 Python code, p = ...
604 views

How to sign non-standard transaction

Consider Testnet transaction 7a438...de03e which has vout[0].scriptPubKey = OP_DUP OP_DROP OP_DUP OP_HASH160 039.....6fe OP_EQUALVERIFY OP_CHECKSIG The script is equivalent to a standard pay-to-...
4k 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 ...