Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] - Additional check when sending funds to script without datum #3069

Closed
zandeck opened this issue Aug 12, 2021 · 5 comments
Closed

[FR] - Additional check when sending funds to script without datum #3069

zandeck opened this issue Aug 12, 2021 · 5 comments
Labels
alonzo-purple Relates to the Alonzo Purple Testnet enhancement New feature or request

Comments

@zandeck
Copy link

zandeck commented Aug 12, 2021

Internal/External
External otherwise.

Area
Plutus Related to Plutus Scripts (Alonzo).

Describe the feature you'd like

It is currently possible to submit a transaction to a script without a datum

cardano-cli transaction build-raw \
--alonzo-era \
--tx-in 7fec18529cec3654dd2fb62238fea5c8feb7b9a77f4f6ab8bcab06b3f7eca8e3#0 \
--tx-out $(cat ./contracts/script.addr)+8888880 \
--tx-out $(cat keys/payment2.addr)+23460388896 \
--fee 1000000 \
--protocol-params-file pparams.json \
--out-file tx.raw

Once this is done, there is no way afterwards to retrieve the UTxO on sitting on the contract.

And we endup having UTxO piling up on this address:

cardano-cli query utxo --testnet-magic 8 --address $(cat contracts/script.addr)
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
32eb8b686f7f62488c540e35ab94f7e11548f71c6e2af1291f623122131ceac4     1        989999000000 lovelace + TxOutDatumHashNone
4338cb66573353c368a716ed35c46d7f19d0474a156979d88b0678085e138282     0        99811570 lovelace + TxOutDatumHashNone
435eb9c07520bf0aa93d0ff69083b1d4e4ab72884c494f99eed0a3ae7bdc883c     0        49813066 lovelace + TxOutDatumHashNone
481a01c36c6f2dcb0f031e1e6d1a255a8773138f7fae11596a7ff53f1f5c5c54     0        8888880 lovelace + TxOutDatumHashNone
5925dc51db2fe7d168db02dc9e9fff61c4eb93e65dadaa22592aa0902ae1c998     0        999813154 lovelace + TxOutDatumHashNone
5c941072dac8c9a011b31aeebc00ed8416b3f782f0fb1978e347136b7511f065     1        40000000 lovelace + TxOutDatumHash ScriptDataInAlonzoEra "269499980312e03ec5c82239ca527534a15c0da27f026f15dc706e7d0cd6770a"
6bafbd83b11f0d70a980c8cbaa1422ffd943db9262841600e242a0ef4bfdf312     0        1645849 lovelace + TxOutDatumHashNone
98cf51f0e7cf191e9accc3825cfb92b355f7fa7662d4adfef71eb809e4a70161     1        998999000000 lovelace + TxOutDatumHashNone
a2a2b20eccac7fb5e4a0172564d0b2243ac56e1bc3652ed155610ee63802a045     1        3456789 lovelace + TxOutDatumHashNone

Describe alternatives you've considered

I was thinking of adding additional checks in the cli to prevent/ask confirmation if a transaction is being sent to a script without a datum. I don't really see though how the check can be done purely on the CLI side without communicating with the node first to check the address the funds are being sent is a script.

Additional context / screenshots

@zandeck zandeck added the enhancement New feature or request label Aug 12, 2021
@dorin100 dorin100 added the alonzo-purple Relates to the Alonzo Purple Testnet label Aug 12, 2021
@Titan-C
Copy link

Titan-C commented Aug 15, 2021

Or conversely. If datum is empty, or unit, because it might be a completely stateless script. Don't require on the redeeming transaction to supply an UTXO.

@waalge
Copy link

waalge commented Sep 15, 2021

I've just run into this.
Does anyone know if/why its wrong/bad/suboptimal to have an empty datum for a UTXO at script address?
I just tried in vain to use the cli to retrieve one such utxo.

@Zagita21
Copy link

Zagita21 commented Sep 16, 2021

@waalge the way it currently works, whoever wants to spend a UTxO sitting at a script address must supply the datum (as well as the script). So if you send value without a datum, it is effectively burned because there is no datum anybody can supply that will validate. I think the OP is complaining that it is too easy to do this by accident on cli, with no obvious upside.

@waalge
Copy link

waalge commented Sep 17, 2021

@Zagita21 so I've now gathered. I've yet to think of a reason why this would be desirable - to allow optional datums (fair) but that are then unspendable (huh?!).

@Jimbo4350
Copy link
Contributor

Closing this. If this is still relevant please reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alonzo-purple Relates to the Alonzo Purple Testnet enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants