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
1answer
131 views

Problem with value after OP_HASH160

I am trying to implement JavaScript interpreter for Bitcoin scripts, but I have problem with counting value of OP_HASH160. I found that Hash160(x) = RIPEMD160(SHA256(x)) However, when I try to count ...
2
votes
2answers
223 views

What is the format of the standard claim script?

With reference to this: https://en.bitcoin.it/wiki/Transactions#Pay-to-PubkeyHash It would seem the claim script is simply the signature consisting of S and R and the public key. However I know at ...
2
votes
2answers
510 views

What node implementations and mining pools relay and process 'non-standard' scripts?

Which Bitcoin node implementations, if any, currently relay valid transactions that use so-called 'non-standard' scripts? What proportion of the network is made up of these implementations? What ...
2
votes
1answer
294 views

Completely confused with mutisig address and scripts

I used the guide, how to make escrow from bitcoin console. Here are my transactions in testnet: tx1 tx2 I am confused about ScriptPublicKey in tx1: OP_HASH160 ...
2
votes
1answer
223 views

Script To Limit Transactions To Specific Wallets

I am trying to write a script that will allow the receiver of my coins to only spend them on two wallets I specify. After that check has been done I want to perform the usual verification that the ...
2
votes
1answer
187 views

How do I list all unique scripts from blockchain?

How do I list all unique scripts in the block chain, and their count (n-times-used)?
2
votes
0answers
17 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
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 ...
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/...
2
votes
2answers
109 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 ...
2
votes
0answers
31 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
2answers
128 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 ...
2
votes
0answers
246 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
100 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
2answers
160 views

Does value 'True' at the middle of stack is valid transaction?

If at the middle of the execution of scriptSig + scriptPubKey we get the value 'True', while there are remaining values or operators in the stack, is the transaction valid? Or should the stack be ...
1
vote
1answer
114 views

Why are only specific transaction types accepted into the mempool?

In the Bitcoin Mainnet, only specific transaction types are accepted: Bitcoin uses a scripting language to specify (and satisfy) the encumbrances, thereby allowing a whole host of transaction types....
1
vote
1answer
743 views

Bitcoin - Is the <pubKeyHash> in scriptPubKey already hashed?

In Bitcoin protocol, to set the output of a transaction you need a scriptPubKey which is in the following format. scriptPubKey = OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG Is &...
1
vote
1answer
103 views

In the bitcoin scripting language, how can I access other outputs of the transaction? Or how else can I limit how the coins may be spent?

Is there any way to add an opcode to a UTXO that prevents how the coins are spent? For example, in order to to spend the output, a person must send X number of bitcoin to Y address within the ...
1
vote
2answers
330 views

Differentiating Output Script (scriptPubKey) Types

I am working on a little script to breakdown the data inside coinbase transactions. This is largely to improve my understanding of legacy and SegWit transactions (Given coinbase transactions have less ...
1
vote
1answer
349 views

How to find out the requirements for spending an output script?

How do you find out the requirements to spend an output script? Do you decode the hash?
1
vote
2answers
141 views

Can bitcoin script look at the output?

I was wondering if it possible for a bitcoin script check part of the output of the transaction. Lets say, I want to check that the transaction is splited equaly between 3 outputs, I dont care which.
1
vote
4answers
2k views

Generate and push raw Bitcoin transaction

When I try to push a raw Bitcoin transaction via the blockchain.info API I get the following error message: Script resulted in a non-true stack: [] Transaction should send 0.001 Bitcoins with a 0....
1
vote
2answers
144 views

Debugging OP_EQUALVERIFY: non-equal data: how to get uncompressed public key and address from scriptSig

This is the top ranking result on google for OP_EQUALVERIFY: non-equal data error. In the answer, the person gets the uncompressed public key and its address from the scriptSig. Is there a website ...
1
vote
2answers
703 views

bitcoin script for a competitive crowdfunding-like contract

I'm curious about how one might replicate the functionality of http://whatbitcointhinks.com/ using bitcoin script. The functionality is that there's a sort of crowdfunding competition between two ...
1
vote
3answers
263 views

How many OP_RETURN transactions in the Blockchain would be too many?

I realize this question may not have an answer and therefore might not be suitable for SE, but I'm very curious about OP_RETURN transactions. OP_RETURN transactions appear to be the accepted ...
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(...
1
vote
2answers
474 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
83 views

Multisig without P2WSH in Lightning

The current Lightning implementations use P2WSH script format for multisig in the funding transaction. But it is also possible to use the CHECKMULTISIG opcode "natively", i.e., without P2WSH (see ...
1
vote
1answer
104 views

Besides transaction validation, are there any other uses of the Script language in Bitcoin

Script's stack operations are used to validate signatures and scripts of transaction inputs and outputs. Is Script also used to validate block, network, or any other data? Seem like there are a lot ...
1
vote
1answer
19 views

One more question about scripting

Is it possible to write a script that would allow withdrawal of money only to a specific address? Is it possible to write a script that would allow withdrawal only specific amount? Any examples ? ...
1
vote
2answers
367 views

What is the purpose of the script like RETURN PUSHDATA(36)(…)

The example is in here: https://www.blockchain.com/btc/tx/63910fdfa84db96bd1f28fead4c32f97388d5368c10059d035aac3c5f72fcdc0 Actually, there are two outputs DUP HASH160 PUSHDATA(20)[...
1
vote
1answer
122 views

what if a coin is spendable by multiple keys?

it seems like the scripting language could allow multiple private keys to spend a coin? what if i send a coin to someone, but also allow it to be spendable by me. would their wallet still show they ...
1
vote
1answer
133 views

Bitcoin's script expressivity

I'm conscious that Bitcoin's script is not turing complete, as multiple answers point out (e.g., this answer and this one). But I'm wondering if script can express the language of a PDA or ...
1
vote
1answer
46 views

Can I use opcodes traditionally used for verifying keys to verify payment sizes?

Can I use binary opcodes usually used for verifying keys to verify payment sizes? It looks like these opcodes like OP_EQUALVERIFY and OP_NUMEQUALVERIFY are used for checking signatures or keys, ...
1
vote
1answer
553 views

Bitcoin core multisig signing order

I have a technical question regarding the signrawtransaction function in Bitcoin core when signing a partially-signed transaction. I have tested different scenarios and signrawtransaction will always ...
1
vote
1answer
889 views

Why are Virtual Machines used in Ethereum?

I'm wondering why the Ethereum Virtual Machine (EVM) is used? What if they didn't use it? Why don't we have them in Bitcoin?
1
vote
2answers
3k views

How to manually verify a signature given scriptSig and scriptPubKey?

First transaction Given a transaction on the blockchain: 3a1b9e330d32fef1ee42f8e86420d2be978bbe0dc5862f17da9027cf9e11f8c4 One of the outputs transfers 424,242.42424242 BTC to ...
1
vote
1answer
238 views

P2SH (pay to script hash) within a script?

BIP16 P2SH defines special rules to apply on scripts with a specific pattern, namely: OP_HASH160 <scriptHash> OP_EQUAL. My question is: Can a P2SH be used within a script? So can I e.g. make a ...
1
vote
2answers
268 views

txout script criteria (scriptpubkey critieria)

what is the criteria for a txout script to be accepted into a mined block? is there any criteria at all? the reason i ask is that OP_RETURN is regularly used in txout scripts yet it is not spendable: ...
1
vote
1answer
313 views

Does createrawtransction accept scriptPubKey and redeemScript as inputs?

According to the built-in RPC documentation the signature for createrawtransaction is: createrawtransaction [{"txid":"id","vout":n},...] {"address":amount,...}. Gavin in his example on 2-of-3 ...
1
vote
2answers
525 views

Conditional scripting: how does OP_NOTIF (and OP_IF) operation(s) affect the stack?

I'm trying to write a scriptPubKey for a transaction which checks that the hash of the top value in the scriptSig is equal to either one of two fixed values and if so will do the normal transaction ...
1
vote
1answer
161 views

Can someone explain this [outdated] BIP12 OP_EVAL exploit?

I understand that BIP12 was withdrawn, and probably because of this exploit below. Can someone explain how this attack would have worked and the effect it would have on the network? for (;;) { ...
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
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
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
1answer
337 views

Bitcoin TX decode failed while sending to a the network(regtest)

I have created a signature manually (referring the signature output formats in bitcoin-cli). But i tried to send the same to the network I am getting error code: -22 error message: TX decode ...
1
vote
1answer
45 views

Bitcoin script (pay-to-pubkey-hash)

Example for 'pay-to-pubkey-hash' is quoted in Wiki bitcoin script. I have a doubt that 14 is for bytes to push. But the data to push is 20 bytes. Please anyone could explain to me? Script: 76 --> ...
1
vote
1answer
61 views

How to generate an output address from output scrips which start with 0x00?

A few days ago, I got a BITCOIN traffic which contains some tx message. some of tx messages contain witness data. I want to produce all output addresses from transaction output scripts. I extracted ...
1
vote
2answers
87 views

How to extract raw script from tx messages when the output script starts with 0xA9?

I'm working on extracting output addresses from tx messages in BITCOIN packets. Currently, I extract address from output scripts which starts with 0x76(OP_DUP) like this : 76 a9 14 6d 1d 74 58 95 6e ...
1
vote
1answer
107 views

Script Null into raw trasaction bitcoin core

I'm developing a parser for bitcoin core and into the alpha test of the parser,I noticed than the script bitcoin core are null and the hash raw transaction exist. An example: for this transaction the ...

1
3 4
5
6 7
9