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
137 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
53 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
0 answers
46 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
66 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
  • 458
0 votes
1 answer
75 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
  • 1
4 votes
1 answer
150 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
28 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
69 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
88 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
119 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
86 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
  • 458
1 vote
1 answer
78 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
57 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
  • 281
0 votes
1 answer
155 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
134 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
433 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
108 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
346 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
4 votes
2 answers
1k 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
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
1 answer
180 views

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

I have an unsigned raw transaction: ...
Jubert's user avatar
  • 37
0 votes
1 answer
447 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
345 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
  • 459
1 vote
1 answer
137 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
77 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
489 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
122 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
84 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
  • 779
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,664
0 votes
1 answer
122 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
155 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
208 views

How to Validate Signature with SigScript length 8b?

I created a raw Transaction: ...
Yash Madhwal's user avatar
0 votes
0 answers
444 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
222 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
2k 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
73 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
293 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
108 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
182 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
916 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
1 vote
1 answer
139 views

Verification of untypical scriptSig

I want to be able to redeem a P2SH output with a script doing a multisig but also additional checks. The scriptSig to redeem this output thus has to provide enough signatures, as well as some specific ...
lorrrris's user avatar
2 votes
1 answer
287 views

ScriptSig Conversion in Python

I'm trying to convert a scriptsig into bytes so that I can better extract R & S values, but when I try and convert, I'm missing some of elements that should be there, like x30 for example. ...
GK89's user avatar
  • 123
1 vote
1 answer
622 views

Different redeemScript for the same scriptPubKey?

Most transaction outputs to P2SH addresses have the following scriptPubKey: HASH160 f45d94733d430261962932e0c847075195916a04 OP_EQUAL As I understand it, this transaction do not need to be signed. ...
Andrew's user avatar
  • 173
2 votes
1 answer
207 views

Cant spend input with non-standart redeemscript (OP_CSV)

I'm playing with OP_CHECKSEQUENCEVERIFY. Here is my transaction that I'm trying to spend: https://tchain.btc.com/e79d469698915aa6724288ae3a4141a31706d081f39fb7fd0b956a73a9044b22 which has the ...
Andrew's user avatar
  • 173
5 votes
1 answer
179 views

What is the maximum number of bytes the coinbase scriptSig (coinbaseaux) can hold?

Since the scriptSig of the coinbase transaction of a block can contain arbitrary data, what is the maximum number of bytes it can contain? I've seen various mentions of a limit around 100 bytes, but ...
JBaczuk's user avatar
  • 7,328
3 votes
1 answer
134 views

OP_CHECKLOCKTIMEVERIFY . Include / reject or will not included in block?

What happened if I translate to network transaction with the folowing redeem script: [now + 3 months] CHECKLOCKTIMEVERIFY DROP DUP HASH160 [Bob's Public Key Hash] EQUALVERIFY CHECKSIG This tx will ...
Andrew's user avatar
  • 173