<p>It might help understand from <strong>where</strong> do these inputs of the functions come from:</p>
<ul>
<li><p>the <code>Redeemer</code> is a piece of data constructed at the moment the user wants to interact with e smart contract, this piece of data is only available for the running transaction and is often used to allow the same smart contract to execute different logic based on the requested action of the user</p>
</li>
<li><p>the <code>ScriptContext</code> is passed by the node that is running the script, it passes transaction-related pieces of information such as who is giving the inputs and where those inputs are going (outputs), along with other transaction information such as the time the transaction is being executed</p>
</li>
<li><p>the <code>Datum</code> is what allows for the Turing completeness in the (e)UTxO model.
It is attached to an UtxO belonging to the smart contract, in particular, the <code>Datum</code> is often used to encode the state of the script and it can be useful to store variables that can change.
More in general the <code>Datum</code> allows the script to have some memory of the past of the script, and this is the reason the <code>Datum</code> makes Cardano smart contracts Turing complete</p>
</li>
</ul>

CC BY-SA 4.0
2022-06-26T12:10:31.520Z
2022-06-26T12:10:31.520Z
Michele Nuzzi
<p>One way to think of it is that:</p>
<ul>
<li>The <code>Datum</code> is a piece of data that's attached to the UTXO by the producer,</li>
<li>The <code>Redeemer</code> is a piece of data that's provided by the consumer,</li>
<li>When the UTXO is consumed, the script is run with both the <code>Datum</code> and the <code>Redeemer</code> as arguments and it can thus verify its spent in the right context.</li>
</ul>
<p>The <code>Datum</code> can be &quot;arbitrarily&quot; large subject to the Tx size limits. What's get stored in the UTXO is actually not the <code>Datum</code> itself but its hash. The spending transaction has to provide the actual <code>Datum</code>, of course matching the hashes stored in the UTXO.</p>
<p>I think your analogy is correct but I am not knowledgeable enough with Bitcoin to be sure.</p>
<p>HTH.</p>

CC BY-SA 4.0
2022-01-14T13:51:52.593Z
Thank you. Just found this thread which has lots of info : https://cardano.stackexchange.com/questions/471/what-exactly-is-a-redeemer?rq=1
wakathi
CC BY-SA 4.0
2022-01-14T11:43:21.553Z
2022-01-14T11:43:21.553Z
insitu
<p>In the (e)UTxO model, discussed in the 1st lecture of PPP#3, I am trying to understand the differences between the UTxO model of Bitcoin and the (e)UTxO model of Cardano.</p>
<p>From what I understand, the &quot;script&quot; in Cardano is similar to the locking script (ScriptPubKey) used in Bitcoin, and &quot;redeemer&quot; is similar to the unlocking script (ScriptSig). The main difference being that Cardano script is Turing Complete. Is this a correct assumption ?</p>
<p>And what is the new &quot;Datum&quot; used in Cardano and how large is it ? I assume that &quot;Datum&quot; is stored &quot;on-chain&quot;?</p>

<plutus-pioneer-program><eutxo><datum><redeemer>
Is Redeemer similar to <ScriptSig> in bitcoin context?
# Is Redeemer similar to <ScriptSig> in bitcoin context?

(Asked by: username_0 on 2022-01-14)

In the (e)UTxO model, discussed in the 1st lecture of PPP#3, I am trying to understand the differences between the UTxO model of Bitcoin and the (e)UTxO model of Cardano.

From what I understand, the "script" in Cardano is similar to the locking script (ScriptPubKey) used in Bitcoin, and "redeemer" is similar to the unlocking script (ScriptSig). The main difference being that Cardano script is Turing Complete. Is this a correct assumption ?

And what is the new "Datum" used in Cardano and how large is it ? I assume that "Datum" is stored "on-chain"?

**Tags:** plutus-pioneer-program, eutxo, datum, redeemer

---

## 2 answers

### Answer by username_2 on 2022-01-14. Score: 3

One way to think of it is that:

* The `Datum` is a piece of data that's attached to the UTXO by the producer,
* The `Redeemer` is a piece of data that's provided by the consumer,
* When the UTXO is consumed, the script is run with both the `Datum` and the `Redeemer` as arguments and it can thus verify its spent in the right context.

The `Datum` can be "arbitrarily" large subject to the Tx size limits. What's get stored in the UTXO is actually not the `Datum` itself but its hash. The spending transaction has to provide the actual `Datum`, of course matching the hashes stored in the UTXO.

I think your analogy is correct but I am not knowledgeable enough with Bitcoin to be sure.

HTH.

> **Comments:**
> **username_0**: Thank you. Just found this thread which has lots of info : https://cardano.stackexchange.com/questions/471/what-exactly-is-a-redeemer?rq=1  

---

### Answer by username_1 on 2022-06-26. Score: 0

It might help understand from **where** do these inputs of the functions come from:

* the `Redeemer` is a piece of data constructed at the moment the user wants to interact with e smart contract, this piece of data is only available for the running transaction and is often used to allow the same smart contract to execute different logic based on the requested action of the user
* the `ScriptContext` is passed by the node that is running the script, it passes transaction-related pieces of information such as who is giving the inputs and where those inputs are going (outputs), along with other transaction information such as the time the transaction is being executed
* the `Datum` is what allows for the Turing completeness in the (e)UTxO model.
  It is attached to an UtxO belonging to the smart contract, in particular, the `Datum` is often used to encode the state of the script and it can be useful to store variables that can change.
  More in general the `Datum` allows the script to have some memory of the past of the script, and this is the reason the `Datum` makes Cardano smart contracts Turing complete


---

