Can bitcoin script look at the output?

1

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.

Shahar Shamai

Posted 2018-02-05T09:56:54.930

Reputation: 11

Answers

3

No. With current script. There is a locking script, and an unlocking script. Basically the locking script (scriptPubKey) in the old transaction puts down the condition to spend BTC. The scriptSig in the spending tx must provide the data to satisfy these conditions. Problem is, that current script language does not provide an access to data „outsides“ the scripting language. So you would have to define conditions in the locking script „upfront“, while creating the tx. But then the unlock script does not allow for operators, and only accepts „push data“, like pushing the signatures or pubkey. This might change in the future, discussions are running to implement a new scripting subsystem, which is currently checked in a side chain. This will allow to access oracle data (not with „simplicity“ though), which could be a previous tx as well.

Keywords: RSK Elements, Ivy, Simplicity, Bitcoin Smart Contracts, Scriptless Scripts and possibly some more.

Short answer: currently no.

pebwindkraft

Posted 2018-02-05T09:56:54.930

Reputation: 4 568

1

No. Bitcoin script language does not have such instructions.

https://en.bitcoin.it/wiki/Script

amaclin

Posted 2018-02-05T09:56:54.930

Reputation: 5 763