Questions tagged [transaction-input]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
30 views

signing input for spend funds locked by this script

Please explain how to sign input for raw transaction with privet key corresponding to 1st or 2nd public key in this script "asm": "OP_IF 1694275749 OP_CHECKLOCKTIMEVERIFY OP_DROP ...
alnostru's user avatar
0 votes
1 answer
59 views

How to get the hex for a tx input (for btcdeb tool)

I am trying to understand how btcdeb (Bitcoin script debugger from Bitcoin core) works. In the usecase of btcdeb --tx=<tx hex> --txin=<txin hex>, how does one obtain the hex of the input ...
Alec Matusis's user avatar
1 vote
2 answers
174 views

Selection of inputs from UTXO's who are not used by other unconfirmed transaction

How to prevent selection of unspent transaction from UTXO's which is already used in another unconfirmed transaction ? I am fetching list of UTXO's from here - https://mempool.space/testnet/docs/api/...
coder123's user avatar
3 votes
1 answer
226 views

Does the coinbase transaction have inputs?

I was wondering if I can add dummy data into a coinbase transaction’s inputs. Is it possible to do this? Can you insert invalid input scripts into a coinbase transaction? Can you add multiple inputs ...
Haim Bender's user avatar
3 votes
1 answer
206 views

Understanding transaction with hundreds of inputs and outputs

I've been trying to follow a transaction with hundreds of inputs from different addresses and hundreds of outputs. This is the transaction I'm looking into: https://www.blockchain.com/explorer/...
Nucklear's user avatar
  • 163
1 vote
1 answer
68 views

Is there a particular order in which transaction inputs are checked for script validity?

When a transaction is being checked for validity, is there a particular order that the inputs are evaluated for script correctness? This might be relevant when determining what consensus changes might ...
James O'Beirne's user avatar
2 votes
3 answers
210 views

Multi input transaction heuristic

I was revising for my upcoming exam and came across this slide, which I don't completely understand as I find it a bit confusing. Can someone please explain what the lecturer was trying to point out? ...
Goel77's user avatar
  • 23
10 votes
2 answers
357 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
  • 72.7k
8 votes
1 answer
682 views

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

What does the v in vin and vout stand for? And is it an instance of a more general naming scheme?
Casey Rodarmor's user avatar
1 vote
2 answers
324 views

How to determine whether an input is of type witness_v0_keyhash or witness_v1_taproot?

Given a raw tx, how to determine whether an input is of type witness_v0_keyhash or witness_v1_taproot? Thanks. For example: ...
Simon L's user avatar
  • 111
3 votes
1 answer
135 views

Is it possible to retrieve input addresses and input values of bitcoin transactions from raw blk.dat files?

I'm developing a script that processes blk.dat files from bitcoin core. So far, I am able to retrieve the following attributes for transaction inputs: "vin", "index", "...
Andreas's user avatar
  • 79
0 votes
1 answer
139 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
  • 147
0 votes
0 answers
178 views

Is there software that can scan for reused R-values?

Is there any up-to-date program that can check for reused R-value for a specific Bitcoin address? (I don't want to scan the whole blockchain, just for a particular address.)
Riaan Groenewald's user avatar
0 votes
1 answer
260 views

How to interpret vin/vout on a Bitcoin transaction?

I used nownodes api to get this response on a transaction: ( [txid] => 38ac1348219f8aa9349f497bfa6f8d05f775cafbbd26354867d22ca84f15e1e1 [version] => 2 [vin] => Array ( ...
rockstardev's user avatar
1 vote
1 answer
106 views

How is a Bitcoin transaction signed using ECDSA?

I am quite familiar with the way secp256k1 ECDSA works as well as the equations that are utilised. However, I have no idea how this ECDSA applies to signing Bitcoin (SegWit Format) and transferring it ...
Jamo's user avatar
  • 157
3 votes
1 answer
138 views

How do you commit to the previous output's amount when signing a segwit input with rust-bitcoin?

I'm trying to sign a segwit transaction in rust-bitcoin. To start with, my transaction setup looks as follows: let previous_output = OutPoint::new(Txid::from_hex("...
arik's user avatar
  • 218
2 votes
1 answer
318 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
37 views

Track the expenditure of an output with Bitcoin-qt via the REST API

How do you find the transaction whose input, vin, is a given output, vout? For example, the following is the JSON representation of the block with height 1000; here the mining reward is locked behind ...
Dr. Strangelove's user avatar
0 votes
1 answer
43 views

Invalid input scripts? Why are they included? Is there a correct way to identify them? [duplicate]

Transaction 88025f2bfa2435a7036a865ea0b4748491d21f9b8cfd72788e9d1c9aa8977e7d is valid, but its one and only input has an invalid script. (There are many transactions like this, but this one will ...
Zephyrus's user avatar
  • 658
2 votes
1 answer
315 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
  • 72.7k
0 votes
1 answer
263 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
  • 72.7k
0 votes
2 answers
75 views

Why is the previous output index 4 bytes?

Using this post to define the format of a transaction: Create Output with a bunch of input Why is the previous utxo index (also called the previous output index) 4 bytes? The maximum output index ...
andozw's user avatar
  • 25
0 votes
1 answer
92 views

Can I trace Bitcoin transactions using spent_transaction_hash?

I've spent some time analyzing Bitcoin transaction data and found out that the input column has this value called "spent_transaction_hash". In the dataset, the definition of this value is &...
Sarah Grimes's user avatar
0 votes
1 answer
139 views

P2SH-Multisig transaction not going through

I have some funds locked in a testnet P2SH address which requires 2-of-3 signatures. This is the address: 2NEKRqUqoDtsELzpBa5wuWEiJeVbio5cSa2 and the 3 keys: #1 - ...
Keijyu's user avatar
  • 95
1 vote
1 answer
119 views

What exactly is signed in "prev_out"?

What is signed by scriptSig? I use my private key to sign data from the unspent transaction? I sign the "prev_out" object? I read that the signature in "prev_out" is there to ...
Rony Tesler's user avatar
1 vote
1 answer
120 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
  • 72.7k
1 vote
1 answer
928 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 = ...
Denis Leonov's user avatar
1 vote
1 answer
30 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 ...
Chiru's user avatar
  • 141
0 votes
1 answer
67 views

Understanding transaction input and ouput

The definition of bitcoin transaction input and output that is there on the web is: Input = address from which money was sent, Output = address to which money is received 1. But when I looked at one ...
Amit wadhwa's user avatar
0 votes
1 answer
130 views

Confused about input and output spending limitations and consolidation

I am sure the answer to this is trivial to someone who already knows the answer, but not to me. I recently wanted to spend some received bitcoin for the first time and discovered that the associated ...
Robonoob's user avatar
0 votes
1 answer
103 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
0 votes
2 answers
50 views

How 1 address can create 14 inputs in output transaction to 1 direct address?

Check this address 1NM3apKLeDGKiFsd6gu1o4nh52efi38iEv The reason of this extremely high fee because of 14 inputs But why 1 address generate 14 inputs instead 1?
Владимир Владимирович's user avatar
4 votes
1 answer
851 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
  • 72.7k
3 votes
1 answer
930 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 ...
Pascal Bergeron's user avatar
0 votes
2 answers
305 views

How many addresses can be in input and output of a transaction

I have read through this question and i understand that there can be many sender and receiver addresses within 1 transaction(i'm new to bitcoin transaction, previous i was working with ethereum where ...
Linh Nguyen's user avatar
2 votes
1 answer
268 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
0 votes
0 answers
26 views

Relation between transaction fees and inputs [duplicate]

So this might appear as a duplicate of some of the other questions on this stackexchange, but I feel most of the questions have failed to ask a question that I am really interested in. I want to ...
coder123's user avatar
  • 113
1 vote
1 answer
186 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... ...
Michael's user avatar
  • 173
5 votes
1 answer
447 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
  • 72.7k
0 votes
1 answer
52 views

More Input-Values than necessary. How and why is this possible? No it is not the fees!

The TXID I am talking about: 21179a8560a0a0906f0c3396af338f74528130d46b65b7f0c79c378d343b3177 blockchain.com link: https://www.blockchain.com/btc/tx/...
Corvo_Kaan's user avatar
0 votes
1 answer
50 views

How to know where number of inputs field ends in a transaction if it is not a fixedsize field?

I know that we parse a transaction in bytes. So there are 2 quesions that I search for the answers of: 1- Can VarInt field -that gives the number of inputs in a transaction- be more than 2 hex digits(...
Efe's user avatar
  • 383
0 votes
1 answer
106 views

How do I calculate the sum of transaction inputs?

I am attempting to calculate the mining fee of a transaction, given it's unsigned transaction hex by taking difference between the sum of the inputs and outputs. I also have access to an array of ...
user104928's user avatar
0 votes
1 answer
52 views

Is it possible to reference an input outpoint more than once in a transaction?

For example, could you have the following transaction: A --> B A --> C Where A is an input txid and index, and B and C are outputs? The reason I'm asking is because I believe with SIGHASH_SINGLE ...
Darius's user avatar
  • 779
5 votes
2 answers
216 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 ...
gudako's user avatar
  • 159
0 votes
1 answer
53 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
1 answer
54 views

Input of a transaction

If i want to send 0.2 bitcoin to Bob, will my transaction (in the input field) contain the list of all my previous transactions (both the ones in which i received bitcoins and the ones in which i sent ...
AleWolf's user avatar
  • 133
1 vote
1 answer
6k 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 ?
psaw.mora's user avatar
  • 121
1 vote
1 answer
541 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
sissy's user avatar
  • 21
0 votes
2 answers
59 views

Can addresses used in a single tx be assumed to be from the same wallet?

can addresses of input of a single tx be always considered as belonging to same account? Above is a sample transaction on bitcoin. Here, input addresses are 3P2hJg8iRSBExAjd9yQGaazCLPFLeGB3hU (0....
dingyo777's user avatar
  • 147
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