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
0answers
22 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?
1
vote
2answers
42 views

About Bitcoin Core

I have just downloaded the Bitcoin Core from https://bitcoin.org/en/download I would like to ask the following since I have read the following article: https://blockgeeks.com/guides/best-bitcoin-...
1
vote
1answer
30 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 ...
2
votes
1answer
137 views

What happens if a P2SH redeem script is lost?

Assume Bob creates a complicated Bitcoin Script and asks Alice to make a payment to a hash of this script. (Using a P2SH transaction) If Bob loses the script (i.e. the source code of the script), is ...
1
vote
1answer
37 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 (...
2
votes
2answers
70 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 ...
3
votes
1answer
47 views

Should the Policy to Miniscript compiler(s) be considered as deterministic and is this the end goal?

Should the Policy to Miniscript compiler(s) be considered as deterministic and is this the end goal? This question was asked by Jeremy Rubin on ##miniscript on IRC and has been paraphrased. For basic ...
0
votes
1answer
30 views

OP_LSHIFT & OP_RSHIFT purpose & functionality

What is the purpose & functionalities of the LSHIFT & RSHIFT Script OP codes ?
3
votes
2answers
52 views

How does the sender know the receiver's public keys in a m-of-n transaction?

Assume that Alice is controlling an address that requires multisig to spend bitcoins. Someone wants to send Alice bitcoins and this sender needs to create a scriptPubKey as part of the output paying ...
0
votes
0answers
31 views

Is who is richer game possible with bitcoin script?

With Bitcoin script, is it possible to construct a timelocked address X in such a way that: Players A and B (maybe more players) can send bitcoin to this address; When the timelock expires,the player ...
0
votes
1answer
39 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
15 views

Can we determine which one of the referenced outputs corresponds to a cashback transaction in BTC transaction scripts?

let me quickly elaborate the question. The structure of a BTC transaction script looks somewhat like the following example "...
1
vote
1answer
29 views

how to find p2sh/p2wsh in utxo set after wallet recovery

i'm trying to understand how wallets remember a redeem script for p2sh/p2wsh for spending, after recovering from their seed, because the utxo set only has the hash in it, right? there are a nearly ...
0
votes
1answer
31 views

Could it be possible to secure transactions against double-spending with other utxos?

I'm new to Bitcoin Script, and I was wondering if it is possible to use funds from one utxo to "insure" that other utxo will not be double-spent (until the Lightning Network will save us all). Suppose ...
0
votes
0answers
35 views

creating macd script

this was a script I found for trading with macd. It is taken from trality.com: @schedule(interval="1h", symbol="BTCUSDT") def handler(state, data): macd_ind = data.macd(12,26,9).last if macd_ind ...
3
votes
1answer
47 views

With Miniscript why is it not possible to invert conditions with something like not()?

This question was asked by Luke Childs (@lukechilds) on Twitter. In Miniscript would it be possible to invert conditions with something like not()? Could you essentially create a younger() out of not(...
0
votes
1answer
20 views

Understanding assurance contract in bitcoin scripts

I'm having a bit of trouble understanding example 3, the bit coin assurance contract on the bitcoin wiki(https://en.bitcoin.it/wiki/Contract) where senders choose to donate money only if 1000BTC total ...
2
votes
0answers
47 views

How does one prove total turingness of the bitcoin script using the Ackermann Functions?

In this Medium Article (https://medium.com/@craig_10243/bitcoin-a-total-turing-machine-5a6c3c68f5a7#_ftn2), C. Wright states: "...It is known that all primitive recursive functions are total and ...
0
votes
1answer
43 views

Script_sig for coinbase transaction afbff1130b6fcbdceebbadfc48a842af1f03ee08a79e042b37fc467518b49a0f

I am currently developing a blockchain parser in Python, and it has been crashing in the file blk00006.dat for the coinbase transaction with the hash ...
3
votes
1answer
113 views

How is Simplicity better suited for static analysis compared to script?

Quoted from the whitepaper, one of the design goals of Simplicity is: Provide formal semantics that facilitate easy reasoning about programs using existing off-the-shelf proof-assistant ...
0
votes
1answer
32 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 ...
0
votes
0answers
62 views

How to construct and redeem a bip199 htlc with python-bitcoinlib

Playing with this script, I'd like to understand how to construct a bip199 htlc and redeem it, however this script fails on the OP_EQUALVERIFY and I can't seem to understand why. I'd like an ...
0
votes
1answer
79 views

Standardness rules related to BIP 16 (P2SH)

I can read in BIP0016 wiki the P2SH Specification Transactions that redeem these pay-to-script outpoints are only considered standard if the serialized script - also referred to as the ...
3
votes
1answer
88 views

Where can I find the miniscript policy language specification?

I would like to understand how miniscript works by coding it myself. As I started studying it, I realized that miniscript is more or less a 1-for-1 abstraction of a subset of Script and that the ...
0
votes
1answer
34 views

What are the script size limitations according to consensus rules and are they enforced on TestNet?

I'm trying to figure out the limitations that scripts have regarding their size, limits that would make a script invalid (ignoring standardness). According to this question and also these lines of ...
2
votes
1answer
77 views

Create Custom Script with 2-3

I'm studying P2SH, and I want to create a custom script. I already created one tx but without OP_CHECKMULITISIG as you can check at this link https://tbtc.bitaps.com/...
0
votes
0answers
32 views

How does HASHSIG work?

I am reading an article about how HASHSIG works, but i don't understand this: Before the signature is computed, several temporary changes are made to the transaction: The signature script of the ...
4
votes
1answer
340 views

How is OP_CHECKTEMPLATEVERIFY a scaling solution

I was wondering about OP_CHECKTEMPLATEVERIFY or OP_SECURETHEBAG as it was previously called. As far as I understand it you can commit on how to spend the coins later this way. But it doesn't enable ...
1
vote
1answer
113 views

Bech32 Multisig error: Witness requires empty scriptSig (code 64)

I've been able to do multisig between two addresses from electrum and one from bitcoind. [root@test bin]# bitcoin-cli -testnet getnewaddress n3JewuY82cprdRvxHdRNG8C3iTkJBKeLbz [root@test bin]# ...
1
vote
3answers
61 views

What are some good solutions for analyzing Bitcoin script patterns?

I'm interested in analyzing the Bitcoin blockchain for occurrences of particular scripts and spending patterns. What are some good solutions for this? An ideal solution would let me filter ...
1
vote
2answers
103 views

Can someone explain how an HTLC is redeemed?

I'm looking at Bolt 3 in the Lightning rfc. My question is about how a HTLC is redeemed. Example HTLC script for reference: # To remote node with revocation key OP_DUP OP_HASH160 <RIPEMD160(SHA256(...
0
votes
1answer
53 views

How to verify locking and unlocking scripts?

I've selected an arbitrary transaction id and retrieved its associated transaction details using the blockcypher explorer as follows: from blockcypher import get_transaction_details ...
0
votes
1answer
21 views

How does a constant opcode become negative in Script

I am doing some tutorial and in this chapter we are suppose to reproduce the Script scripting language I am struggling to understand one of the exercises, here it is: Create a ScriptSig that can ...
1
vote
1answer
70 views

Is a script spendable if multiple items are left on the stack?

Is a script spendable if the top item left on the stack evaluates to "TRUE", and that is the only item left in the stack? In other words, is it okay for multiple items to be left on the stack? For ...
1
vote
2answers
478 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 ...
1
vote
1answer
84 views

What is the scriptCode in a P2WSH transaction?

Let's say I am spending from a 2-of-2 multisig with this script: ...
1
vote
1answer
77 views

Why is there no decentralized Bitcoin trading API?

Since nobody has answered me the last 30 times when I asked for decentralized Bitcoin trading APIs, I can pretty safely conclude that it just doesn't exist. So that's why I now ask why this is. Don't ...
1
vote
1answer
206 views

Decoding hex scriptsig in Python

Running decodescript on d1a076722d11ddfd0fadb96d6d960b8b2ad6c6369570cd00df70a801a6be9e44 is returning: { "asm": "0 ...
12
votes
3answers
1k views

What does Bitcoin policy language offer the developer that Miniscript doesn't? What is the difference between Bitcoin policy language and Miniscript?

I understand that policy language compiles to Miniscript and Miniscript compiles to Bitcoin Script. This is also a great resource on Miniscript: http://bitcoin.sipa.be/miniscript/ But I know very ...
0
votes
1answer
32 views

How Extracting address Bitcoin to script multi signature

I want to extract the correct address from a script multi-signature. I have this real script multi-signature from this ScriptSig (tx index 1), so this is a readme script for this address OP_2 ...
1
vote
0answers
41 views

Is possible extract the original script P2MS from the transaction locked with the P2SH address?

This is a stupid question because if the P2SH contains the hash160 (and the hash160 contains the sha256) of the P2MS doesn't possible return to the original hex P2MS. So, but for verifying the P2SH I ...
1
vote
0answers
38 views

How verify (in C++) input signature?

First small problem: blockchair.com give me only output scripts, not input - is any blockexplorer online with it? I read binary data and this may be hard recreate my sample data and verify. I test BTC ...
10
votes
1answer
243 views

Can we construct a UTXO which is spendable only via proof of work?

Do the current Bitcoin opcodes and transaction size limit allow constructing a UTXO which is only spendable if a specified amount of work has been performed? So the spender, would provide a nonce as ...
1
vote
1answer
63 views

Does Bitcoin script support nested IFs (OP_IF or OP_NOTIF inside one another)?

For example can we convert the following code to a script? if(bool_1) { FOO1(); if(!bool_2) { FOO2(); } else { BAR1(); if(bool_3) { ...
3
votes
1answer
71 views

Clarification on execution of complex script with OP_CHECKLOCKTIMEVERIFY

I'm quoting this example of BIP65 BIP 65 has this bitcoin script code IF <now + 3 months> CHECKLOCKTIMEVERIFY DROP <Lenny's pubkey> CHECKSIGVERIFY 1 ELSE 2 ENDIF <...
0
votes
0answers
151 views

How to use “OP_CHECKSEQUENCEVERIFY” in regtest?

I have created a P2sh includes OP_CHECKSEQUENCEVERIFY and funded the same. I was trying to redeem the coins. But i could not understand the working of OP_CHECKSEQUENCEVERIFY. Below is the example ...
0
votes
1answer
81 views

How to calculate the Public key P2SH from hexadecimal script?

My study on the scripts goes next. I'm creating a ScriptPubKey decompiler, now I have a problem with the P2SH, So how is calculate the key p2sh? I using this code but I not think is correct ...
1
vote
1answer
114 views

Clarification on the script P2SH, how is executed to Bitcoin core?

This question is a continuation of the my post yesterday. Today I have a question on P2SH execution so, an example of the script should be this OP_0 <A Signature> <B Signature> OP_2 <...
0
votes
1answer
108 views

How does this simple script use the OP_CHECKSIG opcode?

I have this Script P2PKH <A Signature> <A Public Key> OP_DUP OP_HASH160 <A Public Key Hash> OP_EQUALVERIFY OP_CHECKSIG The bitcoin.org documentation say this The entire ...
4
votes
1answer
106 views

How does Elements integrate Simplicity?

Greg Maxwell noted that there are two ways to integrate Simplicity into Bitcoin. One is to make only a few select high-level constructs available (like SHA256, CheckSigHashAll), the other is to expose ...

1
2 3 4 5
9