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

CIP-????: Script may want to refuse to accept wrong assets: Acceptor scripts #472

Open
mgajda opened this issue Mar 6, 2023 · 4 comments

Comments

@mgajda
Copy link

mgajda commented Mar 6, 2023

Now smart contracts rely mostly on minting and redemption of previously setup transactions.
This means that we may send assets to a smart contract, and they may be lost forever.

Ideal situation would be if smart contract could accept or reject such transactions.
That means sending Ada to a smart contract would be a bit more expensive, since it would invoke
"Acceptor" script, but would also be much safer, since user would know that script
author expected to correctly handle the asset.

For example Uniswap trading pair script would only accept tokens from this trading pair.
It would also mean that assets would not be accidentally burned by sending them to the wrong smart contract.

@mgajda mgajda changed the title Script may want to reject some transactions: Acceptor scripts CIP-????: Script may want to reject some transactions: Acceptor scripts Mar 6, 2023
@mgajda mgajda changed the title CIP-????: Script may want to reject some transactions: Acceptor scripts CIP-????: Script may want to refuse to accept wrong assets: Acceptor scripts Mar 6, 2023
@mgajda
Copy link
Author

mgajda commented Mar 6, 2023

Alternative would be to forbid transactions without Datum.

@matiwinnetou
Copy link
Contributor

At first sight, I like Acceptor idea albeit I think that even transactions with Datum do not protect us. Acceptor is an interesting concept to explore.

@matiwinnetou
Copy link
Contributor

isn't a bit like Contigent Transactions idea, where a transaction (e.g. multi sig) is accepted only if certain conditions are true (whatever is programmed)?

@rphair
Copy link
Collaborator

rphair commented Mar 6, 2023

@mgajda

  • Doesn't this indicate a CPS (rather than a CIP) due to the multiple ways this problem might be solved & implying an initially very broad definition of these Acceptor scripts?
  • I assume the purpose of this issue is to propose & develop content for such a CIP/CPS (i.e. community discussion while you're drafting it)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants