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

2
votes
0answers
16 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 ...
0
votes
1answer
22 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 ...
0
votes
1answer
29 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
69 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 ...
1
vote
1answer
31 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
81 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. ...
0
votes
2answers
59 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
71 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
22 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
129 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 ...
2
votes
1answer
103 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 ...
3
votes
1answer
33 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 ...
2
votes
1answer
38 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
52 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
94 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
94 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
0
votes
2answers
86 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
39 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
22 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?
10
votes
2answers
183 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 ...
1
vote
1answer
33 views

I cannot see the expected OP_CODE in transactions

According to different answers on this site the format of the standard TX claim script should be [OP_PUSH DER(R+S)+HashType OP_PUSH PubKey] The OP_PUSH code is 4C, 4D or 4E depending on push length. ...
4
votes
1answer
300 views

Explanation of what an OP_RETURN transaction looks like

How is OP_RETURN used and why was it introduced in the first place?
2
votes
1answer
45 views

Scripts within Scripts

I have read the following: https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki https://darkwallet.is/bip16-17 However, I would like to know, can one specify a pay-to-script hash that ...
1
vote
0answers
56 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
1answer
59 views

Arithmetic operations in Bitcoin (OP_ADD, etc)

How do arithmetic operations work in Bitcoin? If I have: 5 OP_1ADD it is obvious that I will get 6 on stack. But what if I have to make OP_1ADD on ...
2
votes
2answers
126 views

Are there examples of scripthash transactions in the blockchain that do not use MultiSig destinations?

BIP 16 uses an example of a one signature required transaction as a scripthash example: scriptSig: [signature] {[pubkey] OP_CHECKSIG} scriptPubKey: OP_HASH160 [20-byte-hash of {[pubkey] OP_CHECKSIG} ...
1
vote
1answer
29 views

Question about script

I was reading that paper http://bitcoinhistory.net/Technical_Papers/ProgrammingBitcoinTransactionScripts.pdf and I have the following question. ScriptPubKey accompanies a transaction output and ...
2
votes
1answer
51 views

What new transactions are possible with 15 operations?

Today Gavin tweeted that he's relaxing the IsStandard rules for pay-to-script-hash transactions to allow any transaction with 15 or less operations. (Full git commit here) When this is merged and ...
1
vote
3answers
71 views

How to get value of script?

I would like to count script step by step, but I have problem with it. For example, I have such transaction: { "locktime": 0, "txid": ...
2
votes
1answer
65 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 ...
1
vote
1answer
40 views

What happens when a transaction script for mining is used for fund transfer?

So, through an odd bug in hacking some stuff onto Bitcoin, I encountered a peculiar thing. Basically, I managed to generate an transaction with 2 outputs. The first output was a typical txout DUP ...
8
votes
3answers
193 views

The Bitcoin scripting system is purposefully not Turing-complete - why?

Can somebody explain to me why the Bitcoin scripting system is purposefully not Turing-complete? To make malicious programs difficult to develop (I guess)? Or because it was difficult to make it ...
2
votes
2answers
106 views

Can Bitcoin scripting be used for double spending attacks?

A standard Bitcoin transaction deposits coins into an address and then, using Bitcoin's scripting language, states that whoever wants to spend this output must be in possess of the private key ...
0
votes
2answers
62 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 ...
0
votes
2answers
76 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 ...
4
votes
1answer
78 views

Is it possible (in some way or other) to expire a txout?

I read Contracts: Will this be possible? where part of the question related to expiring a transaction and one of the replies said that it would never be possible since it causes problems. ...
1
vote
1answer
165 views

How does Multi-Signature Pay 2 Script Hash (P2SH) enable stronger security?

Coinfloor says it will pay out withdrawals using Multi-Signature Pay 2 Script Hash. What is Multi-Signature Pay 2 Script Hash? I read What is "Script Hash" address exactly and how does it ...
3
votes
1answer
61 views

Is there any way to send an output to a script which can then only be sent to one of two addresses?

Is the following scenario possible? I want to send money to a script. This script will require knowing a private key to spend, as usual, but the script is only valid if the money is being sent to one ...
0
votes
1answer
34 views

What are some valid ways to obfuscate the scriptPubKey?

Is it possible to hide the balance of an address from standard clients who may be watching blockchain? I'm thinking about using script to modify the the key that is to be verified, but am having ...
2
votes
2answers
141 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
2answers
107 views

What if the execution time for an alt coin script exceeds the block time?

I don't know when and how often a script is executed, but it seems to me that there would be a problem if a single script (or a sum of all scripts in a block) exceeds the time it takes to be included ...
4
votes
2answers
577 views

How does ScriptPubKey know the public key of an Bitcoin address?

I am currently having a blonde moment. The ScriptPubKey provides a hashed version of the receivers public key. scriptPubKey OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG However, if I give ...
1
vote
3answers
82 views

Could the standard pay to address script be simpler? e.g. no compare of the HASH160?

What if I had a scriptPubKey of <pubKey>OP_CHECKSIG And an scriptSig of <sig> Question Would that work in the standard client? Why do we need to check the hash? The only ...
1
vote
1answer
121 views

Given that contracts can be formed in the blockchain using scripts, couldn't a contract include a mechanism for facilitating chargebacks? [duplicate]

While I understand that chargebacks, or the lack thereof are an important feature for encouraging merchants to adopt bitcoin, the reverse may be true for consumers. There is probably a balance to be ...
7
votes
3answers
185 views

Tx Malleability: Why is the Script not included in the Signed Hash?

Sipa lists sources of tx malleability here: https://gist.github.com/sipa/8907691 It is clear to me how a change in the signature itself or the signature formating leads to a different tx hash (1. ...
3
votes
1answer
105 views

Why is an invalid pubkey accepted in the blockchain?

while trying to understand the address validation process, I fell upon this block : https://blockchain.info/tx/3d29f43a3278281192943276049c15e5f0d8c7e75d4d99a4cd6693113a948f48 In the outputs, the ...
2
votes
1answer
651 views

How to fully decode a coinbase transaction?

After reading this What is the format of coinbase transaction? I was wondering about a few things. decoderawtransaction of a random Litecoin coinbase transaction: "coinbase" : ...
3
votes
2answers
122 views

Which scripts are currently considered standard and therefore actually propagated?

All I've learned about script so far is that while theoretically quite versatile (e.g. allowing multisignature transactions) most scripts are simply not propagated by the default client nodes, i.e. ...
0
votes
1answer
60 views

Tracking a specific Bitcoin to make it represent something else, which could then be traded without trust [duplicate]

Imagine if one could follow the movements of a specific Bitcoin (or fraction thereof) in the block chain. Then that would mean that I could make that specific Bitcoin represent something else, which ...
3
votes
3answers
343 views

Can Bitcoin incorporate the scripting protocols of Ethereum without a fork?

I am curious if the Bitcoin protocol can incorporate Turing complete scripting capabilities without forking the block chain. I ask this because I understand the ability to create contracts digitally ...