Questions tagged [transaction-input]

Questions about the mechanics of redeeming a UTXO in an input script.

Filter by
Sorted by
Tagged with
11 votes
2 answers
4k views

How do virtual size, stripped size and raw size compare between legacy address formats and native segwit?

This answer states that SegWit doesn't reduce transaction size. If this is true, why is it cheaper to send a SegWit transaction?
ecurrencyhodler's user avatar
4 votes
1 answer
441 views

What is the weight of a P2TR input?

I'm looking for a detailed explanation of the weight, vsize and serialized length of a P2TR input, in the same vein as How big is the input of a P2PKH transaction?.
Murch's user avatar
  • 75.3k
7 votes
1 answer
1k views

How big is the input of a P2PKH transaction?

How many bytes does a P2PKH input have? I'm finding a few different numbers: Why does the default miner implementation use pay-to-pubkey? states: push + sig + push + key = 1 + 72 + 1 + 61 = 139 ...
Murch's user avatar
  • 75.3k
4 votes
1 answer
982 views

What is the size and weight of a P2WPKH input?

I'm investigating diverging P2WPKH input size calculations on two Bitcoin projects and some blog posts. I'm looking for a detailed explanation of the exact weight, vsize and serialized length of a ...
Murch's user avatar
  • 75.3k
0 votes
1 answer
401 views

What is the size and weight of a wrapped segwit single-sig input?

I'm looking for a detailed explanation of the exact weight, vsize and serialized length of a P2SH-P2WPKH (wrapped-segwit single-sig) input, in the same vein as How big is the input of a P2PKH ...
Murch's user avatar
  • 75.3k
8 votes
2 answers
3k views

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

Given a transaction's inputs and outputs, I'd like to be able to extract the wallet address (or addresses) which sent the transaction, and also the address/addresses that will receive the transaction. ...
Click Upvote's user avatar
7 votes
2 answers
3k views

How do transaction costs compare between Bech32 addresses and legacy Bitcoin addresses?

Now that Electrum 3 supports Bech32 addresses for segwit, when sending coins to a legacy address are fees higher or cheaper?
Patoshi パトシ's user avatar
15 votes
3 answers
9k views

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

Is there a maximum recommended number of inputs/outputs for each transaction? I was scripting a faucet and wasn't sure whether to payout in one transaction to all addresses or split them into groups ...
cainy393's user avatar
  • 251
8 votes
1 answer
16k views

multiple input and output addresses in bitcoin transactions

I was checking transactions in blockchain.info. I have some questions about transaction information about input and output addresses. block address: https://blockchain.info/address/...
Mahla's user avatar
  • 103
2 votes
1 answer
164 views

What is the exact size and weight of a 2-of-2 P2WSH input?

I'm proofreading an article mentioning the cost reduction of P2TR for Lightning channels in comparison to P2WSH. To that end, I'm looking for the precise weight, vsize and serialized length of a 2-of-...
Murch's user avatar
  • 75.3k
10 votes
2 answers
382 views

Why is the locktime set at transaction level while the sequence is set at input level?

Giacomo Zucco pointed out the oddity of there being one timelock field per transaction, but one sequence per input. Even for the original use of determining the order of replacement, it would seem ...
Murch's user avatar
  • 75.3k
5 votes
1 answer
1k views

Maximum number of inputs per transaction

In theory, what is the maximum number of inputs per transaction? Is it defined primarily by the maximum number we can store on the 9 byte varint? How big of a number can be stored on 9 bytes? Would ...
Pedro's user avatar
  • 385
5 votes
1 answer
492 views

What are the sizes of single-sig and 2-of-3 multisig taproot inputs?

There was a Twitter discussion about the sizes of inputs and Taproot came up. What are the input sizes for Taproot inputs? Please cover both the key path spend (single-sig or default spend) and 2-of-...
Murch's user avatar
  • 75.3k
3 votes
2 answers
764 views

How much does the weight of 2-of-3 multisignature inputs differ between P2SH and P2SH-P2WSH?

I'm trying to calculate the weight of a 2-of-3 multisignature P2SH-P2WSH input. I found the related question Predict multi signature transaction size, which I've calculated with m=2, n=3 here: ...
Murch's user avatar
  • 75.3k
2 votes
1 answer
305 views

How is the UTXOs of each partially-spent TxIn determined?

My current understanding of a transaction is as follows: a transaction (Tx) can have multiple inputs (which are previous unspent transactions = UTXOs), let's call them the TxIn a Tx can have multiple ...
Jean Monet's user avatar
2 votes
1 answer
377 views

Segwit includes the input amount in the SignatureHash. What possible attack can this prevent?

Legacy transactions only include transaction components in the SignatureHash, but segwit transactions also add the amounts of inputs in the SignatureHash. Quoting from the Mastering Bitcoin Book: ...
The Quantum Physicist's user avatar
1 vote
1 answer
168 views

Processing multiple transactions very fast

Let's say I run an automated script, with the main purpose to send transactions as fast as possible. I want to send one transaction with 5 BTC to one address and a transaction with 2 BTC to another. ...
Fabulous Job's user avatar
1 vote
1 answer
670 views

How to calculate scriptPubkey?

Given an address (i.e. 1BnPVV5Tt25cxbDg6DqoxJunjSL8reCGz6), how can I calculate its scriptPubKey in order to build a transaction?
user2298995's user avatar
1 vote
2 answers
177 views

What’s the purpose of checking for input overflow?

Everyone knows this famous fix for block 74638 which still exists in other files. But there’s something I can’t understand, why check for inputs overflow since it’s not possible to have enough utxo ...
user2284570's user avatar
1 vote
2 answers
3k views

How to get input address and amount from vin using bitcoin core rpc

I am trying to find details of every transaction using bitcoin core rpc. First, I using bitcoin-cli getblock to get the block data, then use bitcoin-cli getrawtransaction to get the transaction ...
Jun Fang's user avatar
  • 155
0 votes
1 answer
196 views

How do I determine whether an input or output is segwit? - revisited

This is a discussion that has already been had here, but bear with me. We're gonna be talking about tx faae7e55db14a32e083cbf6a91db8a5ab6a3b05e050d9cefdec80b47f966848e all I got is the encoded ...
RooSoft's user avatar
  • 157
0 votes
1 answer
55 views

Do transactions need to be signed

I always thought a transaction can be accepted when all its inputs are correctly provided with their unlock script (which usually contains a signature) ——yes transactions may also be rejected with ...
gudako's user avatar
  • 159
0 votes
2 answers
1k views

Sign transaction with multiple inputs using bitcoinj/peercoinj libraries

Good day for everyone! I have some troubles with adding signed Input to the transaction. Currently, I'm working with altCoin (fork peercoin) currency. I'm trying build the transaction in the ...
Timur Panzhiev's user avatar
0 votes
1 answer
2k views

what happens to UTXOs when a transaction output script is satisfied?

As per my understanding from the book "Mastering bitcoin", a transaction output contains three things Amount - Bitcoin Value in Satoshis Locking-Script-Size - Locking-Script length in bytes, to ...
Learner's user avatar
  • 11
0 votes
1 answer
114 views

What does this Pubkey mean?

I just started learning about Bitcoin, and am sorta familiar with p2pk and p2pkh. I just found this input on a Bitcoin blockchain explorer: It looks like the Pkscript can be "solved" (I'm ...
yoyobigmanyo's user avatar