Skip to main content
8 votes
Accepted

What is the circular dependency in signing a chain of unconfirmed transactions?

What is the circular dependency here if only tx1 depends on tx0? Since tx1 depends on tx0, the txid of tx0 must be known before tx1 can be created and signed. However the legacy transaction format (...
Ava Chow's user avatar
  • 70.9k
7 votes
Accepted

How to calculate txid for segwit transactions?

The txid of a segwit transaction is computed by first dropping all the witnesses, and encoding it in legacy notation, and then computing the double-SHA256 hash of it. This is the only possible way, ...
Pieter Wuille's user avatar
6 votes

SegWit and previous hash: txid or wtxid, or either?

Inside transaction inputs, you have to refer to previous transactions using the txid. Allowing a wtxid there would be (1) a hard fork and (2) defeating the purpose, as it'd make transactions malleable ...
Pieter Wuille's user avatar
6 votes
Accepted

Duplicate transactions in blockchain

Transactions can have multiple outputs. What you show are two outputs created by the same transaction. The output positions are enumerated with the vout field. As the first one is vout = 0, the two ...
Murch's user avatar
  • 76k
6 votes

Is txid a required field on all transactions?

Txid can’t be missing since it’s just a hash of the transaction data
Mike D's user avatar
  • 3,569
6 votes
Accepted

When calculating the hash of transaction, why is the version used as "01000000" instead of "00000001"?

Because it's encoded as a little endian number, meaning the least significant byte goes first. Example: Number 1234 would be encoded as byte sequence 000004D2 when encoded as 4-byte big endian, and it ...
bca-0353f40e's user avatar
  • 1,045
4 votes
Accepted

What is the impact of purposely sending a signed message with zero fee?

The underlying motivation behind transaction fees is to compensate for resource utilisation as there is always an inherent cost when validating transactions (Electricity - CPU usage) and relaying ...
rny's user avatar
  • 2,428
4 votes

How are transaction IDs generated and how are they then changed by transaction malleability?

The transaction ID is the SHA256d(signedTransaction) = SHA256(SHA256(signedTransaction)). Sha256d is SHA256 applied two times. Example: Let us consider the transaction with ID ...
Thorkil Værge's user avatar
4 votes

How to compute SegWit txid?

Is data that hashed as txid includes witness? No, the txid is the hash of just [nVersion][txins][txouts][nLockTime] which is the same as a serialized non-witness transaction. That means the signature ...
meshcollider's user avatar
  • 11.9k
4 votes

Values for txid and vout for create a coinbase transaction

The coinbase transaction contains a single input, which has txid set to 0000000000000000000000000000000000000000000000000000000000000000 and vout set to 0xFFFFFFFF.
meshcollider's user avatar
  • 11.9k
4 votes
Accepted

Developing a Bitcoin POS (Payment Page) - How do I identify the transaction

The only right way of of doing this is generating a new address for every expected payment, and then waiting until you've received that amount on that address.
Pieter Wuille's user avatar
4 votes
Accepted

How does a node get information from the TxID?

Yes, all txids are calculated only from non-witness data. While many nodes have a complete copy of the blockchain (which does contain all transactions), most nodes do not have a full transaction index....
Murch's user avatar
  • 76k
4 votes
Accepted

How are TXIDs determined from the raw hex data of a block? Also, what is the coinbase transaction?

Transaction ID (TXID) are determined by a double SHA256 hash of the transaction data, but represented in little-endian. For example, the transaction data of the coinbase transaction is: ...
Angelo's user avatar
  • 423
4 votes

How are TXIDs determined from the raw hex data of a block? Also, what is the coinbase transaction?

It is a little-endian double SHA256 hash of the binary transaction data Some subtle mistakes I've seen people make: Not converting hex to binary before hashing. Hash("DEADBEEF") is not the ...
RedGrittyBrick's user avatar
3 votes
Accepted

Ripple: How to calculate transaction ID (TXID)

The transaction ID is calculated by prepending the bytes 0x54, 0x58, 0x4e, 0x00 to the signed transaction and then taking the SHA512Half of this input. Example for a signed transaction, bytes are ...
Thorkil Værge's user avatar
3 votes
Accepted

Why didn't Bitcoin implement segwit in the first place?

Why didn't Bitcoin implement segwit in the first place? The reason Bitcoin didn't initially have SegWit is up to interpretation, I would say that it simply was not thought of prior to transaction ...
Mason Ticehurst's user avatar
3 votes

Find message attached to Bitcoin transaction?

Transactions do not have comments attached to them. Any comments are local to a person's wallet only. They are not broadcast to the network nor are they actually attached to a transaction. So you ...
Ava Chow's user avatar
  • 70.9k
3 votes
Accepted

Create raw transaction what txid

In the console do listunspent that will show you all the UTXO in your wallet including the txids. You can type help to get a list of commands, then help <command> to get details about each ...
Albert S's user avatar
  • 1,640
3 votes

Figure out transaction ID

Some wallets have a function called something live "View on block explorer". For Electrum, you can see it if you right-click a transaction. This will take you to a website on which you find your ...
UTF-8's user avatar
  • 3,224
3 votes

Is it only out of sheer luck that all my "txid"s are unique? How should I handle multi-vout transactions?

Why has none of them ever used more than one vout? If each of your transactions only sends Bitcoin to one receiver, then there's going to be only one receiver output in each of those transactions. ...
Ava Chow's user avatar
  • 70.9k
3 votes
Accepted

Is txid a required field on all transactions?

A txid is calculated from the transaction data by hashing the transaction (excluding the witness). It's not part of the transaction, but rather derived from the transaction. You can rely on it being ...
Murch's user avatar
  • 76k
3 votes

example of transaction ID in a ledger account

All Bitcoin transaction IDs look similar, regardless of the software or device used to create them Randomly chosen example of a recent transaction ID: ...
RedGrittyBrick's user avatar
3 votes

How to compute a TXID of any bitcoin transaction in Python

That's a SegWit transaction, not all of it is part of the transaction hash preimage (see here for details). You have to exclude the SegWit parts. This Bash one-liner returns the correct TXID: echo '...
bca-0353f40e's user avatar
  • 1,045
3 votes

What is the circular dependency in signing a chain of unconfirmed transactions?

In Bitcoin funds are tracked in the form of Unspent Transaction Outputs (UTXOs). When building a transaction you declare exactly which UTXO you are spending by providing the UTXO’s outpoint. The ...
Murch's user avatar
  • 76k
2 votes

tx-malleability who re-signed the tx?

Actually, nobody else can create a valid signature for your transaction inputs, as they do not possess the private keys to do so. When a transaction is malleated by a third party, it is not re-signed,...
Murch's user avatar
  • 76k
2 votes

How does TXID gets created and at which point

The TXID, the transaction ID, is a hash of the serialized (non-witness) transaction whose UTXO is being spent. It gets created at the same time as the transaction does
meshcollider's user avatar
  • 11.9k
2 votes
Accepted

Why does bitcoin-cli not show the correct TXID for this transaction?

decoderawtransaction in 0.14.2 has some issues with decoding segwit transactions. Sometimes it will decode segwit transactions as non-segwit. These should mostly be fixed in Bitcoin Core 0.15.0.
Ava Chow's user avatar
  • 70.9k
2 votes

I think I found 241 Bitcoin

Before you do anything, you probably want to make a couple backups of the wallet.dat. Check that the backups are in order before continuing. zapwallettxes only works on the start up of Bitcoin Core. ...
Murch's user avatar
  • 76k
2 votes

Getting the wrong txid for coinbase transactions

The hash you created is the wtxid (hash of Witness ID), not the txid (hash of Transaction ID): For the difference between txid and wtxid, see Mastering Bitcoin ch. 7 § "Transaction identifiers".
Geremia's user avatar
  • 4,704
2 votes
Accepted

Getting the wrong txid for coinbase transactions

The txid is the hash of transaction without segwit data. The full coinbase transaction contains the segwit data which will result in the hash that you got. However that is not the txid.
Ava Chow's user avatar
  • 70.9k

Only top scored, non community-wiki answers of a minimum length are eligible