Questions tagged [scriptsig]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
29 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 ...
-1
votes
2answers
34 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....
0
votes
1answer
19 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: ...
0
votes
1answer
52 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> <...
1
vote
0answers
34 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 ...
0
votes
1answer
39 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 ...
0
votes
2answers
68 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/...
0
votes
2answers
69 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 ...
1
vote
1answer
145 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 ...
1
vote
1answer
45 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 ...
2
votes
1answer
54 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. ...
0
votes
1answer
74 views

Diferent redeemscript for the same scriptpubkey?

Most transactions to p2sh address has the follwing scriptpubkey HASH160 f45d94733d430261962932e0c847075195916a04 OP_EQUAL As I understood, this transaction do not need to be signed. Is it true? ...
2
votes
1answer
79 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 ...
3
votes
1answer
59 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 ...
3
votes
1answer
58 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 ...
1
vote
1answer
62 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 ...
0
votes
1answer
21 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 ...
0
votes
1answer
29 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".
0
votes
1answer
83 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 ...
0
votes
1answer
143 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 ...
1
vote
1answer
131 views

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

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 ...
1
vote
2answers
55 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\...
0
votes
0answers
40 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 ...
1
vote
1answer
118 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 ...
2
votes
1answer
63 views

Why this transaction is valid?

The before transaction is @ https://www.blocktrail.com/tBTC/tx/da58f6688b0727a7f1bf3eec899099bde1f18b9c7099f9d2c79556db238e623d Its output script is "OP_HASH160 ...
1
vote
1answer
149 views

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 ...
2
votes
1answer
303 views

How do I fix my check-multisig if-else output script?

I'm trying to create a custom script with if/else and a multisig operation in one branch. Currently, my script looks thus: OP_IF <pub1> OP_CHECKSIG OP_ELSE OP_2 <pub2> ...
1
vote
1answer
414 views

How to create a p2sh transaction with a scriptsig of OP_true?

How can I create a p2sh transaction with a scriptsig containing OP_TRUE only, removing the need for a digital signature, which will be broadcasted and mined? Also could some one provide an example of ...
0
votes
2answers
123 views

Transactions without signatures?

Do all transactions require a siganture to be broadcasted and signed or is it possible to have a unsigned transaction be mined? Could you not just use op codes to allow a transaction to be validated ...
0
votes
0answers
43 views

What information is the sender signing in the scriptsig? [duplicate]

In a transaction a sender must provide the digital signature to say that they own that transaction. What information is the sender signing in the scriptSig? I was thinking that It was: The ...
1
vote
1answer
106 views

Ho to identify a multisig transaction?

79fbae117dc38effafb33304af83ce4894589747aee1ef992f63280567f52f5ba870678b4ab4ff6c8ea600bd217870a8b4f1f09f3a8e8353aeffffffff0130d90000000000001976a914569076ba39fc4ff6a2291d9ea9196d8c08f9c7ab88ac00000000 ...
1
vote
1answer
62 views

How to calculate variable length fields?

Some parts of bitcoin tx Ex: Script are of variable length var_int. Can someone explain how to calculate its value from that var_int table. Ex: In the below tx, the bolded part is script-length. its ...
2
votes
1answer
1k views

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/...
1
vote
0answers
51 views

what are ScriptSig? [duplicate]

I was studying bitcoin script, and upon watching this transaction in blockexplorer i was confused , what exactly is ScriptSig and scriptPubKey is of reciever? According to what I know, the receiver ...
0
votes
1answer
197 views

P2PKH why the hash and not the address itself

In a pay-to-public-key-hash script, what is the reason of storing the hash of the address and not the address itself, since anybody can copy the hash from a previous tx resolved by the same hash (i.e. ...
1
vote
1answer
174 views

Signing a transaction with openSSL

I've read a bit about signing a transaction using openSSL, I've tried implementing it but it seems like the signatures generated are not accepted. So I'm wondering if the following commands provide a ...
2
votes
2answers
195 views

Testnet transaction - OPCODE MISSING OR NOT UNDERSTOOD error

I'm trying to broadcast a manually generated raw testnet transaction. I'm getting the following error from SmartBit: PUSH TRANSACTION ERROR: 16: MANDATORY-SCRIPT-VERIFY-FLAG-FAILED (OPCODE MISSING OR ...
0
votes
1answer
174 views

Is scriptSig different for each input?

Since scriptSig is a signed transaction hash with the spender's private key, how is the scriptsig different for each input?
1
vote
1answer
356 views

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 ...
3
votes
1answer
2k views

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-...
2
votes
1answer
158 views

Why does ScriptSig contain public key, since it can be recovered from the signature and message?

Using ECDSA, given a signature and the message signed, it is possible to recover the public key. So it seems to be a waste of up to 65 bytes in each transaction. Why does bitcoin do it? Which ...
2
votes
1answer
143 views

how to spend an utxo when the corresponding scriptsig is longer than 256 bytes?

I am trying to spend an utxo sent to a p2sh address. The scriptsig (including the redeem script) is longer than 256 bytes. When the transaction is serialized there is only one byte to indicate the ...
1
vote
1answer
546 views

How to restore redeem script from a spent transaction?

What is the procedure to restore redeem script of P2SH address from a transaction sent from that address? The script is stored on the blockchain in the tx data, the question is how to extract it?
0
votes
3answers
2k views

What is wrong with my ScriptSig? I get 64: scriptsig-not-pushonly

I currently try to create and sign transaction from scratch. I made it to construct and sign a transaction. If I verify it manually it looks good but using a "proper" wallet my transaction is refused: ...
0
votes
1answer
290 views

Why is using a simple SHA1 in a scriptPubKey to emulate a “password” a security problem?

I'm independently working my way through an excellent online course on bitcoin, made available from Stanford. (https://crypto.stanford.edu/cs251). One of the problems in the homework challenges the ...
3
votes
1answer
856 views

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 ...
0
votes
2answers
635 views

How do you create a scriptsig for a new raw tx?

Could someone please explain how to do this is in a detailed step by step manner that correlates to a real linked transaction such that a n00b can comprehend? Is it just copy and paste a particular ...