user1108: So I am currently on lecture 1 on the Plutus Pioneer Program. In the lecture they said the redeemer is the input information that the script uses to decide if a specific UTxO can be spent. I watched a video that was made two years ago that said the redeemer is used to decide if a wallet can receive Ada from a smart contract. The person in that video did say that these things might change because things are still under development. Can someone clear this up for me? What exactly is a redeemer as of right now? What is a redeemer's role in sending transaction and in smart contracts?

user2042: There is an interesting example in one of the Pioneer lectures which implements Uniswap on Cardano.
A redeemer is not only used to justify that a UTxO can be spent, but also the manner in which it will be spent. The validation script will then place the necessary constraints on the creation of the transaciton based on who is trying to spend it and how they are trying to spend it.
In the screenshot attached from lecture 10 of the first iteration of the Plutus Pioneer Program, the blue lines represent the redeemer as an input to the UTxO's validation script (represented by the blue and red circles) which, in this case, is validating the consumption of  a UTxO which represents a liquidity pool.
You can see four different labels on four of the blue lines - Create, Swap, Add and Remove. These represent different constructors for the redeemer data type being used and tell the script what action the user is trying to take.
For further details of exactly what each redeemer does, you can read more and find a link to the video here.


user1229: Before (E)UTxO - There Was UTxO
Understanding how a UTxO model works (such as BTC) may help you understand the implementation of (E)UTxO in Cardano.
The UTxO Model
A UTxO model, meaning: unspent transaction outputs from previous transactions1 will typically implement a validator and a redeemer for any given new transaction (at least, this is the case in BTC).
Validators and Redeemers
The validators job is to return a boolean value as to whether the UTxO can be spent or not. In BTC the validator is implemented in BitCoin Script and is about as simple as it could be. It does, however, take a redeemer (which in the case of BTC is a representation of transactional digital signatures); and the validator uses the redeemer to either allow the UTxO to be spent or not.
Cardano | The (E)UTxO Model
Within Cardano we use scripts to evaluate whether or not a given (E)UTxO may or may not be spent. An address in Cardano points to a script - the script contains arbitrary logic and takes a redeemer as its input/parameter(s) - which are now also more general in nature, as they need to satisfy the constraints provided by the arbitrary logic within the script.
By triggering the script (attempting to create a new transaction), the redeemer will be passed to the script, the script will be executed and will determine whether or not the (E)UTxO can be spent or not.
Summary
A redeemer is used as input to an (E)UTxO script in order to determine whether or not the extended unspent transaction output may or may not be consumed, given the arbitrary logic provided within the script.
FYI: Cardano addresses point to scripts, the script may be simple or extremely complex.
I found this video by Michael Peyton Jones to be pretty informative and perhaps a little more intuitive than the first lecture presented within the Plutus Pioneer Program:
https://youtu.be/usMPt8KpBeI
However, it may be a little outdated? I'm still working my way through the second cohort.

Footnotes:

Think of an unspent transaction as the change you're given in a shop when you hand a $20 bill for a $5 item, the $15 change is YOUR UTxO and is secured using public-private key cryptography.


user609: In simple terms, redeemer is the data that the user of the smart contract provides to the smart contract.
In the simple UTxO model, redeemer is your signature. By providing your signature, you prove that you own the UTxO and in return you are allowed to spend that UTxO.
EUTxO takes this one step further. How are you going to spend an EUTxO? You have to provide all the data that EUTxO needs and depending on the data you provide, you are allowed to spend it or not.

user934: From https://iohk.io/en/blog/posts/2021/04/13/plutus-what-you-need-to-know/:

When validating an address, the script will access the data being
carried by the output, the transaction being validated, and some
additional pieces of data called redeemers, which the transaction
provides for every input. By looking up all this information, the
script has enough context to give a ‘yes’ or ‘no’ answer in what can
be highly complex situations and use cases.

In lecture 1 of the current plutus pioneers program, you find a redeemer on the auction validation script. When making a bid, there are essentially five cases to check. All these five cases need to pass or the transaction will not be even committed to the blockchain (which is good, because you're saving on fees for something that won't succeed anyway):

Is the bid sufficient (the bid is >= the minimum valid bid)
The auction hasn't closed

The three other cases also do data checks (output datum/value, bid refund).
The redeemer (in the auction example) itself is a simple data type that we can define (AuctionAction) to do data validation (particularly on inputs).

1108: <p>So I am currently on lecture 1 on the Plutus Pioneer Program. In the lecture they said the redeemer is the input information that the script uses to decide if a specific UTxO can be spent. I watched a video that was made two years ago that said the redeemer is used to decide if a wallet can receive Ada from a smart contract. The person in that video did say that these things might change because things are still under development. Can someone clear this up for me? What exactly is a redeemer as of right now? What is a redeemer's role in sending transaction and in smart contracts?</p>
 2042: <p>There is an interesting example in one of the Pioneer lectures which implements Uniswap on Cardano.</p>
<p>A redeemer is not only used to justify that a UTxO can be spent, but also the manner in which it will be spent. The validation script will then place the necessary constraints on the creation of the transaciton based on who is trying to spend it and how they are trying to spend it.</p>
<p>In the screenshot attached from lecture 10 of the first iteration of the Plutus Pioneer Program, the blue lines represent the redeemer as an input to the UTxO's validation script (represented by the blue and red circles) which, in this case, is validating the consumption of  a UTxO which represents a liquidity pool.</p>
<p>You can see four different labels on four of the blue lines - Create, Swap, Add and Remove. These represent different constructors for the redeemer data type being used and tell the script what action the user is trying to take.</p>
<p>For further details of exactly what each redeemer does, you can read more and find a link to the video <a href="https://plutus-pioneer-program.readthedocs.io/en/latest/week10.html" rel="nofollow noreferrer">here</a>.</p>
<p><a href="https://i.stack.imgur.com/uGnsf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uGnsf.jpg" alt="Uniswap on Cardano Example" /></a></p>
 1229: <p><strong>Before (E)UTxO - There Was UTxO</strong></p>
<p><em>Understanding how a UTxO model works (such as BTC) may help you understand the implementation of (E)UTxO in Cardano.</em></p>
<p><strong>The UTxO Model</strong></p>
<p>A UTxO model, meaning: unspent transaction outputs from previous transactions<sup>1</sup> will typically implement a validator and a redeemer for any given new transaction (at least, this is the case in BTC).</p>
<p><strong>Validators and Redeemers</strong></p>
<p>The validators job is to return a boolean value as to whether the UTxO can be spent or not. In BTC the validator is implemented in BitCoin Script and is about as simple as it could be. It does, however, take a redeemer (which in the case of BTC is a representation of transactional digital signatures); and the validator uses the redeemer to either allow the UTxO to be spent or not.</p>
<p><strong>Cardano | The (E)UTxO Model</strong></p>
<p>Within Cardano we use scripts to evaluate whether or not a given (E)UTxO may or may not be spent. An address in Cardano points to a script - the script contains arbitrary logic and takes a redeemer as its input/parameter(s) - which are now also more general in nature, as they need to satisfy the constraints provided by the arbitrary logic within the script.</p>
<p>By triggering the script (attempting to create a new transaction), the redeemer will be passed to the script, the script will be executed and will determine whether or not the (E)UTxO can be spent or not.</p>
<p><strong>Summary</strong></p>
<p>A redeemer is used as input to an (E)UTxO script in order to determine whether or not the extended unspent transaction output may or may not be consumed, given the arbitrary logic provided within the script.</p>
<p><em>FYI: Cardano addresses point to scripts, the script may be simple or extremely complex.</em></p>
<p>I found this video by Michael Peyton Jones to be pretty informative and perhaps a little more intuitive than the first lecture presented within the Plutus Pioneer Program:</p>
<p><a href="https://youtu.be/usMPt8KpBeI" rel="noreferrer">https://youtu.be/usMPt8KpBeI</a></p>
<p><em>However, it may be a little outdated? I'm still working my way through the second cohort.</em></p>
<hr />
<p><strong>Footnotes:</strong></p>
<ol>
<li>Think of an unspent transaction as the change you're given in a shop when you hand a $20 bill for a $5 item, the $15 change is <strong>YOUR</strong> UTxO and is secured using public-private key cryptography.</li>
</ol>
 609: <p>In simple terms, redeemer is the data that the user of the smart contract provides to the smart contract.</p>
<p>In the simple UTxO model, redeemer is your signature. By providing your signature, you prove that you own the UTxO and in return you are allowed to spend that UTxO.</p>
<p>EUTxO takes this one step further. How are you going to spend an EUTxO? You have to provide all the data that EUTxO needs and depending on the data you provide, you are allowed to spend it or not.</p>
 934: <p>From <a href="https://iohk.io/en/blog/posts/2021/04/13/plutus-what-you-need-to-know/" rel="noreferrer">https://iohk.io/en/blog/posts/2021/04/13/plutus-what-you-need-to-know/</a>:</p>
<blockquote>
<p>When validating an address, the script will access the data being
carried by the output, the transaction being validated, and some
additional pieces of data called <strong>redeemers</strong>, which the transaction
provides for every input. By looking up all this information, the
script has enough context to give a ‘yes’ or ‘no’ answer in what can
be highly complex situations and use cases.</p>
</blockquote>
<p>In lecture 1 of the current plutus pioneers program, you find a <a href="https://github.com/input-output-hk/plutus-pioneer-program/blob/main/code/week01/src/Week01/EnglishAuction.hs#L77" rel="noreferrer">redeemer</a> on the <a href="https://github.com/input-output-hk/plutus-pioneer-program/blob/main/code/week01/src/Week01/EnglishAuction.hs#L103" rel="noreferrer">auction validation script</a>. When making a bid, there are essentially five cases to check. All these five cases need to pass or the transaction will not be even committed to the blockchain (which is good, because you're saving on fees for something that won't succeed anyway):</p>
<ol>
<li>Is the bid sufficient (the bid is &gt;= the minimum valid bid)</li>
<li>The auction hasn't closed</li>
</ol>
<p>The three other cases also do data checks (output datum/value, bid refund).</p>
<p>The redeemer (in the auction example) itself is a simple data type that we can define (AuctionAction) to do data validation (particularly on inputs).</p>
