Within the context of Bitcoin, scripts are a set of instructions on how to complete a transaction. The default send/receive actions are scripts but the protocol can be extended through the creation of new scripts, such as the DNS replacement abilities of NameCoin.

learn more… | top users | synonyms

0
votes
1answer
14 views

How does the scriptPubKey for this test vector work?

The scriptPubKey for cbebc4da731e8995fe97f6fadcd731b36ad40e5ecb31e38e904f6e5982fa09f7 is: ...
0
votes
2answers
20 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 ...
2
votes
1answer
41 views

Scripts! But not really?

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 ...
1
vote
1answer
29 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
20 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
votes
0answers
19 views

Script to run multiple altcoin daemons

Right now i've got 5 altcoin-qt wallets on a vps, configured as masternodes. To limit their memory usage (even if not by a lot) and to facilitate masternode rewards withdrawal, i'm thinking at ...
0
votes
0answers
26 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 ...
2
votes
2answers
55 views

When can I send 80 byte OP_Returns?

I heard bitcoin-core 0.11 allows 80 byte OP_Returns, but I know miners operate different implementations and was wondering when it would be likely that 80 byte OP_Returns will be swiftly included in ...
2
votes
1answer
67 views

Does an OP_RETURN script always need another output within the transaction?

I was reading this: Explanation of what an OP_RETURN transaction looks like and I wondered if the second output "value" : 0.00200000, was at all necessary. Can I just have a OP_RETURN with a 0 output ...
2
votes
2answers
65 views

Compact integer in Scripts

I've been looking at the compact representation of integers for integer operations in the Script language. It seems that most operations produce or push byte arrays, but when integer operations are ...
2
votes
1answer
25 views

Maximum number of op_codes in script

Is there any part of the Bitcoin protocol that established a limit on the maximum number of op_codes in a script. Recently I have hit the limit for the bitcoin core client. In: ...
1
vote
1answer
26 views

Script. OP_PICK/OP_ROLL

OP_PICK should take the nth element from the back of the stack and take it on top: for input xn ... x2 x1 x0 gives xn ... x2 x1 x0 xn I have used it in some scripts, but I've noticed some strange ...
1
vote
2answers
36 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: ...
5
votes
3answers
159 views

Are loans with enforced repayment possible on the blockchain?

Are loans with interest possible in Bitcoin, such that repayment is enforceably encoded with Bitcoin Script on the blockchain from the establishment of the lending contract?
1
vote
1answer
56 views

How do I print unspent transaction outputs of an address using pybitcointools

I am a beginner looking to write a simple program that takes an input (address) and prints the unspent amount in it. I copied some code from chapter 4 of Mastering Bitcoin to generate a random ...
2
votes
2answers
106 views

OP_HASH256 of a negative number

transaction 9 in block 251684 spends transaction 25 of block 249957. the script to be evaluated here is: OP_PUSHDATA0(20) 16cfb9bc7654ef1d7723e5c2722fc0c3d505045e OP_SIZE OP_DUP OP_TRUE ...
5
votes
0answers
80 views

Which release fixed CVE-2010-5141 (attacker can spend any coin)

This post by Mike Hearn relates an interesting bit of history: When Bitcoin was first released, it contained two completely fatal bugs that made the entire system worthless. Fortunately, they were ...
0
votes
1answer
24 views

Can a transaction be conditioned on signing another transaction?

I was thinking around http://lightning.network/ . My problem is Alice sending coins to Bob via Eve: A -- tx1 -> E -- tx2 -> B Is there a way to condition tx1 on Eve signing tx2?
2
votes
1answer
38 views

What are these strange outputs in the Litecoin blockchain?

I have found that there are some strange outputs in the Litecoin blockchain that pay small amounts to the scriptPubKey 736372697074. In ASCII, this translates to "script", reminding me of how nodes ...
2
votes
1answer
38 views

Is it possible to copy other scriptSig for using in different transaction?

To use a UTXO one must supply correct scriptSig or "unlocking script" to the given scriptPubKey "lock script", I know the scriptSig in PTPKH locking is sig and pubkey. My question is what makes the ...
1
vote
2answers
40 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
71 views

Without using something like Bitcoin Script, how NEM verify the transaction?

From NEM's thread in bitcointalk, it mentions: NEM doesn’t use so-called “scripts” aka predicates. I understand how Bitcoin use the script to verify the transaction. May I know where I can read ...
0
votes
1answer
21 views

Does OP_EQUALVERIFY have a return value?

The Bitcoin wiki has a page that summarizes OP_EQUAL and OP_EQUALVERIFY: OP_EQUAL Opcode (Hex): 135 (0x87) Input: x1 x2 Output: True / false Summary: Returns 1 if the ...
3
votes
0answers
86 views

Working example of raw transaction utilising Boolean (OP_IF, OP_ENDIF) scripting REQUIRED

I recently posted this Testnet TX (TxID 2d0daa01da8294a54178f8111eb2a02010c425fd15957d8baee8717edcfbe105) which successfully spends an output (TxID ...
1
vote
2answers
50 views

Specific instance of Tx using a malformed null byte vector for P2SH; insight req

From Biteasy's API for TXID fccf964964c34994e5dbbb9ff7f914159b524b0831f6eea12255aa424b39090e we can see the following info regarding inputs (for a P2SH Tx): "script_sig_string": "[] ...
1
vote
2answers
116 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 ...
3
votes
2answers
159 views

Non standard Tx with obscure OP codes: examples

I've been writing Python code to fetch various transactions and came across this: 77822fd6663c665104119cb7635352756dfc50da76a92d417ec1a12c518fad69. The script field is as follows: scriptPubKey: ...
3
votes
2answers
108 views

Is there a maximum size of a scriptSig/scriptPubKey?

Previous research: Transaction's maximum size What is the maximum size of a transaction? The maximum size of a standard transaction is 100k bytes. Are there any consensus rules that prohibit ...
1
vote
1answer
61 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 ...
3
votes
2answers
137 views

Which bitcoin script forms should be detected when tracking wallet balance?

I am implementing a library for tracking wallet balance of given bitcoin addresses. How should the transaction output script be parsed to find if the output belongs to the given address? Is it dirty ...
4
votes
1answer
108 views

What is OP_CODESEPARATOR used for?

Looking at the bitcoin source (https://github.com/bitcoin/bitcoin/blob/v0.9.3/src/script.cpp#L843-L847, specifically), I ran into the the use of the OP_CODESEPARATOR. Am I right in interpreting this ...
2
votes
1answer
90 views

Multisignature: what happens if the number of signatures exceeds the “threshold” number of public keys?

Let's say a coin has been locked with a 2-of-3 challenge script. In other words, spending the coin requires two signatures, each of which matches one of three designated public keys. Now I try to ...
1
vote
1answer
148 views

Redeem bitcoins of non-standard transactions made with eligius

As I understand it, Eligius is the only miner pool accepting non-standard transactions. The Opcodes for the scripts are here. Some use cases for non-standard transactions can be found here. My ...
2
votes
2answers
155 views

Is there any way to make an UTXO that cannot be spent until a certain block #?

In bitcoin, each transaction has an nLockTime integer to specify the earliest allowed block number/time that the transaction can be added to the blockchain. In addition, each transaction input has an ...
2
votes
1answer
86 views

Why does the default miner implementation use pay-to-pubkey?

Looking at the v0.9.3 source in miner.cpp: CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey) { CPubKey pubkey; if (!reservekey.GetReservedKey(pubkey)) return NULL; ...
1
vote
1answer
120 views

how to get one address from two public keys?

Parsing an input script of a transaction, I’ve come across two public keys in the script. Either public key is 33 byte long. I know how to transform a single 33 byte long public into an address. ...
1
vote
2answers
96 views

Can new OP codes be added with a soft fork?

I understand that P2SH transaction types were added "softly" by repurposing a Tx message that is already valid, so old nodes won't reject them in blocks. Is there a similar method to adding new ...
4
votes
2answers
124 views

Bitcoind transaction data verification

I find myself a victim of either my poor googling skills, or the lack of detail in the bitcoind docs. I have a walletNotify script running on a full node that whenever a transaction to / from my ...
0
votes
1answer
50 views

Why is the scriptPubKey required when using signrawtransaction?

The signrawtransaction rpc method calls for the following use: signrawtransaction "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype ...
4
votes
1answer
163 views

What is the alt stack?

I noticed in the bitcoin wiki script page (https://en.bitcoin.it/wiki/Script) that there were two opcodes named: OP_TOALTSTACK OP_FROMALTSTACK It looks like there is another stack that can be used ...
3
votes
1answer
116 views

Bitcoin Script Execution - Must end with just `true`?

When executing bitcoin validation scripts, does the final stack have to end with just true on the stack, or can there be some elements under the true? In other words, are both of these final stack ...
5
votes
1answer
74 views

Does OP_HASH160 consume the top stack element?

In a standard P2PKH configuration, the scripts look like: Pubkey script: OP_DUP OP_HASH160 <PubKeyHash> OP_EQUALVERIFY OP_CHECKSIG Signature script: <sig> <pubkey> When ...
3
votes
1answer
80 views

How to denote <serialized> script in P2SH transaction?

From the bitcoin developer page, the format of the scripts used in P2SH transactions are as follows: Pubkey script: OP_HASH160 <Hash160(redeemScript)> OP_EQUAL Redeem script: <OP_2> ...
0
votes
2answers
171 views

How much binary data (bytes) could I put in a transaction and how?

I know that some people had put text, pdf and images in the blockchain. I wonder which are the limits in order to have a minimum "bytes/btc" value in regarding the blockchain as a permanent database. ...
1
vote
2answers
142 views

Multiple Addresses in one UTXO

The 'decoderawtransaction' RPC method of the Bitcoin-QT client gives a JSON object with an array of addresses in each UTXO. For example, when I run: decoderawtransaction ...
2
votes
1answer
155 views

Bitcoin payout based on real-life event

Just starting to learn bitcoin scripting. Can someone explain how to pay out based on some real-life event? I currently test from the command line with bitcoind -regtest
1
vote
3answers
120 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 ...
0
votes
1answer
47 views

Why does the script contain the hash of the public key

The ScriptPubKey contains the hash of the public key, and this is compared to the public key in the ScriptSig. It is not possible to derive the public key from the hash (address). But when the output ...
2
votes
1answer
35 views

What are the requirements for a ScriptPubKey to be valid?

Can they have arbitrary scripts, as long as they are under a certain length?
13
votes
2answers
326 views

History behind the scripting language in Bitcoin?

What is the history of the current existing scripting language in Bitcoin? Satoshi's original whitepaper on Bitcoin makes no mention of a stack based scripting language. So who was the first person ...