Questions tagged [script]

A simple, stack-based, Forth-like programming language using "opcodes" to express spending conditions.

Filter by
Sorted by
Tagged with
0
votes
1answer
38 views

Liquid tapscript opcodes

Related question: What opcodes are supported on Liquid but not yet on Bitcoin? I had seen few opcodes in the slides shared by notgrubles on Twitter Opcodes: OP_INSPECTCURRENTINPUT OP_INSPECTINPUT ...
1
vote
1answer
23 views

What opcodes are supported on Liquid but not yet on Bitcoin?

What opcodes are supported in Liquid as of today (September 2021) but not (yet) on Bitcoin? What is the rationale for including these particular opcodes but not others?
5
votes
1answer
859 views

How does OP_RETURN burn coins?

What exactly causes the output containing OP_RETURN to be unspendable? And why do I have to use the byes after OP_RETURN for keeping data in the blockchain and I can't use bytes before OP_RETURN?
0
votes
1answer
22 views

How to edit bitcoin.conf for bitcoin.cli scripting

I want to install Kristaps Kaupe’s scripts on my bitcoin.conf but I am afraid I don't have the technical expertise necessary to make it run. I am simply cutting and pasting it on my bitcoin.conf file, ...
0
votes
2answers
29 views

What script unlocks this locking script?

The locking script I have is OP_PUSH1(0x03) OP_ADD OP_PUSH1(0x05) OP_NUMEQUALVERIFY I don't understand how the OP_PUSH works - where does it push from and does it push it onto the top of the stack? I ...
2
votes
0answers
17 views

Script type test vectors

I'm looking for test vectors, assuming xpub or public key to derive various script type addresses out of it. Something along the line of https://bip32jp.github.io/english/ but not only for P2PKH, but ...
0
votes
0answers
18 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 ...
0
votes
1answer
56 views

Can you program a transaction to automatically run once fees are low?

Can i program a bitcoin transaction to run when the network is not as busy or when fees are low? If you are not in a rush to complete trx.
2
votes
1answer
61 views

How does a Wallet Create a Transaction when a Public Address Is Provided?

Given a public Bitcoin wallet address 1BdYVvwoxTWMGqJS2Pg6NkVD7RnENVjSac; is pasted into a wallet to send Bitcoins to. How does the wallet create an output to send coins to the public key associated ...
1
vote
1answer
78 views

Taproot PTLC: Non-Multisig partly timelocked spending conditions

(Taproot environment) What I came up with is the following logic: $alice = A; $bob = B; pk($bob) || (pk($alice) && older(10)) (See on Minsc). I looked at the generated / resulting Bitcoin ...
2
votes
1answer
257 views

Is there a tool like Ethereum EVM at present for Bitcoin script?

Is there a tool like Ethereum EVM at present? Users can write bitcoin scripts in a syntax just like python(or like other programming language); through this tool, they can be translated into bitcoin ...
2
votes
1answer
221 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?
1
vote
2answers
41 views

How can blockchain prevent bad transaction script [duplicate]

Novice here trying to understand blockchain and transactions. I was reading about the scripts to verify the ownership of UTXO and understand that, this script actually can be client-defined. What if a ...
1
vote
1answer
31 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,...
0
votes
1answer
107 views

Why OP_DUP instead of providing the PubKey twice in P2PKH?

We know that a P2PKH script looks as follows: scriptPubKey: OP_DUP OP_HASH160 <PubKeyHash> OP_EQUALVERIFY OP_CHECKSIG scriptSig: <Signature> <PubKey> Since full nodes are maintaing ...
5
votes
1answer
130 views

What is SIGHASH_ANYPREVOUTANYSCRIPT?

BIP 118 describes SIGHASH_ANYPREVOUT, but also mentions SIGHASH_ANYPREVOUTANYSCRIPT. What is the difference, and why is the later sighash flag needed?
1
vote
1answer
45 views

Is there a way to create a timelocked mulstisig wallet from bitcoin-cli [duplicate]

So, I read that with the new taproot upgrade, now there is a possibility to reduce the number of signatures necessary to create a valid transaction in a multisig wallet. For example, create a 3-5 ...
4
votes
1answer
197 views

Is it possible to build complex Apps with Bitcoin Script?

I am trying to understand what Bitcoin Script is for. Is it a programming language like Java which in principle also can be used for building complex applications like a decentral exchange or was it ...
1
vote
1answer
324 views

What happens if nSequence is set to 0x00000000?

I know setting nSequence 0x00000001 means the transaction is not valid until 1 block has elapsed since its's prevout confirms. At most one spend per two blocks. What happens if it's set to 0x00000000? ...
1
vote
1answer
69 views

signed raw transaction does not conform?

I have become fairly familiar with constructing raw transaction. One thing I can't understand is after a raw transaction comes back from a signing, it doesn't look like it conforms to the transaction ...
1
vote
0answers
55 views

complete bitcoin script example

I am trying to learn how to write my own script from scratch. I have seen about a dozen examples by googling but non of them are complete. I am aware of btcdeb as well. Is there a tutorial that covers ...
5
votes
2answers
188 views

What are the downsides to enabling potentially suboptimal or unused opcodes in a future soft fork?

It appears to me that there are various ways to build covenants and vaults with opcodes and sighash flags that are not yet enabled in Bitcoin (e.g. OP_CHECKTEMPLATEVERIFY, SIGHASH_ANYPREVOUT, OP_CAT). ...
1
vote
1answer
50 views

Is there anything specific to the design of the Sapio language that makes it well suited to writing covenant scripts?

I think I understand at a high level the goals of both CheckTemplateVerify (CTV, BIP 119) and the Sapio language. Is there anything specific to the design of the Sapio language that makes it well ...
2
votes
3answers
2k views

Will BTC script be Turing complete in future?

I want to know if BTC script will have loops in it in the future?
5
votes
0answers
44 views

What prior work influenced the design of the Bitcoin instruction set?

The "Script" system used by Bitcoin transactions is commonly described as a Forth-like, stack-based language. What prior work influenced the design and layout of the Script instruction set? ...
3
votes
1answer
64 views

Why were OP_RESERVED, OP_RESERVED1, and OP_RESERVED2 originally reserved?

Since the earliest public release of Bitcoin, OP_RESERVED, OP_RESERVED1, and OP_RESERVED2 have been defined at 0x50 (80), 0x89 (137), and 0x8a (138), respectively. Why? The intended purpose of all the ...
2
votes
0answers
34 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
24 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
0answers
121 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
1answer
85 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 ...
1
vote
1answer
58 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
115 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....
0
votes
1answer
45 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) ...
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 ...
0
votes
1answer
73 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 ...
1
vote
0answers
47 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 ...
1
vote
1answer
28 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
62 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
109 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 ...
0
votes
1answer
46 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 ...
2
votes
1answer
97 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
1answer
53 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 ?
8
votes
1answer
414 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 ...
2
votes
1answer
53 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
154 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 ...
1
vote
1answer
29 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
79 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 ...
5
votes
1answer
174 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 ...
0
votes
1answer
37 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.
1
vote
0answers
47 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 ...

1
2 3 4 5
11