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 ...
Monstrum's user avatar
  • 1,334
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 ...
Murch's user avatar
  • 75.4k
11 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 ...
Pieter Wuille's user avatar
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 ...
Raghav Sood's user avatar
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 ...
Nate Eldredge's user avatar
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. ...
karask's user avatar
  • 2,540
7 votes

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

These numbers are slightly different today after the segwit and taproot softforks got activated. A standard transaction is limited to 400 000 weight units (WU). The smallest standard (single-sig ...
Murch's user avatar
  • 75.4k
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....
dontmindme's user avatar
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 ...
Raghav Sood's user avatar
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 ...
Ava Chow's user avatar
  • 70.5k
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 ...
Nick ODell's user avatar
  • 29.4k
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 ...
Nate Eldredge's user avatar
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) + ...
sr_gi's user avatar
  • 3,220
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.
Claris's user avatar
  • 15.4k
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 ...
Murch's user avatar
  • 75.4k
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 ...
Pieter Wuille's user avatar
6 votes
Accepted

What would happen if we provide witness program different than 32 bytes for SegWit 1?

SegWit version 1 outputs with lengths other than 32 bytes remain unencumbered, which means their validation is unchanged and they remain anyone-can-spend. From BIP341: A Taproot output is a native ...
Vojtěch Strnad's user avatar
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 ...
Nayuki's user avatar
  • 882
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 ...
Ava Chow's user avatar
  • 70.5k
5 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 ...
Antoine Poinsot's user avatar
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. ...
0xb10c's user avatar
  • 1,430
5 votes

Why is little endian used in transaction formatting and other parts of bitcoin?

To add onto RedGrittyBrick's answer, little endianness is a result of using little endian CPUs, and then sending data as it is stored in memory. On little endian architectures, integers in memory are ...
Ava Chow's user avatar
  • 70.5k
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 ...
skaht's user avatar
  • 3,057
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.
Pieter Wuille's user avatar
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 ...
Murch's user avatar
  • 75.4k
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 ...
Raghav Sood's user avatar
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 ...
Mike D's user avatar
  • 3,569
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 ...
pinhead's user avatar
  • 5,144
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 ...
Pieter Wuille's user avatar
4 votes

What exactly is the "vout" field?

vout is the 0 based output index. It can be more than just 0 or 1, but those tend to be the most common because people don't make transactions with lots of outputs. To understand vout, you must ...
Ava Chow's user avatar
  • 70.5k

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