Questions tagged [transaction-input]

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

Filter by
Sorted by
Tagged with
8
votes
2answers
2k 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. ...
8
votes
1answer
11k 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/...
7
votes
2answers
2k 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?
6
votes
2answers
2k 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?
6
votes
1answer
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 ...
5
votes
1answer
292 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-...
5
votes
2answers
205 views

Can signature be re-used to cash out everything in the address?

I Know for the P2PK locking script it was like this [pubkey] <OP_CHECKSIG> and then an unlocking script is provided as simple as this: [sig] But if it works like this, others can simply grab ...
5
votes
1answer
410 views

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

With segwit there will be two transaction ids wtxid and txid Can either one of them be used as previous hash or only txid?
5
votes
2answers
232 views

What is the point of including the scriptCode of the input in the transaction digest of segwit?

BIP143 specifies "a new transaction digest algorithm". scriptCode of the input (serialized as scripts inside CTxOuts) What problems could arise if the scriptCode of the input were not ...
4
votes
1answer
595 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 ...
4
votes
1answer
294 views

Are all UTXOs locked by an address spent in a transaction?

Imagine I have 2 UTXOs locked by my address, each of which allows me to spend 5 bitcoins. If I subsequently want to send just 2 bitcoins to someone else, will both UTXOs be used as inputs in the ...
4
votes
1answer
3k views

What happens when two transactions send to the same address?

I would like to know the consequences of sending bitcoin several times to the same address. Let us say I send 1 BTC from Address1 to Address3 and later I send 2 BTC from Address2 to Address3 again. ...
3
votes
1answer
353 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 ...
3
votes
1answer
447 views

How can the segwit witness data be "off-chain"? What does it really mean?

I have several questions regarding the segwit witness data. My current understanding is as follows. Before segwit, the witness data was part of the input that the user had to provide so that they ...
3
votes
1answer
122 views

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

In Ethereum one transfer has one transaction ID. How come there can be many transfers in a single Bitcoin transaction? For example, in this transaction: https://blockchain.info/tx/...
3
votes
1answer
551 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: ...
3
votes
2answers
265 views

Why do we refer to previous transactions in each transaction?

Isn't it enough to just have the Input Address, Output Address, Amount and Signature for each transaction?
2
votes
2answers
400 views

If I reuse the same address can a previously used transaction be reused?

I was wondering, if I used an address adr0 to spend some coins in a transaction tx0 that give the coins to a different address adr1, and eventually, after some time, I receive some (completely ...
2
votes
1answer
112 views

What order does Bitcoin Core place the inputs it spends in?

What order does Bitcoin core place the inputs it spends in? Is it random? Is it sorted by anything? What, if anything, can you tell about the originator of a transaction by the input ordering?
2
votes
1answer
144 views

How does fee split between senders in a transaction?

I know how fee is calculated in a transaction, but I don't know how this fee amount split into senders. For example, consider the following transaction with 0 BTC miner fee: inputs: Alice ...
2
votes
1answer
114 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 ...
2
votes
1answer
506 views

what does it mean when a transaction contain multiple inputs?

Just like https://www.blockchain.com/btc/tx/230636ab4f285ca5e9f4c32dbae581c10d491a99493d8733c594af780f1edc5e what does it mean when a transaction contain multiple inputs? as i know, an transaction ...
2
votes
2answers
840 views

Can you specify more than one output index in a transaction's input?

It looks to me like each input to a bitcoin transaction has an index that specifies only one output from the input its spending. Is there a way to specify more than one output index, or do you have to ...
2
votes
1answer
570 views

Can a low fee unconfirmed transaction prevent confirmations of following transactions?

To be more precise, consider the following situation: Address A gets an input of 4 BTC. You try to make a transaction from A to B with 1 BTC and a very low fee, which means its unconfirmed for a long ...
2
votes
2answers
2k views

Is it possible to get the public key from a transaction input that is a 'pay to public key' output?

I am looking to be able to calculate the public key from the transaction input. The input is from a 'pay to public key' output. Can the public key of the input be generated from just the signature ...
2
votes
1answer
56 views

What would be the implications of limiting Bitcoin transactions to fifty inputs?

One of the issues of increasing the blocksize is the possibility of creating attackblocks which would take significantly longer to parse than the common block. The mechanism to do so is by creating a ...
2
votes
1answer
474 views

How to get fee in a transaction with unconfirmed inputs in bitcoinj?

I am trying to get the fee of incoming transactions in a wallet with bitcoinj. At times it was the commission using Transaction.getFee(), but this was throwing NullPointerException. I got to do a ...
2
votes
1answer
841 views

How can I get the input addresses of a transaction in Java?

I am trying to obtain the addresses of entry of a transaction when I receive money, but I have not found the way. I have tried to create an address with the bytes obtained by calling TransactionInput....
2
votes
2answers
798 views

How to track the bitcoins I spent?

I'm studyng the transactions and how they work. Suppose I would track some bitcoins that I spent. This is a scenario: My pubblic addresses are: addr1 and addr2. I made a transaction tr1 (output like ...
2
votes
1answer
166 views

How to recognize which output is used as input for a new transaction

I want to find out which address's coins will be used in a transaction. I have the txid of a transaction. In vin I see the txid of the input transaction, but how can I know which output of this ...
1
vote
1answer
177 views

Is sharing a signed input safe?

Is it possible to decode the private key from a signed input? For example: From this signed input hex... ...
1
vote
1answer
639 views

Why are the inputs of Bitcoin transactions signed?

This is my understanding of what a transaction looks like: inputs: input0: txid: <funding tx0 TXID> outputID: <output ID of UTXO in the funding tx0> scriptSig: <...
1
vote
1answer
118 views

How to read a transaction from a block? Who paid whom?

I'd like to know how to read a 'transaction', so if we take an example of this transaction (which comes from block #520156) it's easy to spot that 'th' paid 'U8' 0.005BTC and '9E' paid 'Y5' 0.013BTC. ...
1
vote
1answer
68 views

How are 'excessive' numbers of inputs and outputs handled in bitcoin transactions?

I wrote a bitcoin transaction parser in python and it flips out when transactions have more than 255 inputs or outputs. Some transactions have their number of inputs/outputs represented by a 1 byte ...
1
vote
1answer
791 views

Submitted a raw tx that was already on the blockchain, to test it. I got 'missing inputs' instead of 'already exists'. Why?

In an attempt to more fully understand raw transactions etc, I went to look at tx 518c41d5e59114f6a23383afbe95f02cdd09cb50cabd8390bdd9162a890435b3 in its raw form being: ...
1
vote
1answer
290 views

How to get address from CTxIn object

I'm reading bitcoin core source code. I want to know how to get bitcoin address from CTxIn object. I have a CTransaction object. I found the way how to get addresses from vout like the following. But ...
1
vote
2answers
245 views

What is the difference between transactioninput.getFromAddress() and transactioninput.getConnectedOutput().getAddressFromP2SH(networkparameter))?

I was expecting that, in the case when getFromAddress() returns an address, transactioninput.getConnectedOutput().getAddressFromP2SH(networkparameter)) should return the same address. But, sometimes ...
1
vote
1answer
18 views

How is the input and output fields serialised in a transaction?

I'm trying to write a parsing function to find the input and output fields in a serialised transaction. My problem is that I can find the number of inputs and outputs using the varint byte(s), but not ...
1
vote
1answer
318 views

How to create a bitcoin transaction without inputs

How can I create a transaction without inputs and it will be broadcasted but of course won't get confirmed? I would like the simplest method to do this
1
vote
2answers
439 views

Do i need to sign each input in a raw transaction?

I've been reading up about raw transactions on bitcoin.org and there are two examples Simple and Complex. What I can't tell from the information provided is if it necessary to sign each of the inputs ...
1
vote
1answer
151 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. ...
1
vote
1answer
89 views

What is "Witness"?

What really is "Witness"? I saw this data in blockchain and can not identify what it really is. Here is the dump of transaction for example. TX hash = ...
1
vote
1answer
3k views

Usage of PkScript as a part of Inputs of a Transaction

I've seen transactions with PkScripts as part of Inputs eg : Example of such a transaction Could anyone please explain how this PkScript is used ?
1
vote
1answer
100 views

What does is mean to have input from multiple wallet addresses?

I've trying to parse some data from the blockchain as provided by blockchain.info My question is about transactions that have multiple inputs like this one: https://www.blockchain.com/btc/tx/...
1
vote
1answer
663 views

bitcoinj java library not decoding input addresses for some transactions

I'm trying to "extract" sender's addresses from OP_RETURN Bitcoin transactions, but my code is not working properly. getWalletAddressOfSender(final Transaction tx) public static Address ...
1
vote
2answers
100 views

How many weight units does an input use?

What is the weight unit cost of an input? And can you batch/aggregate the inputs or is it linearly growth when you add more inputs to a tx?
1
vote
2answers
486 views

send btc from specific input without running bitcoind

Is there any third-party API allowing to send Bitcoins using specific transactions as inputs? Back in 2013 I had to run bitcoind myself and build a raw transaction manually. But maybe it's easier now,...
1
vote
1answer
21 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-...
1
vote
2answers
136 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 ...
1
vote
2answers
80 views

how to use multiple time specific address in input scripts with difference balances?

look at to the following transaction (withdraw transaction from binance) https://blockchain.info/tx/404fd22d3d88d129975d03fe2993f0126db8f066b3d8126d6cca676747439515?show_adv=true How in input scripts ...