2022 Developer Survey is open! Take survey.

Questions tagged [scriptsig]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
22 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 ...
user avatar
  • 281
0 votes
0 answers
19 views

How to build scriptSig for a custom script - elements

On a local elements testnet I've sent some coins to a p2sh address, now I'd like to build the scriptSig to spend them. Here is the code I'm trying to build: let redeem_script = elements::script::...
user avatar
  • 123
0 votes
1 answer
19 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 ...
user avatar
  • 147
1 vote
0 answers
31 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.
user avatar
3 votes
1 answer
353 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: ...
user avatar
1 vote
1 answer
69 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 ...
user avatar
0 votes
0 answers
25 views

What is the Purpose of Writing the Previous ScriptPubKey as a Temporary ScriptSig of an Input Before Signing?

I have seen some guides saying to write the script pub key of the output we are trying to redeem. (Ie. step 6. How to redeem a basic Tx?) I'm curious what the reasoning behind this is and what will ...
user avatar
1 vote
1 answer
266 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?
user avatar
1 vote
1 answer
180 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,...
user avatar
0 votes
0 answers
28 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": &...
user avatar
  • 1
0 votes
1 answer
71 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 ...
user avatar
0 votes
1 answer
118 views

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

I have an unsigned raw transaction: ...
user avatar
  • 37
0 votes
1 answer
232 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, ...
user avatar
2 votes
2 answers
274 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() << ...
user avatar
  • 449
1 vote
1 answer
114 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 ...
user avatar
0 votes
1 answer
52 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, ...
user avatar
0 votes
1 answer
307 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": "...
user avatar
  • 127
0 votes
1 answer
74 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 ...
user avatar
0 votes
1 answer
64 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.
user avatar
  • 669
1 vote
1 answer
1k views

Decoding hex scriptsig in Python

Running decodescript on d1a076722d11ddfd0fadb96d6d960b8b2ad6c6369570cd00df70a801a6be9e44 is returning: { "asm": "0 ...
user avatar
  • 1,564
0 votes
1 answer
70 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 ...
user avatar
1 vote
0 answers
120 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 ...
user avatar
2 votes
0 answers
171 views

How to Validate Signature with SigScript length 8b?

I created a raw Transaction: ...
user avatar
0 votes
0 answers
341 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 ...
user avatar
  • 31
0 votes
1 answer
95 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 ...
user avatar
1 vote
1 answer
1k 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 ...
user avatar
  • 57
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....
user avatar
  • 125
0 votes
1 answer
62 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: ...
user avatar
  • 21
0 votes
1 answer
205 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> <...
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 ...
user avatar
  • 21
0 votes
2 answers
689 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 ...
user avatar
0 votes
2 answers
1k 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/...
user avatar
  • 49
0 votes
2 answers
156 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 ...
user avatar
1 vote
1 answer
792 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 ...
user avatar
  • 158
1 vote
1 answer
115 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 ...
user avatar
2 votes
1 answer
206 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. ...
user avatar
  • 123
1 vote
1 answer
576 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. ...
user avatar
  • 173
2 votes
1 answer
196 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 ...
user avatar
  • 173
3 votes
1 answer
126 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 ...
user avatar
  • 7,040
3 votes
1 answer
99 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 ...
user avatar
  • 173
1 vote
1 answer
127 views

Is it safe to store bitcoins on p2sh (no multisig)?

I've just generated p2sh btc address and look in the output script: HASH160 PUSHDATA(20)[e5c32bdc7f7fb1e6ae7aa1baf42a429803054d2c] EQUALVERIFY while normal (legacy btc address) transaction has ...
user avatar
  • 173
0 votes
1 answer
34 views

i don't know if there is an error in the scriptsig generation method of input in p2psh

I don't know if there is an error in the scriptsig generation method of input in P2PSH. My address is a single signing address with one Private key, I created a transaction that will generate hex ...
user avatar
0 votes
1 answer
58 views

When do scripts executed?

Can anyone explain when does a script executed exactly? There are several information about "how scripts are executed" but no information about "when".
user avatar
1 vote
1 answer
244 views

How to specify the right input and output to be signed for SIGHASH_SINGLE

For my understand, when building a new TX, need to produce a new scriptSig for the TX; and need add a sigHash code at the end of the TX. If the sighash type is SIGHASH_SINGLE, for a TX with multiple ...
user avatar
  • 51
1 vote
1 answer
1k views

how generate <sig> part of scriptSig in bitcoin transactions

I studied many links about bitcoin trxs and about generating scriptSig. Finally I couldn't understand how to make this part. for example I read this links: What is relation between scriptSig and ...
user avatar
1 vote
1 answer
174 views

Can I prove a double spend attempt with a signed tx with same input? [closed]

I am designing an cross-chain atomic swap in a custom blockchain - Protoblock. I think it can be done as long as Protoblock knows how to parse p2pkh bitcoin transactions. The critical part is being ...
user avatar
  • 153
1 vote
2 answers
113 views

Why are my Signature Scripts Different from my professors?

bob_addr = "1NWzVg38ggPoVGAG2VWt6ktdWMaV6S1pJk"#"1FMb8Jnn1jSh7yjDFfonC8xCCH3ittoEzB" bob_hashed_pubkey = base58check.b58decode(bob_addr)[1:] bob2_hashed_pubkey = b'\xec\x06\xb2\xbf\x18\xc8\x97\x06\...
user avatar
0 votes
0 answers
62 views

Bitcoin transaction scripts : does ScriptSig or ScriptPubkey run first? [duplicate]

I'm confused as to the order regarding which script is run. For examples sake: say I want to spend 1 Bitcoin which was given to me by Alice in a single transaction of value 1 Bitcoin. I understand ...
user avatar
  • 57
1 vote
1 answer
168 views

Can you help me with a puzzle transaction?

I am hoping there is someone out there that can help me with probably a simple bit coin scripting question...but maybe there is something more to it. I am trying to fully test a custom script on a ...
user avatar
  • 21
2 votes
1 answer
90 views

Why this transaction is valid?

The before transaction is @ https://www.blocktrail.com/tBTC/tx/da58f6688b0727a7f1bf3eec899099bde1f18b9c7099f9d2c79556db238e623d Its output script is "OP_HASH160 ...
user avatar
  • 21