Hot answers tagged

43 votes

What is P2PK, P2PKH, P2SH, P2WPKH - ELI5

P2PKH: "Pay To Public Key Hash" This is how transactions are made. You are requiring the sender to supply a valid signature (from the private key) and public key. The transaction output script will ...
  • 1,336
13 votes
Accepted

What is this unusual transaction in the Bitcoin blockchain?

The first output of transaction b53e3bc5…5377f141 has the following scriptPubKey: OP_PUSHNUM_1 OP_PUSHBYTES_32 01010101…0101010101 The segwit softfork in 2017 defined versioning rules for all native ...
  • 68.6k
12 votes

What is the maximum number of inputs/outputs a transaction can have?

The total size of the transaction must be less than 100,000 bytes or it will not be relayed across the network or included in blocks. There COULD be a miner that is mining >100K transactions, but I ...
10 votes
Accepted

Why does vout sometimes not have address?

An address is a convenience feature designed to make human usage of Bitcoin easier - the Bitcoin protocol itself does not know anything about addresses. All outputs are actually sent to programs ...
  • 16.7k
10 votes
Accepted

Why are transaction input and output indices called `vin` and `vout`?

The original Satoshi codebase used a programming style called "Hungarian notation", where variable names are prefixed with letters that indicate the data type they contain. v in particular ...
7 votes
Accepted

How would you end up with more than two transaction outputs?

How is it then that a transaction can have four outputs? Is it possible to pay more than one person (address) in a single transaction? Yes, a transaction can have several inputs and several outputs. ...
  • 2,254
7 votes

How do they put several bitcoins into a block?

By block they are not referring to the blockchain. They just mean that the 24,518 BTC will be divided into 12 different lots (or blocks) with each auction containing about 2,000 BTC. https://news....
7 votes
Accepted

Will all UTXOs eventually be worth 1 Satoshi?

Can two UTXOs ever be combined into one UTXO? Yes, absolutely. Each transaction can have any number of inputs and outputs; it can certainly have fewer outputs than inputs. Here for example is a ...
7 votes

what's the point of "n" in "vout"? getrawtransaction

The vout index (n) that you see after calling decoderawtransaction is added by bitcoind. It is not present in the raw transaction data. If you manually decode the serialized tx for your example, you ...
  • 16.7k
7 votes
Accepted

what's the point of "n" in "vout"? getrawtransaction

Since it's an array, couldn't you just use the array index? Seems redundant, but i'm sure there's a reason. Thanks Yes, you could. In fact, that is how n is calculated since it isn't actually stored ...
  • 65.6k
6 votes
Accepted

How to retrieve the from and to wallet addresses of a transaction?

Which part / field of the input refers to the hash of the output? The outpoint contains a txid (32 bytes) and vout (4 bytes), which specify the output you're spending. This is not the sending ...
6 votes
Accepted

At most two outputs according to Bitcoin whitepaper. Multiple outputs in real transactions. How come?

Note the word normally at the beginning of the sentence. This isn't imposing a restriction but merely describing a common use case. It's obviously useful to allow more than two outputs, and there's ...
6 votes
Accepted

What are the standard formats of transaction outputs?

AFAIK there are 5 different standard non-SegWit transaction types, and 4 SegWit ones. Non-SegWit: Pay to public key (P2PK) PUSH (1 byte) + <compressed/uncompressed_pk> (33/65 bytes) + ...
  • 2,882
6 votes
Accepted

Can a coinbase transaction have a segwit output?

Other than the total value needing to be correct (no more than the block reward plus fees), the outputs of a coinbase transaction are completely unrestricted and act the same as any other transaction.
  • 15.3k
6 votes
Accepted

Will cross-input signature aggregation need a new output type?

Cross-Input Signature Aggregation (CISA) is an idea for allowing multiple inputs to be covered by a single signature. One of the main motivations is that it would allow multiple users to combine ...
  • 68.6k
6 votes
Accepted

Why are segwit transactions cheaper than legacy transactions?

Why are segwit transactions cheaper? Segregated witness transactions are cheaper because they are designed to be. In legacy transactions, every byte has the same "cost"; they all count ...
5 votes

How would you end up with more than two transaction outputs?

When you said "as a result you have two outputs: The spent amount and the change", that is only one special case for Bitcoin transactions. In a general Bitcoin transaction, here is what actually ...
  • 883
5 votes
Accepted

Why do some outputs have a zero value and no address?

The outputs have no address because they are data-carrying outputs. { "spent":false, "tx_index":80899271, "type":0, "value":0, "n":3, "script":"...
5 votes
Accepted

Why same output address is invalid in a transaction on Bitcoin Core?

It is not invalid. The code you are looking it is unrelated to validation and relay of actual transactions. You are looking at the code for RPCs which are just things for users. The RPC disallows ...
  • 65.6k
5 votes

What is this unusual transaction in the Bitcoin blockchain?

To add to Murch's answer: The output was created by Matthew Zipkin to test support for sending to SegWit v1 support on purse.io. This was done in the context of the Bitcoin Optech Compatibility Matix. ...
  • 1,392
4 votes

What is the maximum number of inputs/outputs a transaction can have?

The economical way in your case would be to pay off (create as much outputs) as you can to decrease the fee cost. Some standard transaction with one proven input and one output is about 161 - 250 ...
  • 869
4 votes
Accepted

Are transactions containing zero-value output accepted by miners?

Each miner (or mining pool) sets their own policy, but miners using Bitcoin Core 0.9.0 and later will, by default, mine OP_RETURN (null data) outputs with zero value. They will not, by default, mine ...
4 votes

How would you end up with more than two transaction outputs?

Short answer: yes, you can do multiple payments in one transaction, and that's more efficient than doing them separately.
4 votes

How come that there can be many transfers in a single Bitcoin transaction?

Ethereum is an account based system. It relies on the sender specifying the sequence of transactions to prevent double spending. The balance is associated with an address and when you spend from that ...
  • 68.6k
4 votes

How to retrieve the from and to wallet addresses of a transaction?

The scriptPubKey contains the public key used to synthesize the public address. Here are two pedantic approaches, not using bitcoinj, applying bx commands to synthesize the public address of interest ...
  • 2,997
4 votes
Accepted

How to find out the requirements for spending an output script?

I'm assuming you're talking about P2SH addresses here, since that's really the only time this matters. For standard P2SH addresses, you cannot find the spending requirements by just looking at the ...
  • 16.7k
4 votes
Accepted

What are the hashes in Unspent outputs?

tx_hash and tx_hash_big_endian are the transaction id of the transaction that this output originated from in little endian and big endian (reversed). tx_output_n is the number of the output in the ...
  • 3,404
4 votes

Is it possible to write a transaction of bitcoins, having only pen, paper and a private key from the address with some unspent outputs?

The transaction digest alone would take around 2 days of non-stop work: http://www.righto.com/2014/09/mining-bitcoin-with-pencil-and-paper.html That's before you even start the 32-byte ...
  • 4,892
4 votes
Accepted

Transaction Output Order

If you create a raw transaction yourself, then that is the raw transaction. Whatever you put in it is exactly what the transaction will be, in the same order. There are some conventions around output ...
4 votes
Accepted

What does the index of an UTXO stand for?

It is the position of your txo in the outputs array of the transaction that created it. You can see that this transaction created 2 outputs and that your output is the first one (0). This index is ...

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