Questions tagged [script]

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

Filter by
Sorted by
Tagged with
5
votes
1answer
183 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
39 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?
6
votes
1answer
867 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
23 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, ...
22
votes
9answers
7k views

Online Bitcoin Script simulator or debugger?

Is there an online simulator that would allow me to step through, debug, or simulate the execution of a Bitcoin script?
1
vote
2answers
167 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 ...
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 ...
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?
0
votes
1answer
101 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 ...
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 ...
1
vote
1answer
51 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 ...
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.
1
vote
1answer
101 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
397 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 ...
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
62 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 ...
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
222 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 ...
3
votes
2answers
358 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 ...
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
108 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 ...
23
votes
1answer
4k views

How do Scripts work?

Bitcoin protocol supports scripts. How do they work? How are those implemented? What are their intended usages? When are they planned to be used?
0
votes
1answer
58 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 ...
4
votes
4answers
123 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 ...
3
votes
1answer
651 views

Redeem script. script hash, witness script and witness program

I have a little confusion about naming in Bitcoin. Redeem script is the conditions that will be satisfy. For example P2PKH inside P2SH OP_DUP OP_HASH160 <PubKHash> OP_EQUALVERIFY OP_CHECKSIG ...
3
votes
1answer
152 views

Create Custom script from bitcoind

I'm able to create multisig with bitcoin-cli with addmultisigaddress bitcoin-cli addmultisigaddress 2 '["'$ADDR_MITT_1'","'$ADDR_MITT_2'","'$ADDR_MITT_3'"]' But How can I add extra OP like CLTV or ...
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 ...
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 ...
9
votes
1answer
514 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. ...
1
vote
1answer
325 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
128 views

Taproot - Eliminating Key Path

I want to struct a transaction output the key-path of which I want to be eliminated, so enforcing only the script path. In order to eliminate key-path, in my opinion, I should set "Internal ...
1
vote
1answer
78 views

Could CHECKSIGADD be used on new ECDSA multisignatures instead of CHECKMULTISIG?

The proposed Taproot soft fork (BIP 342) defines the new opcode OP_CHECKSIGADD to verify Schnorr multisignatures whilst OP_CHECKMULTISIG (and OP_CHECKMULTISIGVERIFY) are disabled for Taproot spends (...
10
votes
1answer
2k views

What is the alt stack?

I noticed in the bitcoin wiki script page (https://en.bitcoin.it/wiki/Script) that there were two opcodes named: OP_TOALTSTACK OP_FROMALTSTACK It looks like there is another stack that can be used ...
2
votes
1answer
72 views

What is the relationship between the Minsc language and Policy language?

Quoting from the Minsc website "Minsc is a high-level scripting language...based on the Miniscript Policy language with additional features and syntactic sugar sprinkled on top including ...
1
vote
1answer
531 views

what is the use of OP_PUSHBYTES

what is the meaning of this SCRIPTPUBKEY: OP_DUP OP_HASH160 OP_PUSHBYTES_20 xxxxx....xxxxxxxx OP_EQUALVERIFY OP_CHECKSIG in particular I searched for some documentation on OP_PUSHBYTES_X which only ...
12
votes
2answers
2k views

What is OP_CODESEPARATOR used for?

Looking at the Bitcoin source (https://github.com/bitcoin/bitcoin/blob/v0.9.3/src/script.cpp#L843-L847, specifically), I ran into the use of the OP_CODESEPARATOR. Am I right in interpreting this code ...
4
votes
2answers
161 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 ...
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 ...
57
votes
4answers
33k views
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?
2
votes
2answers
86 views

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

For P2PKH, the scriptPubKey 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 ...
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
2answers
172 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
2 3 4 5
11