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
1
vote
0answers
35 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
730 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....
0
votes
1answer
60 views

Bitcoin scriptSig with two transactions to unlock the scriptPubKey

For example, the bitcoin script of a scriptPubKey that consists of OP SUB < 100 > OP EQUAL, and is used to lock an output of a transaction. OP SUB pops the top two elements in the stacks, ...
0
votes
1answer
24 views

and(older(10),pk(A)) malleable if top-level, can it be top-level? EDIT: not malleable, was mistaken

$ ./miniscript and(older(10),pk(A)) X 110.0000000000 37 and_v(v:pk(A),older(10)) and(older(10),pk(A)) and_v(v:pk(A),older(10)) 1 scriptlen=37 maxops=2 type=B safe=yes nonmal=yes dissat=...
0
votes
2answers
45 views

What am I missing about this “guaranteed” money-making scheme that I didn't hear from anyone but just popped up in my head?

Let's suppose that I have already set up an account at Exchange A and Exchange B, loaded each up with a small buffer of BTC (much less than 1 BTC), and am able to make API requests to buy/sell from ...
1
vote
1answer
42 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 ...
2
votes
1answer
48 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
28 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 ...
2
votes
1answer
39 views

How do I write a script such that my funds are locked in a 2-of-2 multisig that converts into a 1-of-2 multisig after 365 days?

I would like my Bitcoin to have the extra security that a 2-of-2 multisig provides. With a single sig I am worried that if a single key gets hacked I will lose my funds. However, with a 2-of-2 ...
1
vote
0answers
21 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
30 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
43 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
32 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
156 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
43 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
85 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
53 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
34 views

OP_LSHIFT & OP_RSHIFT purpose & functionality

What is the purpose & functionalities of the LSHIFT & RSHIFT Script OP codes ?
3
votes
2answers
54 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
49 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
17 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
38 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
34 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
36 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
50 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
22 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
48 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
115 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
64 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
85 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
91 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
36 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
81 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
353 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
151 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
62 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
110 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
64 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
22 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
82 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
543 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
90 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
82 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
298 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
2 3 4 5
10