Questions tagged [opcodes]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
55 views

How to check OP_CHECKLOCKTIMEVERIFY?

I try to simply get into the OP_CHECKLOCKTIMEVERIFY opcode and test it. However I get the error error: Locktime requirement not satisfied no matter what unix- or blocktime I enter in my btcdeb. I ...
0
votes
1answer
55 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
48 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?
1
vote
1answer
236 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?
5
votes
2answers
208 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). ...
3
votes
1answer
109 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
34 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
1answer
128 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 ...
2
votes
1answer
56 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 ...
0
votes
1answer
54 views

The bitcoin opcode seems to have a flat rate

The bitcoin opcode seems to have a flat rate, is that correct? Or, if bitcoin has a price per opcode, please give me the link. If it is a flat rate, please tell me why bitcoin does not have a ...
2
votes
1answer
80 views

Are P2SH transactions with disabled opcodes relayed/mined?

Many OPCODES like OP_AND, OP_CAT, OP_SUBSTR are disabled as described in https://en.bitcoin.it/wiki/Script. Although, with Bitcoin Core 0.10.0 Gavin Andresen proposed "any Script" in P2SH ...
2
votes
1answer
51 views

How is a locking script reliably detected as a P2PKH script?

I've taken this example from a p2pkh guide: 1976a9145fb0e9755a3424efd2ba0587d20b1e98ee29814a88ac This is broken down into: 19 - byte length of the following unlocking script 76 - OP_DUP: Duplicates ...
1
vote
0answers
30 views

Why does printing a scriptPubKey have an extra OP_PUSHBYTES_20? [duplicate]

I am building a P2PKH script pubkey in code, and the standard format is: OP_DUP OP_HASH160 <PUBKEYHASH> OP_EQUALVERIFY OP_CHECKSIG However, when I print it (I'm using the bitcoin Rust crate) it ...
2
votes
0answers
67 views

Which opcodes where disabled by Satoshi Nakamoto for cve 2010 5137

Lot of opcodes where disabled over the years. But which opcodes where disabled Satoshi himself and specifically for the any one can spend any coin bug?
2
votes
2answers
121 views

Given OP_VER was never used, is disabled and not considered useful can its meaning be stripped and it be made OP_SUCCESS?

Given OP_VER (0x62) was never used onchain, is disabled and is not considered useful can its meaning be stripped and it be made OP_SUCCESS for the purposes of introducing a new different opcode in ...
1
vote
1answer
101 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
2answers
218 views

Creating a custom transactions

I am currently learning how to create raw transactions. I can already create standard using bitcoin core (0.19.1), but when I wanted to create with custom opcode like this: asm: OP_HASH160 ...
2
votes
2answers
410 views

What is the purpose of OP_DROP

From what I can tell OP_DROP is a method of storing non validation data in a tx ( seperate from using data after OP_RETURN ). However in this unlocking script described by bip199, the timeout block ...
7
votes
2answers
557 views

OP_HASH160 vs OP_SHA256

Why would I use OP_HASH160 over OP_SHA256 and vice versa? Why are there two options? In what situations should I use one over the other? Example unlocking scripts: From BIP199: ( where HASHOP could ...
11
votes
1answer
478 views

Did the introduction of VerifyScript cause a backwards incompatible change to consensus?

My question is about the changes to bitcoin done by commit range [a75560d8, 6ff5f718], and their effect on consensus. Out of this range of four commits (all attributed to satoshi) during the dates ...
2
votes
1answer
793 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
3k 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-...
9
votes
1answer
544 views

Why is OP_SUBSTR disabled? (and OP_LEFT, OP_RIGHT)

Why are the substring opcodes disabled? I understand that OP_CAT is disabled because it can blow up the stack easily (in combination with OP_DUP). But the substring opcodes reduce the stack size. ...
12
votes
3answers
3k views

Why is OP_CHECKLOCKTIMEVERIFY disabled by maximum sequence number?

In the code for OP_CHECKLOCKTIMEVERIFY i noticed that if the txin sequence number is maxxed out then the script will fail to validate. I'm wondering what the point of this is? Why would anybody ever ...