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

Create an arbitrary script with two locktimes and p2sh

Alice, Bob and Carol create a p2sh address that initially requires 3/3 signatures. After some time (lock1 using OP_CHECKLOCKTIMEVERIFY) only Alice and Carol can spend and Bob is permanently forgot. ...
0
votes
1answer
121 views

How many IF/ELSE/ENDIF can be used in a script?

Besides the 520 bytes consensus rule limit, is there a limit on how many of each OP_IF, OP_ELSE and OP_ENDIF can be used in a single script? For example, a company that has 3 people in its purchase ...
0
votes
1answer
48 views

Is there a limit in bits for the data hashed in hash-locked script?

What is the limit in bits for the plain-text data of a secret (the data that it is actually hashed and used in a script) in a hash locked contract?
0
votes
2answers
674 views

SegWit witness commitment merkle root location

BIP 141 defines the commitment structure here What i am unsure about is the location of this data. I know it will be in scriptPubKey. Does this mean Coinbase tx will have more than one output? Also is ...
0
votes
1answer
820 views

Unspendable outputs vs Black Hole address

On the Script page of the Bitcoin Wiki, in the "Provably Unspendable/Prunable Outputs" section, it gives an example of a script which would make that output of the transaction unspendable. In the ...
5
votes
1answer
210 views

ScriptSig content during signature (quadratic hashing)

As far as I know, the quadratic hashing problem came from the fact that every time a transaction is verified (or signed), the "unsigned transaction" that is hashed and verified changes depending on ...
4
votes
2answers
166 views

What is the point of including the scriptCode of the input in the transaction digest of segwit?

BIP143 specifies "a new transaction digest algorithm". scriptCode of the input (serialized as scripts inside CTxOuts) What problems could arise if the scriptCode of the input were not ...
0
votes
3answers
158 views

Multisig address for website?

I am trying to sort out the use case of a published funding address on a web page, to which everyone can spend. Internally in our company, I want to avoid, that a single person can spend these funds. ...
1
vote
1answer
449 views

ScriptSig field during P2PKH transaction signature

In P2PKH transactions, the content after signing the transaction contains: <signature(with hash_flag)><public_key>. However, since the signature can't sign itself, during the signature ...
9
votes
1answer
1k views

How is a “standard” Bitcoin transaction defined?

This is useful in Andreas Antonopoulos' book, Mastering Bitcoin: https://github.com/bitcoinbook/bitcoinbook/blob/7c552ea5cfbc19448635b36407761b377ff5cbe9/ch05.asciidoc#standard-transactions "In the ...
0
votes
1answer
132 views

Untypical input script

There are many untypical Input script data in blockchain. What does it mean? For example, transaction: 4A253F17E5F4B24B41F72A6AE46DD1BCB25F7F33769C2AA5D50C6A6A7CF9F76E (link) has it's input script: ...
2
votes
1answer
112 views

CHECKMULTISIGVERIFY with public key hashes?

Is it possible to create a script that implements m of n pay to public key hash neatly? One way to do it would be to make use of OP_IF. But, that's not neat. CHECKMULTISIGVERIFY can implement m of n, ...
4
votes
1answer
5k views

How to get address from scriptSig?

I'm looking for a way to get address from scriptSig. I want to know input address. Can you share how to do it? I prefer PHP library but any ways would be appreciated. e.g. I use bitwasp, a PHP ...
3
votes
2answers
125 views

What are concrete uses of Bitcoin script?

I am looking at solutions to simplify the architecture of Bitcoin from a more theoretical perspective. I am thinking about removing Bitcoin script, however I am not sure what restrictions this ...
1
vote
1answer
350 views

What informations are contained in a transaction?

According to the informations that i found here: https://en.bitcoin.it/wiki/Transaction a bitcoin transaction contains, FOR EVERY INPUT: The Hash of the incoming transaction ScriptSig FOR EVERY ...
0
votes
1answer
352 views

How to get asm and hex from vout

I've got this weird string for a utx message (not my code) CTransaction(nVersion=1 vin=[CTxIn(prevout=COutPoint(hash=41caa5bf2b814135257b26e44b111f55c067f783e3cdf9bdf914e1ef7e403d05 n=0) scriptSig=...
1
vote
0answers
83 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
1answer
145 views

SIGHASH_SINGLE vbuterin/pybitcointools

Checking the implementation of Buterin's bitcoin tools I've noticed something strange. According to the Bitcoin developers guide, sighash_single signs only the outputs that match the input where the ...
4
votes
2answers
426 views

Multi-signature public key validation

In a pay 2 script hash transaction, does the redeem script get checked for valid public keys before a transaction can be signed? I have noticed that if I have a redeem script with one invalid pubkey ...
1
vote
1answer
173 views

Do HTLC transactions work today or do they need a new soft-fork?

I thought that HTLCs was just a kind of a script construct that would allow to unlock funds for a period of time, which can be unlocked to anyone that provides the original string that matches the ...
4
votes
1answer
89 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
249 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
841 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
337 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 ...
8
votes
2answers
2k 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
117 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
485 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
446 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
475 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
976 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
178 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, ...
6
votes
1answer
329 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
59 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
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
126 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
278 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 ...
3
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
73 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
120 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
418 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
153 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
155 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
174 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
99 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
2answers
421 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
67 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 ...