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.

Filter by
Sorted by
Tagged with
2
votes
1answer
46 views

Inner working of OP_IF and OP_ELSE

How does OP_ELSE work exactly? Is there an else if in Script? According to https://en.bitcoin.it/wiki/Script#Flow_control, the statements after an OP_ELSE are executed in three cases. It says: If ...
0
votes
1answer
27 views

How to code mining script using PHP?

I cannot understand how to do mining using code. Is it possible to use someone's API to connect to a pool and to simplify calculations for the script? I'm asking for any help with this question.
55
votes
4answers
30k views
9
votes
4answers
1k views

Is there a listing of strange or unusual scripts found in transactions?

I'm studying scripts and am looking for strange or unusual scripts that have appeared in any of the *coin networks..(outside the standard ones listed on this page) Is any one person, or website ...
1
vote
0answers
73 views

Alt Stack is not working as expected

I have a scenario as follows: In a company, there is a manager and three employees. The multisig signature will be redeemed by the manager combined with one of the employees. However, only the ...
3
votes
2answers
305 views

How to calculate P2WSH signatures with CODESPERATOR?

I read the bip143, but didn't understand how to calculate the scriptCode of p2wsh. bip143 told us: A new transaction digest algorithm is defined, but only applicable to sigops in version 0 witness ...
2
votes
0answers
32 views

is there a way to write SCRIPTS that CONDITION OVER THE CURRENT TIME stamp?

I am very new to bitcoin scripts, and need to design some high level bitcoin protocols without enough time to really dive into the details of the language itself. Is there a way to write a script that ...
0
votes
0answers
23 views

How are reserved operations intended to work?

Bitcoin has reserved words like OP_RESERVED1 that are only valid in an unexecuted if branch. How are those words intended on being used in the future to perform some actual operation? I understand how ...
1
vote
1answer
139 views

How to split the funds and send X% to fee wallet and the remaining funds to another wallet?

Anybody have any idea about how to do it? User send the bitcoins X% goes to fee wallet remaining funds goes to service wallet I'm trying to use the "sendfrom" but it's not working because he only ...
1
vote
1answer
612 views

Decoding hex scriptsig in Python

Running decodescript on d1a076722d11ddfd0fadb96d6d960b8b2ad6c6369570cd00df70a801a6be9e44 is returning: { "asm": "0 ...
1
vote
1answer
37 views

Bitcoin 2 of 4 Multisig script with one required

Hi I am to write a bitcoin locking script with property that 2 out of 4 signatures should be verified, but among those verified 2 there is a specific signature that should be verified. I.e only 1 ...
0
votes
1answer
54 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 ...
0
votes
1answer
36 views

ElectrumX method blockchain.address.get_balance removed, how to get the script hash of a public addres and get balance?

Reading the ElectrumX documentation, found that the method for getting balance of any public address was: blockchain.address.get_balance, but was removed. Now, I understand that blockchain.scripthash....
2
votes
1answer
153 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 ...
0
votes
1answer
27 views

Pay to script hash address transaction not accepted by miners

I have fixed my initial transactions and have been able to send coins to a p2sh address Now I want to spend those coins but when I try to broadcast my transactions either the website (blockcypher) ...
0
votes
1answer
56 views

Invalid p2sh transaction accepted by the network

I have try to build a 2 of 2 p2sh transaction from scratch using the book "programming bitcoin" by Jimmy Song, we are not directly guided to make one of those so I had to modify some of the ...
7
votes
1answer
592 views

Are these two scripts equivalent?

I wonder whether OP_DEPTH 0 OP_EQUAL has the exact same behavior as OP_DEPTH OP_NOT which is 1 if no items 0 if any number of items I'm asking because the first script is used and I'm not sure if ...
1
vote
0answers
34 views

How do i debug a bitcoin transaction

My main problem is understanding how to convert the response from bitcoin-cli "decoderawtransaction" to the script format i am supposed to put in the debugginng tool. i.e my problem is ...
0
votes
2answers
603 views

Non-standard transaction scripts broadcasting

I'm developing an application on Bitcoin blockchain, and I use output transaction scripts that are not standard according to the classic payment methods. However, even so, on Tesnet everything works ...
2
votes
1answer
41 views

In what year and in which Bitcoin improvement proposal Opcodes such as OP_MODE have been disabled?

On Bitcoin wiki several opcodes are listed as "disabled". My question is simple: which Bitcoin improvement proposal proposed to disable them, and when they have effectively been disabled in ...
1
vote
1answer
26 views

Script: How to check if the top item on the main stack is numeric or not?

I'm looking for the clearest way to check whether the top element of the stack is numeric or not. Thank you in advance
1
vote
0answers
31 views

OP_CHECKMULTISIG Signature must be zero for failed CHECK(MULTI)SIG operation

I am trying to spend a P2SH multi-signature output which I have created with rust-bitcoin as follows: let builder = Builder::new() .push_opcode(opcodes::all::OP_PUSHNUM_2) .push_key(&...
1
vote
1answer
54 views

Is there a difference between OP_PUSHBYTES and OP_PUSHDATA

In some documentation about Script we sometimes have to use OP_PUSHBYTESx or OP_PUSHDATAx to indicate that some number of bytes will be an element to read. They seem to do the same thing so is there a ...
5
votes
1answer
263 views

ScriptSig content during signature (quadratic hashing)

As far as I know, the quadratic hashing problem came from the fact that every time a transaction is verified (or signed), the "unsigned transaction" that is hashed and verified changes depending on ...
6
votes
2answers
3k views

How OP_EQUALVERIFY works in a standard transaction?

3 weeks ago I began learning about Bitcoins, and now I'm analyzing how it works internally. My problem is that I can't understand what two public key hashes are compare to use de OP_EQUALVERIFY, ...
0
votes
1answer
28 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 ...
1
vote
2answers
738 views

Non SegWit P2SH bytes structure

I'm working on a bitcoin block explorer in golang, in which I'd like to gather as much informations as possible about transactions. I am able to extract addresses from every type of output, and mostly ...
2
votes
1answer
59 views

p2pkh vs. p2pk keeping public key private

I just got into learning Bitcoin programming through Jimmy Song's Programming Bitcoin. Jimmy says that some of p2pkh's advantages over p2pk include: a smaller ScriptPubKey keeping one's public key ...
1
vote
2answers
155 views

Bitcoin library vs script to develop application

I'm curious about the development of application of Identity management in Blockchain platform, but I'm a bit confused about the technologies to use. In short words, when is more convenient to develop ...
1
vote
1answer
47 views

Bitcoin Native Script Language

I am intrigued by this Bitcoin Script Language, I want to learn how to program Bitcoin with it. Any idea where I can, find some documentation to read/practice with ?
2
votes
2answers
121 views

How to make a homomorphic preimage/payment hash with current lightning network / Bitcoin implementations?

If I remember / understand it correctly by using the mechanisms from the scriptless scripts paper we could easily create homomorphic preimages / paymenthashes. I think this would be a very desirable ...
5
votes
3answers
1k views

In which Block was Len Sassaman memorialised?

It has been mentioned a couple times here and there that Len Sassaman was memorialised somewhere in the Block Chain. I was able to find a dump of of the tribute to him, but I can't seem to find where ...
0
votes
1answer
87 views

In practice, are redeemScripts commonly reused?

In regards to P2SH-P2WSH transactions, are Txout-script values identical between transactions? Is it reasonable to expect a business or vendor that accepts bitcoin to be using the same redeemScript ...
8
votes
1answer
396 views

Full list of “special cases” during Bitcoin Script execution (p2sh, p2wsh, etc.)?

When executing a Bitcoin Script, there are some "special cases" where the interpreter performs extra verification beyond just executing scriptSig and then scriptPubKey. For example, if the ...
1
vote
1answer
92 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 ...
0
votes
1answer
346 views

Script to import multiple priv keys in Electrum

DuckDuckGo turns up nothing of interest. How to import multiple priv keys in Electrum from a file using Electrum console or shell script, for all derivable valid BTC addresses? (1,3,bc1) Eventually I ...
0
votes
2answers
2k views

P2sh redeem script hash [duplicate]

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?
2
votes
1answer
674 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 ...
2
votes
2answers
2k views

List of current opcodes?

Anyone know how / where to run enum optypecode (or some other method) to get a list of current opcodes? Like this result... https://www.slideshare.net/gvrooyen/20140220-bitcoin/34-...
3
votes
2answers
163 views

How to let surplus go to fundraiser in ANYONECANPAY crowdfunding script?

ANYONECANPAY can be used for crowdfunding, where pledged donations cannot be spent unless funding goal/soft cap is reached. But since output is committed, when soft cap is exceed, all the surplus will ...
1
vote
1answer
106 views

WitnessScript vs. Script Witness

In BIP 174/PSBT, there is a PSBT Input key-value pair called "PSBT_IN_WITNESS_SCRIPT" (0x05) and another called "PSBT_IN_FINAL_SCRIPTWITNESS" (0x08). What is the difference between ...
0
votes
1answer
43 views

Why can't P2PKH's scriptPubKey be shortened to only OP_CHECKSIG?

For P2PKH, the scripPubKey is OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG. Why can't it check the signature only? Why can't it be shortened to just one opcode — OP_CHECKSIG? Why ...
1
vote
1answer
26 views

Read the “value” being redeemed in a Bitcoin P2SH Script

Is there any way for a Bitcoin P2SH Script to read the amount of Satoshis being redeemed?
2
votes
1answer
144 views

How to spend a multisignature, CLTV time-locked UTXO?

I am using this locking script with libbitcoin explorer to create a bitcoin testnet transaction: bx script-to-address -v 196 "[efa716] checklocktimeverify drop 2 [...
2
votes
1answer
51 views

For a redeem script to satisfy the conditions of a script what must it leave on the stack post execution?

I was watching this Andreas Antonopoulos presentation on Advanced Bitcoin Scripting. It appears from Andreas' examples that for a redeem script to satisfy the conditions of the script it needs to ...
7
votes
2answers
3k views

CHECKMULTISIG a worked out example

I was wondering if somebody could point me to or give me a worked out example of how OP_CHECKMULTISIG works behind the curtains? I expect that CHECKMULTISIG will call the CHECKSIG function and ...
0
votes
1answer
33 views

Original default bitcoin script

Where can I read the original Bitcoin script for verifying the transactions? Also, who controls the GitHub profile of bitcoin? Thanks.
5
votes
1answer
149 views

What is the difference between policy and consensus when it comes to a Bitcoin Core node validating scripts?

What is the difference between policy and consensus when it comes to a Bitcoin Core node validating transaction scripts? Can you give some examples of checks that are considered policy and checks that ...
1
vote
0answers
42 views

Bitcoin Script - Beautify

My question is if something exists to do the job in the opposite direction of miniscript. Miniscript's intention is to help:     ...writing (a subset of) Bitcoin Scripts in a structured way, enabling ...
3
votes
3answers
767 views

A Bitcoin locking script to force a certain payment to the receiver?

Is there a way to use Bitcoin script to force payment for the receiver? I do not mind if it's a non-standard transaction, just curious if Bitcoin script itself allows expression of something like that....

1
2 3 4 5
10