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-???? | Supercharged Native Scripts #479

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

nielstron
Copy link
Contributor

@nielstron nielstron commented Mar 15, 2023

Abstract

This CIP proposes replacing the current native scripts used for minting Cardano Native Tokens with simple, parameterized smart contracts called "Supercharged Native Scripts". The main goal is to allow users to burn their native assets at any time by utilizing smart contracts that enforce the minting conditions while always allowing burning. The concept is standardized and generalized for broader use-cases.

(rendered version in branch)

This is a proposed solution to #392

@KtorZ KtorZ added the Category: Tokens Proposals belonging to the 'Tokens' category. label Mar 18, 2023
CIP-0100/README.md Outdated Show resolved Hide resolved
CIP-0100/README.md Outdated Show resolved Hide resolved
CIP-0100/README.md Outdated Show resolved Hide resolved
]
```

## Rationale
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In your PR you mention that this proposal addresses the CPS at #392. It would be good to explain how it addresses the CPS, and answer the questions that the CPS poses, here in the rationale.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a few more sentences on how this addresses #392 in the rationale section :)

Co-authored-by: Ryan Williams <44342099+Ryun1@users.noreply.github.com>
@rphair rphair changed the title CIP-0100? | Supercharged Native Scripts CIP-???? | Supercharged Native Scripts Mar 20, 2023
nielstron and others added 3 commits March 20, 2023 08:52
Co-authored-by: Ryan Williams <44342099+Ryun1@users.noreply.github.com>
Co-authored-by: Ryan Williams <44342099+Ryun1@users.noreply.github.com>
@SebastienGllmt
Copy link
Collaborator

If you're trying to use Plutus to enforce extra conditions onto native scripts, I suggest that instead #309 is implemented since it requires significantly less changes to Plutus and achieves the same result.

Notably, it would allow you to write a native script that looks like

{
	"type": "any",
	"scripts": [{
		"type": "all",
		"scripts": [{
				"type": "before",
				"slot": 40272443
			},
			{
				"type": "sig",
				"keyHash": "ed6f3e2144d70e839d8701f23ebcca229bcfde8e1d6b7838bda11ac8"
			}
		]
	}, {
		"type": "all",
		"scripts": [{
				"type": "after",
				"slot": 40272443
			},
			{
				"type": "script",
				"scriptHash": "plutus_script_hash_here"
			}
		]
	}]
}

@nielstron
Copy link
Contributor Author

nielstron commented Mar 22, 2023

@SebastienGllmt Thanks for pointer. My suggestion differs from #309 in the point that no changes to the ledger nor Plutus are required at all.

The proposal instead suggests a template of plutus scripts that can be programmed using native scripts for users that don't know plutus or don't want to learn it.

The only thing that needs to be changed is the default tutorial on getting started with native tokens :)

@rphair
Copy link
Collaborator

rphair commented Apr 4, 2023

@michaelpj we're talking about this at the CIP meeting now and it's come up that you would be welcome to review this proposal 🙏 (including the question of whether or not to use Plutus)

Copy link
Contributor

@michaelpj michaelpj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm quite confused by this proposal.

  1. Plutus scripts can already be used as minting policies, which covers all the expressiveness in this proposal.
  2. The proposal itself is quite complex, and feels ad-hoc to me.
  3. There are a number of simpler alternatives, some of which are mentioned in CPS-???? | Properly burning NFTs / tokens #392


The ADA could be unlocked by removing the tokens from the ledger altogether by burning them.
One option to achieve this is to make all native tokens burnable by their owners.
This leads to a number of necessary changes in the ledger and also violates security guarantees for early adopters of native tokens - generally this proposal suggests to go a different route.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a small number of changes in the ledger. What security guarantees does it violate? (I also used to think this but have now been convinced it's actually fine)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that changing the ledger might be fine after all. Downside: need to change the ledger. Upside: No need for opt-in and retroactive.

This leads to a number of necessary changes in the ledger and also violates security guarantees for early adopters of native tokens - generally this proposal suggests to go a different route.


The proposed solution will not force all tokens to be burnable, allowing creators to opt-in for burnable tokens when desired.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They can already do this today, though? There's nothing that stops you writing your minting policy to say "burning is always allowed".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it's not clear that opt-in is good enough. That means it's still easy for people not to opt-in (it doesn't benefit them much, and they have to do something additional, so why would they?), meaning that people will still be stuck with significant amounts of junk.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not expressable in Native Scripts and Plutus is so complicated that it can not be expected the average token minter is able to set up/compile a contract on their own. The opt-in thing is a problem, agree.

The proposed solution will not force all tokens to be burnable, allowing creators to opt-in for burnable tokens when desired.
We suggest that token creators are given the freedom to use the intuitive native token interface known so far and
simple tooling to supercharge it with the available Plutus completeness.
In order to make sure that most users can benefit from this, the proposal suggests that the future *default* for token creation is choosing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean to make something the "default"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically replacing every tutorial that says "use this native script to mint your token" with "use this other script to mint your token". Not sure how to better express this.


## Motivation

The current process for minting and burning Cardano Native Tokens relies on native scripts, which do not provide a simple mechanism for users to burn their tokens and reclaim the minUTxO (ADA) locked by those tokens. As a result, users may end up with many unwanted tokens or NFTs, locking a considerable amount of ADA.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current process for minting and burning Cardano Native Tokens relies on native scripts

No it doesn't? You can use a Plutus script if you want more complex logic.

In order to make sure that most users can benefit from this, the proposal suggests that the future *default* for token creation is choosing
a specific type of supercharged native scripts.

By replacing native scripts with smart contracts for minting and burning tokens, users will have a simple and standardized way to manage their assets and recover locked ADA.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can already just use a Plutus script for this, so I'm confused about what this adds.

@nielstron
Copy link
Contributor Author

nielstron commented Apr 18, 2023

@michaelpj The delta of this proposal is not to propose something that was not possible before, but to propose a standard that is tangible for the average user. While yes, all of this can of course be done in Plutus 1) we can not expect everyone to learn haskell for minting tokens 2) even a seasoned computer scientist will waste more than 5h of their life trying to compile a Plutus contract they found on the internet (not sure how much exaggerated this is). Parameterization is the remedy here.

Specifically, this proposes a set of basic smart contracts that can be parameterized by the average user and are hence as simple to handle as native scripts, yet much more expressive.

The specific use case here is an opt-in, no-ledger-change approach to making advanced tokenomics (simplest case: always allow burn tokens) accessible to average creators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Tokens Proposals belonging to the 'Tokens' category.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants