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.
Questions tagged [input-script]
81 questions
6
votes
1 answer
Step by step example to redeem a P2SH output required
I have been following BIP16 in creating a P2SH transaction. I want to create a simple (one signature) P2SH. I am getting an error when trying to broadcast the tx. Error is 16: mandatory-script-verify-flag-failed (Signature must be zero for failed…
Jus12
- 1,365
- 1
- 14
- 24
4
votes
1 answer
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 can't find that defined anywhere.
JBaczuk
- 7,278
- 1
- 11
- 32
4
votes
1 answer
Decoding ScriptSig
I noticed that there can be what seems to be more than 1 signature in a ScriptSig.
The transaction in question is: https://blockchain.info/tx/32e8677c968981549acc25f46641c74a3055d949c90bd22c15a5236bf92a622d
Below is a ScriptSig sample in…
thotheolh
- 167
- 1
- 5
4
votes
1 answer
ScriptSig - what am I signing exactly?
So the scriptsig field in the transaction, is created with the signature and public key. In order to create the signature, we need the R and S values of a ECDSA signature. I figured how to sign a string with Secp256k1, but I haven't figured out…
user2298995
- 193
- 3
- 14
3
votes
1 answer
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 be accepted (included in block) and after 3 month…
Andrew
- 173
- 8
3
votes
1 answer
Missing public key in transaction input
I'm in the process of understanding scriptSigs of transaction inputs and encountered some transactions with inputs that seem to be missing a public key.
This is what I expect to see as a scriptSig. A signature and a public key.
ScriptSig:…
Roper
- 177
- 5
3
votes
1 answer
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 in order to spend any output.
What would such a…
Cosmik Debris
- 33
- 4
3
votes
1 answer
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: 04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73
It pushes the text "The…
user132372
- 33
- 2
2
votes
2 answers
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() << 486604799 << CScriptNum(4) << std::vector
ddavi031
- 459
- 2
- 9
2
votes
0 answers
2
votes
2 answers
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 to read the script for each output. To extract the…
fon
- 77
- 6
2
votes
1 answer
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.
scriptsig =…
GK89
- 123
- 4
2
votes
1 answer
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 folowing redeem script:
2 OP_CHECKSEQUENCEVERIFY…
Andrew
- 173
- 8
2
votes
1 answer
Why this transaction is valid?
The before transaction is @ https://www.blocktrail.com/tBTC/tx/da58f6688b0727a7f1bf3eec899099bde1f18b9c7099f9d2c79556db238e623d
Its output script is "OP_HASH160 da1745e9b549bd0bfa1a569971c77eba30cd5a4b OP_EQUAL".
The current transaction is…
J Doe
- 21
- 1
2
votes
1 answer
What prevents anyone from spending utxos from a native segwit address?
I read that transactions spending utxos from a native segwit address ( an address starting with bc1) are seen as anyone can spend transactions by legacy nodes.
So what prevents someone from taking a utxo from a native segwit address and using it to…
Errol
- 117
- 8