Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

5
votes
1answer
70 views

API for montly and weekly averages

Bitcoinwisdom shows in their charts lines for weekly and montly averages. Are these numbers somewhere available in an API? If so, one could setup an automated strategy for trading BTC based on this ...
1
vote
1answer
234 views

Why transaction is signed with locking script from the input transaction?

Finally, I've successfully made a raw transaction with Python and this is the last thing, which is totally mistic for me. In my case, here's the input transaction and it's locking script is: OP_DUP ...
1
vote
1answer
665 views

Sending transaction with Python + raw protocol

Two days ago I've found a few articles, about using raw bitcoin protocol, and now I'm still trying to send a transaction. My code is based on this class, and if I understand all of this bitcoin magic ...
1
vote
1answer
259 views

Hex to ASCII conversion of output scripts generates unexpected characters

Embedded in this transaction, there is a blockchain file upload tool written in Python. I'm trying to convert the hex of the output scripts to ASCII, so I can assemble it all into an actual runnable ...
6
votes
2answers
1k views

Different error messages under “Mandatory script verify flag failed.”

I've been playing with raw transactions and signed transaction and I've noticed that the error "Mandatory script verify flag failed" comes in two variations. script failed on OP_EQUALVERIFY OP Script ...
1
vote
1answer
100 views

Why are arithmetic script opcodes limited to 4 byte operands?

The Bitcoin wiki script page says that: Arithmetic inputs are limited to signed 32-bit integers, but may overflow their output. If any input value for any of these commands is longer than 4 ...
10
votes
2answers
2k views

How to get addresses from scriptPubKey in segwit transactions?

I'm running through raw transaction data, and I'd like to be able to gather addresses (where possible). So far, I've made this diagram to help me understand when it's possible to figure out addresses ...
1
vote
2answers
413 views

Types of ScriptPubKey that can contain addresses

I'm trying to get the addresses from the ScriptPubKeys in each transaction (where possible). So far, I know of two patterns of ScriptPubKey where an address can be found: 1. Pay-To-Pubkey ...
3
votes
1answer
308 views

OP_RETURN marks transaction or output as invalid

I am currently looking into the Bitcoin script. I want to create a transaction with one output with OP_RETURN and some data, and one output which pays coins to some address. I am confused, does ...
1
vote
2answers
2k 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 ...
3
votes
0answers
437 views

How can I store a redeem script in my wallet?

Imagine that I wrote a redeem script. I calculated the related P2SH address, and sent some bitcoins to that address. In order to spend that bitcoins, I need to remember two things: The private keys ...
1
vote
1answer
849 views

Spending transaction with custom output

I've recently entered the bitcoin arena, and bitcoinj was my tool choice. Experimenting on regression test mode, I was able to create the following custom transaction. It has a modified locking script ...
3
votes
1answer
142 views

Confused by various apis scriptPubKey

I am really confused and I am having trouble even asking this question in a coherent manner (as I am trying to describe things that other people have renamed multiple times in different instances) so ...
4
votes
1answer
288 views

state of 'atomic cross-chain trading' in 2016

Much of the information I've come across is a bit dated, 2 years or so. For instance, this other question, this thread on the forum. It seems like Interledger is trying to implement, more or less, ...
4
votes
1answer
271 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. ...
0
votes
1answer
52 views

Confused about this particular Multisig transaction with a (maybe) invalid scripts, but spent output

I am confused about this particular transaction: { "txid": "c49b3c445c89d832289de0fd3b0281efdcce418333dacd028061e8de9f0a6f10", "hash": "...
1
vote
4answers
1k 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
110 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 ...
9
votes
2answers
266 views

Why does script need to be purged from transactions for mimblewimble to work?

What is the compatibility problem between script and mimblewimble usage on the main chain? Is there a way that Bitcoin can adapt to allow both mimblewimble and features like multi sig, atomic swaps ...
4
votes
1answer
59 views

Why are redeeming inputs themselves scripts?

When redeeming a UTXO it is necessary to provide certain values such as a public key and a signature. These values come in the form of a script. First, the value providing scriptSig script runs. ...
1
vote
1answer
64 views

(Script) Is it possible to create a transaction that is spendable to only one address?

I'm reading up on Script, which is pretty advanced stuff for a web developer like myself. I'm wondering, is it possible to send a transaction that can only be spent to a particular address? Example, "...
0
votes
1answer
105 views

why scriptpubkey is different

I am confused when i see this transaction Test transaction with one input and two outputs Since scriptpubkey verifies the hash of the sender's public key and sender's signature, i am wondering why ...
1
vote
0answers
353 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
1answer
145 views

If transaction has impossible locking script, are coins lost?

If a bitcoin transaction's outputs have a locking script that is basically unsolvable, are the bitcoins lost, or can the transaction be invalidated? (Or something else?)
2
votes
1answer
140 views

Question regarding the number of bytes in an OP_RETURN transaction

I was reading this very useful explanation of what an OP_RETURN transaction looks like and got tripped up by part of it. "hex" : "6a13636861726c6579206c6f766573206865696469" This first ...
0
votes
1answer
138 views

How is “bytes to push” distinguishable in the scriptPubKey?

Trying to parse scriptPubKeys and get the individual opcodes. My question is: How would you identify the "bytes to push" values? Here's an example of the typical scriptPubKey: 76 A9 ...
2
votes
0answers
95 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
0answers
16 views

how To mine Bitcoin With Server? [duplicate]

I have some server on hostinger. there is any software or script with that I can mine for with one time setting.... I tried for php script search in Google but can't find Sorry for my poor English Pls ...
7
votes
1answer
223 views

PUSHDATA4 unnecessary?

Any data push greater than 520 bytes in a Bitcoin transaction is not allowed (https://github.com/bitcoin/bitcoin/blob/v0.10.0rc3/src/script/script.h#L18). The opcode OP_PUSHDATA4 specifies, that the ...
2
votes
2answers
59 views

Save transaction space with economic Scripts

I have some questions regarding the programming of economic Scripts, so Scripts that save some transaction space compared to functionally the same Scripts but with redundancy by e.g. using the same ...
1
vote
1answer
207 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 ...
3
votes
1answer
306 views

How is nSequence interpreted with CHECKSEQUENCEVERIFY?

I am trying to understand the implementation/specification of OP_CSV with BIP112 and BIP68. I understand the implication of the op-code and new consensus rules. I just don't understand exactly how the ...
1
vote
3answers
146 views

Is there a way to create a transaction that it can only be confirmed after another unrelated transaction has been confirmed?

Is there a way to create a transaction A that cannot be confirmed until B has been included in a block, although A does not build on any UTXO B creates? B would have already been broadcast by another ...
5
votes
1answer
341 views

Where the P2SH script gets written?

I understand that when I'm doing a transaction, I'm locking those bitcoins to whoever provide the solution to a script that has the hash I posted. But, where does the hash get written? I would ...
12
votes
5answers
4k 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?
5
votes
1answer
1k views

Is Ethereum essentially Bitcoin with Turing-complete Script?

Is Ethereum essentially Bitcoin with a Turing-complete scripting language and, if I understand correctly, where the script to be executed (not its hash) is placed in the Ethereum blockchain? If so, ...
3
votes
0answers
418 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
108 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 ...
3
votes
2answers
111 views

Can contracts programmed in bitcoins be used to scam merchants?

I've been learning a lot about bitcoin over the past couple of weeks because I have some interesting ideas for websites and I would like to accept bitcoin as payment. One of my concerns centers ...
3
votes
1answer
368 views

OP_SHA256 mismatch!

I am new to bitcoin. When I use this online 'Script Execution' site, to calculate the SHA256 hash of 1, I get 4bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a but using any other ...
2
votes
1answer
865 views

CHECKSIG description from the wiki

I have been using the Bitcoin Wiki to know more about the CHECKSIG, and the graphic which is shown there. This question will be rather long, but it would already help me a lot if you could just read ...
1
vote
0answers
804 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 ...
7
votes
3answers
2k 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 ...
2
votes
2answers
2k views

CHECKMULTISIG a worked out example

I was wondering if somebody could point me to or give me a worked out example of how OP_CHECKMULTISIG works behind the curtains? I expect that CHECKMULTISIG will call the CHECKSIG function and ...
0
votes
1answer
200 views

How does the scriptPubKey for this test vector work?

The scriptPubKey for cbebc4da731e8995fe97f6fadcd731b36ad40e5ecb31e38e904f6e5982fa09f7 is: ...
2
votes
2answers
305 views

Where is the code making OP_RETURN a standard transaction type?

I am looking through the bitcoin github history. I am trying to find the commit where OP_RETURN became accepted as a standard tx. This was included in the changelog for Bitcoin Core 0.90. Any help ...
6
votes
4answers
247 views

What's the point of having a stack-based scripting language, if only a few standard forms are allowed?

What is the purpose of a stackmachine if only some standard script forms are allowed? And why are some scripts allowed and perfectly fine in mined blocks but rejected by clients if found in ...
2
votes
1answer
718 views

Constructing, signing, and pushing a Bitcoin transaction by using pybitcointools with Python

I'm utilizing the pybitcointools module in python 3.4 I've went through time and time again in the examples listed on the github page, but it isn't documented very well nor is the code. My situation ...
2
votes
1answer
232 views

How is time encoded (BIP65) in scripts?

BIP65 has several examples where OP_CHECKLOCKTIMEVERIFY interprets the time value underneath it in the stack, for example: <expiry time> CHECKLOCKTIMEVERIFY DROP DUP HASH160 <pubKeyHash> ...
1
vote
1answer
1k views

OP_CHECKSIG signature hash type 0

On the Bitcoin Wiki's OP_CHECKSIG documentation: Firstly always this (the default) procedure is applied: the public key and the signature are popped from the stack, in that order. If the ...