Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [script]

This tag should be used for questions regarding Bitcoin transaction scripts or scripting languages used in transactions of altcoins such as Solidity. Scripts are a set of instructions on how to complete a transaction.

0
votes
1answer
84 views

Possible to check who signed the transaction in a multi-sig transaction case?

Say you have a multi-sig tx that originated from a 2-of-3 P2SH address. Is it possible to say who signed the transaction? i.e. you can get access to the redeem script once the tx is broadcasted, and ...
0
votes
1answer
79 views

Parse scripts to extract address [duplicate]

I want to parse a script with c++ to gain an output address from it. can anybody introduce a suitable library or a sample code which extract addresses from scripts ?
0
votes
1answer
60 views

Extract output address from raw script in bitcoin protocol

I'm working on bitcoin protocol and exactly i want to extract raw script from output script to gain address from tx messages. for common scripts, like scripts start with 0x76(means OP_DUP), we can ...
1
vote
1answer
71 views

unknown output script in a sample bitcoin pcap file

I start working on bitcoin protocol to extract output addresses from scripts in tx structures. Now in can produce some valid bitcoin address but some scripts are not familiar in op_code lists ...
0
votes
0answers
19 views

Script Mistake in Asymmetric Revocable Commitments [duplicate]

Disclaimer Please note that this is not a question on lightning network or on hash time lock contracts since those subjects come later in the book, so answers that relate to those subjects are not ...
1
vote
1answer
104 views

Bitcoin RIPEMD160 purpose

Bitcoin uses RIPEMD160 on top of SHA256. Is its sole purpose to make public key address shorter or does it strengthen security in any way?
5
votes
2answers
124 views

Getting Started With Script

I would like to manually write a few locking and unlocking scripts to get a deeper feel for that part of the network. What is the simplest step-by-step set of instructions to set up everything needed ...
2
votes
1answer
91 views

Extract lightning network funding transactions with python bitcoin blockchain parser lib

My ultimate goal is to parse funding transactions (as well as channel closes in a later step) from the blockchain. In order to do so I wanted to start with a funding transaction and disect it. ...
0
votes
1answer
175 views

Electrum Gap Limit from CLI

Is there any way to change wallet gap limit in Electrum from command line? If yes, how? If not, could it be bypassed using some kind of external script? I really need to avoid GUI. Thank you in ...
1
vote
2answers
555 views

What redeem script is used in bitcoin core wallet when generate the address?

I'm trying to generate the address 38DGj87axzmQiZeAd1w1y5FEmuu5a7pfBa in my bitcoin core wallet with code. First, I dump the private key from the address, then I calculate the address from the ...
3
votes
1answer
57 views

Weird script stack entries at block #227837?

At block 227837 , the coinbase TX e35ca7413b61397a49551fea6ebb540988afcf4a2d0e750773d38eb11b138f40 has the following script: ...
2
votes
1answer
296 views

How does a P2SH script get executed?

I'm trying to visualize how a typical P2SH script gets executed, as I realize that it's a special form of script that gets executed slightly differently to a standard script. Before P2SH: Before ...
0
votes
1answer
56 views

Does bitcoin still concatenate the locking and unlocking script and execute?

Does bitcoin still concatenate the locking and unlocking scripts and execute in order to validate transaction or is validation done another way?
0
votes
1answer
50 views

How can OP_CHECKLOCKTIMEVERIFY be used to create outputs provably spendable by anyone?

While reading BIP 65 it says that op_checklocktimeverify can be used to create provably spendable outputs by anyone. How is this possible?
0
votes
0answers
26 views

How to create contracts using bitcoin?

Is there a way to create contracts with bitcoin such as allowing a transaction being funded by segwit outputs to be broadcasted only if the receiver signs it or only if the scriptsig contains a ...
0
votes
1answer
100 views

What does a coinbase output script look like?

What does a coinbase output script look like and how would it be used to fund a transaction?
1
vote
2answers
50 views

how to use multiple time specific address in input scripts with difference balances?

look at to the following transaction (withdraw transaction from binance) https://blockchain.info/tx/404fd22d3d88d129975d03fe2993f0126db8f066b3d8126d6cca676747439515?show_adv=true How in input scripts ...
1
vote
1answer
42 views

Bitcoin multisig contract - to Lock coins with nTimeLock (BIP65)

I really need help. I am currently Developing a Bitcoin wallet and want to build in a SMS Based send function where the sender does not need to know the receiver publicKey. After the contract get ...
2
votes
1answer
210 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> ...
0
votes
0answers
35 views

Valid p2sh transaction using only the redeem script

Is it possible to create a valid p2sh transaction using only the redeem script in the scriptsig and no signature?
1
vote
1answer
199 views

How to find out the requirements for spending an output script?

How do you find out the requirements to spend an output script? Do you decode the hash?
0
votes
0answers
29 views

How to create output scripts? [duplicate]

How are output scripts created and how can you create your own scripts or is this only possible through creating a transaction?
0
votes
0answers
61 views

P2sh transaction with non standard script

How can you relay a p2sh transaction with a non standard script, such as a scriptsig that only contains OP_True and get it mined? Example: https://blockchain.info/tx/...
0
votes
1answer
474 views

P2sh redeem script hash

What are the contents of a redeem script hash in a p2sh transaction? From what i read it's similar to the pubkey script but does it only contain the receiver's address?
1
vote
0answers
139 views

Is it possible to create a Dapp on top of Bitcoin?

Is it possible to create a dapp on top of bitcoin similar to how it can be done with ethereum? Can it be just as capable as ethereum?
1
vote
1answer
77 views

Ho to identify a multisig transaction?

79fbae117dc38effafb33304af83ce4894589747aee1ef992f63280567f52f5ba870678b4ab4ff6c8ea600bd217870a8b4f1f09f3a8e8353aeffffffff0130d90000000000001976a914569076ba39fc4ff6a2291d9ea9196d8c08f9c7ab88ac00000000 ...
1
vote
1answer
190 views

Why don't P2PK scripts have their own address?

If I understand addresses correctly, different types of addresses are used to map to a particular locking script (scriptPubKey). So based on the leading character of an address, a wallet will decode ...
1
vote
1answer
48 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
2answers
169 views

Does the alternative stack make Script Turing complete?

The wiki documents the presence of an "alt stack" in Script: OP_TOALTSTACK Puts the input onto the top of the alt stack. Removes it from the main stack. OP_FROMALTSTACK Puts the input onto the top of ...
0
votes
2answers
99 views

How is a transaction formated/signed?

Every transaction takes unspent outputs as inputs and creates new outputs. The creator of the transaction uses his private key to sign the transaction and nodes validate that transaction by using the ...
0
votes
2answers
81 views

Why is this script invalid, and how can I generate valid public key/digital signature pairs?

Why does the default P2PKH transaction at http://bitcoin-script-debugger.visvirial.com/ return NULL rather than true? I haven't tried to swallow the gory details of OP_CHECKSIG yet, but everything ...
0
votes
0answers
56 views

What does this elaborate output script mean? [duplicate]

Bitcoin transaction a214a2daf91691afdd491fd00d894eb3301e35bc18b5554b14e12843037e954c has an interesting output script: PUSHDATA(33)[...
1
vote
1answer
39 views

Can I use opcodes traditionally used for verifying keys to verify payment sizes?

Can I use binary opcodes usually used for verifying keys to verify payment sizes? It looks like these opcodes like OP_EQUALVERIFY and OP_NUMEQUALVERIFY are used for checking signatures or keys, ...
5
votes
2answers
338 views

What does this transaction script mean?

I was looking for scripts on the blockchain to test my program, and I encountered a weird scriptPubKey in this tx that I couldn't understand. The opcodes are pk1 = ...
0
votes
1answer
91 views

During Bitcoin Script execution, what is the significance of the signature verification in the stack?

During execution of the script i.e. ScriptSig + ScriptPub , the last step is the verification of the Signature against the public key provided by the recipient. How does this work and what is the ...
1
vote
0answers
44 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 ...
1
vote
2answers
97 views

Can bitcoin script look at the output?

I was wondering if it possible for a bitcoin script check part of the output of the transaction. Lets say, I want to check that the transaction is splited equaly between 3 outputs, I dont care which.
1
vote
1answer
49 views

anyonecanspend final condition of a script can be spotted just by looking at the script hash, without the redeem data?

Consider the following scenario. Alice, Carol and Bob create and fund a script with the following rules: if now, alice pubkey, bob pubkey else if now+500 blocks, bob pubkey, carol pubkey else if now+...
0
votes
1answer
42 views

hash locked multisig, can one cosigner sign without the pre-image?

Consider Alice and Bob created the following native segwit script: hash SHA256 defined as H | Alice PubKey | Bob Pubkey Only Bob has the pre-image (plain text that hashes [sha256] to H). Can Alice ...
4
votes
3answers
554 views

Why does Bitcoin uses a Script language?

From what I heard is that Bitcoin use Script to verify transactions (I'm probably wrong). Wouldn't be sufficient just signing the transaction with the private key and append the signature to the ...
0
votes
1answer
159 views

funding and spending a “no-multisig/no segwit” P2SH tx

I got inspired by this thread: Single signature P2SH redeem script Assume I want to "hide" my address as long as can be. So I want a P2SH tx, which only shows a redeemscript (hash of my pubkey) on ...
1
vote
1answer
592 views

Single signature P2SH redeem script

How would one go about creating a single signature P2SH transaction? (Analogous to a "2 of 3 multisig P2SH" but instead I'm asking about a "1 of 1".) Would one wrap a standard P2PKH scriptPubKey ...
4
votes
1answer
301 views

How are sigops calculated?

How are sigops calculated on a transaction? For example in the (randomly selected) following transaction: https://btc.com/bc9384919ad5d08b2c66e31f29e7c63572c398a87631c03a4ce9e94ff1cbe62f It says ...
3
votes
2answers
76 views

Is it possible to make an output only spendable to a specific address?

Basically, the entire question fits into the title. Does the Bitcoin scripting language allow for a transaction output to only be spendable to a specific address? Is it possible to forbid all other ...
2
votes
2answers
100 views

Why we must reference the entire txid for each output we want to spend?

Suppose I want to spend from 3 unspent outputs. I must reference the txid of these unspent outputs. Suppose they are: eb36eca9a06fbe68278ad3e7d16d10ed02e22ad891ed59ef2b84ed4a49e8a6d2 ...
0
votes
0answers
334 views

Error: mandatory-script-verify-flag-failed

I have created a raw transaction from myElectrum wallet, but when I try to broadcast it I get this error: mandatory-script-verify-flag-failed Why is this happening? The transaction is below: ...
0
votes
1answer
259 views

How secure is bitcoin private key generated by this script? [closed]

I found this python script on github. It generates a pair of bitcoin private key and address. I know the private key may be vulnerable if it is created insecurely. I don't have much knowledge ...
3
votes
4answers
219 views

Why doesn't address contain a full scriptPubKey?

This is a general question, but let's suppose a P2PKH transaction. P2PKH address starts with "1" and the sender incorporates it into the scriptPubKey as: OP_DUP OP_HASH160 <PublicKeyHash> ...
0
votes
1answer
339 views

Bitcoin - Is the <pubKeyHash> in scriptPubKey already hashed?

In Bitcoin protocol, to set the output of a transaction you need a scriptPubKey which is in the following format. scriptPubKey = OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG Is &...
1
vote
1answer
107 views

Why does this script return an error ?

I'm trying to understand how Script validates transactions. I have taken this transaction as an example 55e5bbdba33050bbe6584e896b4a20575cf3fe3f29114467f17f67f6b172eb73 When showing the scripts, we ...