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 ...
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 ...
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 ...
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 ...
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 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 ...
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 ...
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 ...
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) + ...
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.
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 ...
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 ...
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 ...
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 ...
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 ...
5
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 ...
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.
...
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 ...
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 ...
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 ...
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 ...
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 ...
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
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
Can you have a transaction without a change output?
Yes, absolutely you can. I think the article intend "the simplest case" in the real world usage, where is highly unlikely that you have to pay the exact amount of one of your UTXO, if not ...
4
votes
Explain like I am 5...how can one transaction hash have so many outputs?
A transaction can have many outputs, hundreds.
Whoever creates that that transaction just has to know the address for each recipient.
Say you set up a business with a thousand employees and paid them ...
4
votes
Accepted
Understanding transaction with hundreds of inputs and outputs
You are looking at a CoinJoin transaction, likely created by Wasabi. It's a type of collaborative transaction that mixes the funds of many users together to break the links between individual inputs ...
4
votes
Accepted
How come an `OP_3` P2SH redeem script is spendable?
A script execution is successful if it ends with a non-empty stack whose top element is not 0. Therefore, a script consisting of only OP_3 will be successful.
You may also be interested in the topic “...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
output × 114transactions × 50
transaction-input × 18
utxo × 14
raw-transaction × 12
script × 11
transaction-fees × 10
address × 7
blockchain × 6
segregated-witness × 6
transaction-verification × 5
input × 5
change × 4
bitcoin-core × 3
wallet × 3
hash × 3
multi-signature × 3
protocol × 3
balance × 3
coinbase-transaction × 3
taproot × 3
non-standard-transaction × 3
address-format × 3
security × 2
private-key × 2