Skip to main content

Questions tagged [input-script]

The input script ("scriptSig") is a transaction component used to satisfy the spending conditions specified in the output script ("scriptPubKey"). It is only used with legacy output types, for native segwit outputs it is empty and replaced by the witness structure.

Filter by
Sorted by
Tagged with
3 votes
1 answer
66 views

What are the Trade-offs for Input Script Deduplication?

One possible optimization to compress bitcoin transaction size is avoiding repetition of redundant data between inputs. As a consensus change, a new transaction type could allow signing a list of txid:...
Otto Allmendinger's user avatar
1 vote
0 answers
29 views

ScriptSigSize fdf501 [duplicate]

I am trying to understand what scriptsigsize is. If I look at this transaction, the scriptsigsize of the first input would be "fdf501"? If I convert it to decimal, it cannot be the ...
Jim Quick's user avatar
1 vote
1 answer
35 views

Transaction Validation

What will it mean if the tranasaction input contains both signature script and witness, in case of scriptpubkey_type of p2sh or p2pkh, will it be invalid or valid ? As we use witness for SegWit ...
lladane's user avatar
  • 13
1 vote
2 answers
99 views

Why do some P2SH spending transactions have data both in the ScriptSig and Witness field?

I wonder if the wallet screwed up or if I am missing something in my bitcoin understanding. Here is the tx output being spent: "value": 0.00180675, "n": 154, ...
J S's user avatar
  • 35
0 votes
1 answer
42 views

Bitcoin API for getting an input script?

I wanted to try talking to my bitcoin node to get the input scripts and put them into a database. Does anyone have good resources on where I can look to get started?
mark's user avatar
  • 35
2 votes
1 answer
148 views

Can OP_DROP be used to include arbitrary data?

I have recently been looking into OP_RETURN and its uses in so far as including data in a transaction. Given the fact that OP_RETURN is limited to 80 bytes I thought what if OP_DROP was used? That way ...
user2334659's user avatar
3 votes
1 answer
169 views

Processing bitcoin reward block's input transaction

I'm parsing the block response of my bitcoin node and everything is going ok. The only thing I don't understand is how to parse the input transaction of the block reward. This is the array that I see ...
Monte Conte's user avatar
1 vote
1 answer
57 views

Does bitcoin transaction have source address?

I know that bitcoin transaction is based on UTXO, including input script and output script. But recently I browse bitcoin explorer and I found it listed source addresses of a transaction. I wonder ...
Harry's user avatar
  • 41
0 votes
1 answer
83 views

conditional spending from P2WSH address

What im doing wrong? Sinse I found out that Bitcoin is programmable money Im trying to use it potential. Using this site https://improvein.github.io/bitcoin-forge/?#/script/create I’ve created a ...
bitc's user avatar
  • 1
0 votes
1 answer
103 views

What fields of a coinbase transaction can be empty?

Is it correct to say: As the coinbase transaction doesn't need to identify an output, there is no need for the input scriptSig. Would a block be accepted in which the coinbase transaction has an ...
Lee's user avatar
  • 877
0 votes
1 answer
133 views

HOW TO SPEND P2SH with Redeem Script Hex?, Already make the transaction but still have some error

I HAVE ERROR "scriptsig-not-pushonly" on this ...
Tepan's user avatar
  • 3
4 votes
1 answer
167 views

Why is concatenating scriptPubKeys and scriptSigs unsafe?

Around the 5:00 timestamp in this talk, John Newbery states that running the concatenation of scriptPubKey and scriptSig is unsafe, since it can result in someone using a carefully crafted scriptSig ...
Cosmik Debris's user avatar
1 vote
1 answer
38 views

`fundrawtransaction` error when trying to spend an HTLC

I'm trying to use the fundrawtransaction RPC command in order to create a transaction spending an HTLC output. Here is the command i've entered: fundrawtransaction "...
Rafique Scott's user avatar
2 votes
1 answer
79 views

What is prepended to the front of a ScriptSig and ScriptPubKey of a P2PKH transction?

In some educational materials on bitcoin P2PKH transactions, I'll see 2 digits included in the front of what would be considered the ScriptSig. For example, what is the 8b in the front of the ...
jiamijiang's user avatar
2 votes
1 answer
108 views

Why inputs' scriptSig are stripped before the whole transaction being signed?

In this video, the lecturer explains that before the whole transaction get signed, the scriptSig part of inputs are removed, and this causes the ability to perform transaction malleability attacks. My ...
Amir reza Riahi's user avatar
2 votes
1 answer
144 views

Where are transaction signatures beside the scriptSig?

To spend a UTXO, we need to sign it (have the scriptSig). Then we can spend that UTXO to any address we want, which it wasn't included in the signature we produced for unlocking the UTXO. So we should ...
Amir reza Riahi's user avatar
1 vote
2 answers
114 views

What are the mean, median, range, limits and trends in the size of coinbase transactions?

I'm attempting to estimate how much "spare capacity" there is for merged mining protocols. As I understand it the scriptSig in the coinbase transaction must be less than 100B. However, the ...
Lee's user avatar
  • 877
1 vote
1 answer
106 views

Why we need to repalce the ScriptSig with the previous ScriptPubKey when calculate the per input signature hash?

I'm reading Programming Bitcoin. And in Chapter7, the author talked about the way how signature hash is calculated by replacing the transaction's ScriptSig with the corresponding previous ScriptPubKey....
Shawn C's user avatar
  • 37
1 vote
1 answer
63 views

Reasons not to rename scriptPubKey and scriptSig to something more intuitive?

I realize that this is how Satoshi named them and there was some reasoning behind these names, but even after years of using them, I find them weird and confusing, especially when e.g. explaining them ...
dpc.pw's user avatar
  • 301
0 votes
1 answer
226 views

How to submit nonstandard scriptPubKey transaction to bitcoind in regtest mode?

I'm trying to replicate an algebraic puzzle I saw in the scriptPubKey of a testnet transaction: OP_2DUP OP_ADD 6e OP_EQUAL I think the intent was for this output to be spendable by a scriptSig of ...
Dave M.'s user avatar
  • 147
1 vote
0 answers
164 views

Example of Schnorr signature on a block explorer?

Can somebody link to a Schnorr signed transaction on Mainnet or Testnet? Looking to see how the SCRIPTSIG differs.
Hemphta's user avatar
  • 11
3 votes
1 answer
450 views

How can the genesis block contain arbitrary data on it if the script is invalid?

The coinbase transaction from the genesis block contains this script: ...
user132372's user avatar
1 vote
1 answer
117 views

Watchtower limitations and possible solutions so far in 2021-Nov?

Having read a bit more about the Lightning network. The capacity of the lightning network seems to ride on the "trust" of the counterparty you are opening a channel with along with the ...
Patoshi パトシ's user avatar
2 votes
1 answer
378 views

What prevents OP_SUCCESS from being used nefariously?

If a script is automatically valid when an OP_SUCCESS opcode is called, what mechanism prevents a malicious actor from taking a random UTXO and creating a fake scriptsig with an OP_SUCCESS included?
Bertram Lund's user avatar
6 votes
2 answers
2k views

What are the scriptPubKey, scriptSig, redeem script and witness for the various output types?

scriptPubKey, redeem script, witness script, witness program are defined in this StackExchange post. What are the scriptPubKey, scriptSig, redeem script and witness for the various output types (P2PKH,...
Michael Folkson's user avatar
0 votes
0 answers
32 views

How can I be sure that anyone (i.e miner) will not change outputs from transaction? [duplicate]

I am wondering if ie. miner cannot change outputs from transaction. We have example of transaction: { "version": 1, "locktime": 0, "vin": [ { "txid": &...
MMC's user avatar
  • 1
0 votes
1 answer
124 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
1 answer
193 views

signing multiple input raw transaction - algorithm and sighash types [duplicate]

I have an unsigned raw transaction: ...
Jubert's user avatar
  • 47
0 votes
1 answer
516 views

Bitcoin scriptSig with two transactions to unlock the scriptPubKey

For example, the bitcoin script of a scriptPubKey that consists of OP SUB < 100 > OP EQUAL, and is used to lock an output of a transaction. OP SUB pops the top two elements in the stacks, ...
Taufik Iqbal Ramdhani's user avatar
2 votes
2 answers
360 views

Why is the scriptSig formatted this way in the Genesis Block (inside function CreateGenesisBlock)

I was exploring the function static CBlock CreateGenesisBlock inside src/chainparams.cpp and I was looking at the way Satoshi created its scriptSig: txNew.vin[0].scriptSig = CScript() << ...
ddavi031's user avatar
  • 479
1 vote
1 answer
144 views

Bitcoin script verification fails after certain time period

So I want to write a bitcoin script so that after a certain time period (say for example after 30 mins), the verification fails and transaction is marked invalid even if it gets broadcasted. Time ...
Subhra Mazumdar's user avatar
0 votes
1 answer
97 views

Can hashtype in BTC scriptSig contained value other than 0x01, 0x02, 0x03, 0x80, 0x81, 0x82, 0x83?

As per hashtype value in https://en.bitcoin.it/wiki/OP_CHECKSIG or https://developer.bitcoin.org/devguide/transactions.html#signature-hash-types, hashtype could either be 0x01, 0x02, 0x03, 0x80, 0x81, ...
brianinhk's user avatar
0 votes
1 answer
550 views

"scriptSig" for P2SH-P2WPKH

I'm not sure I understand the fields of my input. I have a P2SH address (Testnet). This is the input of my transaction: "vin": [ { "txid": "...
MaXbeMan's user avatar
  • 125
0 votes
1 answer
133 views

Script_sig for coinbase transaction afbff1130b6fcbdceebbadfc48a842af1f03ee08a79e042b37fc467518b49a0f

I am currently developing a blockchain parser in Python, and it has been crashing in the file blk00006.dat for the coinbase transaction with the hash ...
Oscar Serna's user avatar
0 votes
1 answer
87 views

Is it possible, with bitcoin-core or btcd, to manually set the scriptSig field in a coinbase transaction?

I am talking about when using regtest or simnet modes. For context, it is so that I can create coinbase transactions with reproducible txids.
Darius's user avatar
  • 789
1 vote
1 answer
2k views

Decoding hex scriptsig in Python

Running decodescript on d1a076722d11ddfd0fadb96d6d960b8b2ad6c6369570cd00df70a801a6be9e44 is returning: { "asm": "0 ...
Tony Sanak's user avatar
  • 1,699
0 votes
1 answer
138 views

How Extracting address Bitcoin to script multi signature

I want to extract the correct address from a script multi-signature. I have this real script multi-signature from this ScriptSig (tx index 1), so this is a readme script for this address OP_2 ...
vincenzopalazzo's user avatar
1 vote
0 answers
168 views

Is possible extract the original script P2MS from the transaction locked with the P2SH address?

This is a stupid question because if the P2SH contains the hash160 (and the hash160 contains the sha256) of the P2MS doesn't possible return to the original hex P2MS. So, but for verifying the P2SH I ...
vincenzopalazzo's user avatar
2 votes
0 answers
214 views

How to Validate Signature with SigScript length 8b?

I created a raw Transaction: ...
Yash Madhwal's user avatar
0 votes
0 answers
479 views

How to use "OP_CHECKSEQUENCEVERIFY" in regtest?

I have created a P2sh includes OP_CHECKSEQUENCEVERIFY and funded the same. I was trying to redeem the coins. But i could not understand the working of OP_CHECKSEQUENCEVERIFY. Below is the example ...
kitty's user avatar
  • 31
0 votes
1 answer
261 views

How to build a p2sh who's scriptsig contains a Signature

I have created a P2SH address, funded it, and am attempting to move the funds with a TX. The redeemScript for the TX requires the TX signature (OP_CHECKSIGVERIFY), but in order to create this ...
circusdei's user avatar
2 votes
2 answers
3k views

How do I extract the address from a scriptPubKey?

I am creating a block parser and just learned about Scripts in Bitcoin yesterday which is kind of confusing so far. I want to extract the addresses involved in each transaction. Right now, I am able ...
fon's user avatar
  • 77
0 votes
2 answers
1k views

getting address from public of ScriptPubKey vs ScriptSig

Recently I read some articles about BITCOIN protocol and it's transaction. I understand(maybe it is incorrect) these rules: An input is what we call an output when you're spending it in a transaction....
Saeed's user avatar
  • 125
0 votes
1 answer
79 views

Getting source address of a Tx message from it's signature script

I have a simple bitcoin packet which contains TX message. in a TX message, one of it's Transaction input hex data was like this: ...
Aristo's user avatar
  • 21
0 votes
1 answer
312 views

Detect types of ScriptSig and parse each part

As explained in https://en.bitcoin.it/wiki/Script there are many types of scriptPubKey and scriptSig like: <sig> <pubKey> <sig> <pubKey> <pubKey> <sig> <...
Saeed's user avatar
  • 125
1 vote
0 answers
115 views

Parse signature and public key from scriptsig in an input transaction of bitcoin protocol [duplicate]

I'm interested in bitcoin protocol and checking validation of a transaction. in a TX message, we can see one or more than one input transaction and every input transaction has a previous transaction ...
Aristo's user avatar
  • 21
1 vote
2 answers
1k views

How to manually sign a transaction with multiple inputs and multiple outputs?

I'm developing transaction constructor, but i faced several problems. To some of which i found answer in How to sign a transaction with multiple inputs?, for the rest i'll try to explain: When we ...
Dimitar Vasilev's user avatar
0 votes
2 answers
2k views

Why did repeated "R" values occur in Bitcoin transactions before?

Please explain why earlier the repeated values of "R" occurred in Bitcoin transactions. For example, this transaction has a repetition of the value "R": https://www.blockchain.com/btc/tx/...
Rozwrcd's user avatar
  • 49
0 votes
2 answers
189 views

Verifying a digital signature that a transaction is going to an output with value X inside a script

Edit; after writing this post i have found that OP_CHECKDATASIG is basically this in a nutshell. It is implemented on Bitcoin Cash and may soon be on Bitcoin Core as well. Someone has even written ...
nick carraway's user avatar
1 vote
1 answer
954 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 ...
Bruno's user avatar
  • 220