Questions tagged [script]

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

52 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
52 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
371 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 ...
3
votes
0answers
528 views

Creation of P2SH MultiSig Input Script

In the createP2SHMultiSigInputScript() function of BitcoinJ according to this: public static Script createP2SHMultiSigInputScript(@NullableList signatures,Script multisigProgram) Create a program ...
3
votes
0answers
122 views

Any Innovations in altcoin tech for Bitcoin’s Script language?

Bitcoin’s Script is the forth-like, non-Turing complete language used for transactions. However, in practice, a very limited number of kinds of scripts are allowed, a number of opcodes have been ...
2
votes
0answers
20 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 ...
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 ...
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
0answers
58 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 ...
2
votes
0answers
34 views

Script and DER in P2PKH

Im trying to figure out the script and DER In P2PKH, the "first part (scriptsig)" push in stack (<sig><pubK>) because is it DER? Instead the "second part (scriptPubKey)" you can map the ...
2
votes
0answers
552 views

Coinbase "convert" API?

I use the convert functions at coinbase to take advantage of market changes to increase my position amounts. This weekend I am going to write a php script that tracks the available conversion pairs ...
2
votes
0answers
266 views

Locktime requirement not satisfied when locktime set to 1 in p2sh

I've created the following script on testnet: OP_IF 2 <pubkey1> <pubkey2> <pubkey3> 3 OP_CHECKMULTISIG OP_ELSE 1 OP_CHECKSEQUENCEVERIFY OP_DROP <pubkey1&...
2
votes
0answers
193 views

Is it possible to create a Dapp on top of Bitcoin?

Is it possible to create a dapp on top of bitcoin similar to how it can be done with ethereum? Can it be just as capable as ethereum?
2
votes
0answers
103 views

A common criticism of Segregated Witness is that it is "unnecessarily complex". Why is it chosen over alternatives?

Segregated Witness (SegWit) is well-along the way to being implemented and deployed as a soft-fork. Facts: SegWit eliminates most forms of transaction malleability. Discounts input scripts in ...
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
0answers
63 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 ...
1
vote
1answer
63 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 ...
1
vote
0answers
26 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
123 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 ...
1
vote
0answers
56 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
0answers
95 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
0answers
49 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
vote
0answers
74 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
54 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 ...
1
vote
0answers
64 views

BIP0034 block height using python-bitcoinlib

I'm doing some experiments for finding coinbase height from freshly mined block which is received from ZMQ. tx_coinbase = CTransaction.deserialize(x('...
1
vote
0answers
168 views

Error mandatory-script-verify-flag-failed (Signature is found in scriptCode)

I found a few questions with the specific error, but couldn't find also the appropriate answer. So, here I am. I am working on regtest in a Python library that create transactions and then use JSON-...
1
vote
0answers
65 views

Segwit versioning limitations

Currently my understanding is that if new version of Segwit script is introduced, you are free to create whatever crazy rules you want there as long as they do not go against any valid consensus rules....
1
vote
1answer
106 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 ...
1
vote
2answers
172 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 ...
1
vote
0answers
101 views

get utx scriptPubKey to become an object

I'm using this python script https://github.com/sebicas/bitcoin-sniffer When I see a utx I look at each output and find the scriptPubKey I expected to see something like "scriptPubKey": { "asm": ...
1
vote
0answers
477 views

Is there any library to process scriptSig script in transaction, and other scripts?

I'm trying to parse hex representation of scriptSig, in normal transactions there are variable int, r&s, pubkey. But some are really weird, like those ones: ...
1
vote
0answers
904 views

(Bither) how can i send my bitcoins?

i downloaded Bither as my virtual wallet and added bitcoins in a Hot Wallet Address. But when i try to send bitcoins, i can't. i fill the address, the amount of bitcoins and i type my password but ...
1
vote
0answers
637 views

Bitcoin script stack numbers format

On bitcoin wiki site I cant found this specification: *The stacks hold byte vectors. When used as numbers, byte vectors are interpreted as little-endian variable-length integers with the most ...
1
vote
0answers
469 views

How to get bitcoin address from the pubkey_hash using bitcoin-abe or something else?

I'm using: https://github.com/bitcoin-abe/bitcoin-abe to import the blockchain into a mysql DB it is almost done after 5 days. So I started looking at the data and didn't see any addresses. I know the ...
1
vote
0answers
178 views

Nonstandard script - TX rejected

I am experimenting in testnet with nonstandard scripts. There was a transaction, created by me, with the following vout script: OP_HASH256 ...
1
vote
0answers
78 views

How can I add recipient on bitcoind CLI

I know I can add recipients to a transaction on bitcoin-qt and I am looking for a similar way to do it on bitcoind CLI on linux and in bash script. I tried using createrawtransaction and multi-sig ...
0
votes
0answers
7 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
0answers
9 views

Non-mandatory-script-verify-flag (unknown error)

I am trying to learn how scripts are working. In a testnet i got some scripts working and learned a lot about what not to do. But now I am struggeling getting this to work. Originaly I worked with a ...
0
votes
0answers
32 views

What is the easyest python3 script to generate pubkey + addresses from 24 words + passphrase?

Coldcard can generate 24 words from dice, but then I still need to verify that applying my passphrase on top of the 24 words, give me the addresses that coldcard is showing me. What is the easyest ...
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 ...
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
0answers
36 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
0answers
295 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
0answers
180 views

Bitcoin Transaction Generation: Signature Verification Error

I have the following raw transaction (basic P2PKH) which I am trying to send to the Bitcoin Testnet 3: ...
0
votes
1answer
102 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
74 views

HTLC in blockchain regtest mode by creating transactions manually

I am trying to create a htlc smart contract manually by writing a script and finding the hex using the btcc compiler. Now node A has to create a transaction using that hex and lock money in that p2sh ...
0
votes
0answers
38 views

Extract input addresses from a tx message in bitcoin protocol

Recently, I wrote a c++ code to extract some information from some messages in BITCOIN protocol. for example, I extracted bitcoin value and output address corresponded to it from tx messages of this ...
0
votes
1answer
410 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 ...
0
votes
0answers
72 views

Uniquely identifying a UTXO

I see two ways: Txid + index Txid + script hash Pros of the txid + index: Simple and short Cons of txid + index: It relies on array iteration being deterministic and all third party services ...
0
votes
0answers
49 views

Check an outpoint's scriptPubKey against known scripts

So I would like to check if coin.out.scriptPubKey is part of GetScriptForDestination(mypubkey.GetID()) A simple comparison isn't possible as the scriptPubKey (when I decode it) contains only the ...
0
votes
0answers
519 views

Error: mandatory-script-verify-flag-failed

I have created a raw transaction from myElectrum wallet, but when I try to broadcast it I get this error: mandatory-script-verify-flag-failed Why is this happening? The transaction is below: ...