<p>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. </p>

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

<p>Short answer: currently no.</p>

CC BY-SA 3.0
2018-02-05T11:04:47.320Z
2018-02-05T11:04:47.320Z
pebwindkraft
<p>No. Bitcoin script language does not have such instructions.</p>

<p><a href="https://en.bitcoin.it/wiki/Script" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Script</a></p>

CC BY-SA 3.0
2018-02-05T10:21:34.853Z
2018-02-05T10:21:34.853Z
amaclin
<p>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.</p>

<script><bitcoin-core-development>
Can bitcoin script look at the output?
Shahar Shamai
# Can bitcoin script look at the output?

(Asked by: username_0 on 2018-02-05)

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.

**Tags:** script, bitcoin-core-development


---

## 2 answers

### Answer by username_1 on 2018-02-05. Score: 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.


---

### Answer by username_2 on 2018-02-05. Score: 1

No. Bitcoin script language does not have such instructions.

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


---

