From a25ae57a1da25db4cc4f23fa38a515986dc02a1e Mon Sep 17 00:00:00 2001 From: danieljperry Date: Thu, 19 Dec 2024 13:13:54 -0600 Subject: [PATCH 1/7] .\CHIPs\chip-everything_with_singleton.md --- CHIPs/chip-everything_with_singleton.md | 83 +++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 CHIPs/chip-everything_with_singleton.md diff --git a/CHIPs/chip-everything_with_singleton.md b/CHIPs/chip-everything_with_singleton.md new file mode 100644 index 00000000..151d9e19 --- /dev/null +++ b/CHIPs/chip-everything_with_singleton.md @@ -0,0 +1,83 @@ +CHIP Number | --- +:-------------|:---- +Title | everything_with_singleton TAIL +Description | A new CAT TAIL to authorize mints and melts from a singleton +Author | [Andreas Greimel](https://github.com/greimela) +Editor | [Dan Perry](https://github.com/danieljperry) +Comments-URI | --- +Status | --- +Category | Informational +Sub-Category | Chialisp Puzzle +Created | 2024-12-19 +Requires | [CAT2](https://chialisp.com/cats/), [Singletons](https://chialisp.com/singletons/) + +## Abstract + +Tokens that follow the CAT2 standard require the use of a Token and Asset Issuance Limitations ([TAIL](https://chialisp.com/cats/#tail)) program, which dictates the rules for when a CAT may be minted or melted. The CAT2 standard was originally released with two [multi-issuance TAILS](https://chialisp.com/cats/#multi). One of these TAILs was [everything_with_signature](https://github.com/Chia-Network/chia-blockchain/blob/fad414132e6950e79e805629427af76bf9ddcbc5/chia/wallet/puzzles/everything_with_signature.clvm), which allowed both minting and melting, as long as the issuing key signed the transaction. This CHIP introduces a new TAIL to allow minting and melting if the issuing _singleton_ signed the transaction. + +## Motivation + +[CHIP-38](https://github.com/Chia-Network/chips/pull/136) (Revocable CATs) proposes a standard for a new type of CAT that the issuing entity can revoke. Initially, it will be implemented with the `everything_with_singleton` TAIL from this CHIP. However, Revokable CATs do not require `everything_with_singleton` (other TAILs are allowed), and this TAIL can be used with other Chia assets, such as those which use the CAT2 standard. For these reasons, the `everything_with_singleton` TAIL warrants its own CHIP. + +## Backwards Compatibility + +This proposal is for a new Chialisp puzzle. It does not replace any existing standards, nor does it modify Chia's consensus. This CHIP therefore does not introduce any breaking changes to Chia. + +## Rationale + +The existing TAILs were inadequate for the Revocable CAT standard. This is because we want to be able to mint or melt Revocable CATs from a vault, rather than a standard BLS key. We therefore created a new type of TAIL to suit our needs. It is worth noting that melting any CAT requires ownership of the tokens to be melted. It is not possible to use this TAIL to melt tokens directly from a vault other than the issuing vault. + +## Specification + +The `everything_with_singleton` puzzle allows any type of singleton (including a vault) to authorize CAT mints and melts by sending a message. + +A nonce is curried in to allow a single vault to issue multiple different CATs. + +### Puzzle structure + +``` +; This is a "limitations_program" for use with cat.clsp. +; It allows a singleton to both mint and melt this CAT. +(mod ( + SINGLETON_MOD_HASH + SINGLETON_STRUCT_HASH + NONCE + Truths + parent_is_cat + lineage_proof + delta + inner_conditions + ( ; solution + singleton_inner_puzzle_hash + ) + ) + + (include condition_codes.clib) + (include curry.clib) + + (defun-inline calculate_full_puzzle_hash (SINGLETON_MOD_HASH SINGLETON_STRUCT_HASH inner_puzzle_hash) + (curry_hashes_inline SINGLETON_MOD_HASH + SINGLETON_STRUCT_HASH + inner_puzzle_hash + ) + ) + + (list + (list RECEIVE_MESSAGE 23 delta (calculate_full_puzzle_hash SINGLETON_MOD_HASH SINGLETON_STRUCT_HASH singleton_inner_puzzle_hash)) + ) +) +``` + +## Reference Implementation + +[p2_delegated_by_singleton.clsp](https://github.com/greimela/chia-blockchain/blob/b29d87fcbecf817bb0eda9c4bd8e823facf5a359/chia/wallet/revocable_cats/p2_delegated_by_singleton.clsp) + +## Security + +Chia Network, Inc. has conducted an internal review of the code involved with this CHIP. + +## Additional Assets +None + +## Copyright +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From a84cd6b07529adb44529bbe748d01f566791cdb5 Mon Sep 17 00:00:00 2001 From: danieljperry Date: Thu, 19 Dec 2024 13:17:38 -0600 Subject: [PATCH 2/7] Assign CHIP-40 --- CHIPs/{chip-everything_with_singleton.md => chip-0040.md} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename CHIPs/{chip-everything_with_singleton.md => chip-0040.md} (97%) diff --git a/CHIPs/chip-everything_with_singleton.md b/CHIPs/chip-0040.md similarity index 97% rename from CHIPs/chip-everything_with_singleton.md rename to CHIPs/chip-0040.md index 151d9e19..97220024 100644 --- a/CHIPs/chip-everything_with_singleton.md +++ b/CHIPs/chip-0040.md @@ -1,11 +1,11 @@ -CHIP Number | --- +CHIP Number | 0040 :-------------|:---- Title | everything_with_singleton TAIL Description | A new CAT TAIL to authorize mints and melts from a singleton Author | [Andreas Greimel](https://github.com/greimela) Editor | [Dan Perry](https://github.com/danieljperry) Comments-URI | --- -Status | --- +Status | [CHIPs repo, PR #139](https://github.com/Chia-Network/chips/pull/139) Category | Informational Sub-Category | Chialisp Puzzle Created | 2024-12-19 From c39b91ffab54f3fcb46c38cbe0279918650d31a7 Mon Sep 17 00:00:00 2001 From: danieljperry Date: Wed, 15 Jan 2025 19:27:29 +0800 Subject: [PATCH 3/7] Update reference implementation link --- CHIPs/chip-0040.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHIPs/chip-0040.md b/CHIPs/chip-0040.md index 97220024..c30b1a9f 100644 --- a/CHIPs/chip-0040.md +++ b/CHIPs/chip-0040.md @@ -70,7 +70,7 @@ A nonce is curried in to allow a single vault to issue multiple different CATs. ## Reference Implementation -[p2_delegated_by_singleton.clsp](https://github.com/greimela/chia-blockchain/blob/b29d87fcbecf817bb0eda9c4bd8e823facf5a359/chia/wallet/revocable_cats/p2_delegated_by_singleton.clsp) +[everything_with_singleton.clsp](https://github.com/greimela/chia-blockchain/blob/b29d87fcbecf817bb0eda9c4bd8e823facf5a359/chia/wallet/revocable_cats/everything_with_singleton.clsp) ## Security From dfbc3b220c7c470d15cfa8ad225ddeefeeb7b9bb Mon Sep 17 00:00:00 2001 From: danieljperry Date: Wed, 15 Jan 2025 20:38:53 +0800 Subject: [PATCH 4/7] Move CHIP-40 to Review status --- CHIPs/chip-0040.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHIPs/chip-0040.md b/CHIPs/chip-0040.md index c30b1a9f..e48950d3 100644 --- a/CHIPs/chip-0040.md +++ b/CHIPs/chip-0040.md @@ -4,8 +4,8 @@ Title | everything_with_singleton TAIL Description | A new CAT TAIL to authorize mints and melts from a singleton Author | [Andreas Greimel](https://github.com/greimela) Editor | [Dan Perry](https://github.com/danieljperry) -Comments-URI | --- -Status | [CHIPs repo, PR #139](https://github.com/Chia-Network/chips/pull/139) +Comments-URI | [CHIPs repo, PR #139](https://github.com/Chia-Network/chips/pull/139) +Status | Review Category | Informational Sub-Category | Chialisp Puzzle Created | 2024-12-19 From e6737207b9665c29e8d89e835e91442ec2e72848 Mon Sep 17 00:00:00 2001 From: danieljperry Date: Wed, 30 Jul 2025 14:42:30 +0200 Subject: [PATCH 5/7] Update links --- CHIPs/chip-0040.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHIPs/chip-0040.md b/CHIPs/chip-0040.md index e48950d3..7ecb5cc4 100644 --- a/CHIPs/chip-0040.md +++ b/CHIPs/chip-0040.md @@ -13,7 +13,7 @@ Requires | [CAT2](https://chialisp.com/cats/), [Singletons](https://chialis ## Abstract -Tokens that follow the CAT2 standard require the use of a Token and Asset Issuance Limitations ([TAIL](https://chialisp.com/cats/#tail)) program, which dictates the rules for when a CAT may be minted or melted. The CAT2 standard was originally released with two [multi-issuance TAILS](https://chialisp.com/cats/#multi). One of these TAILs was [everything_with_signature](https://github.com/Chia-Network/chia-blockchain/blob/fad414132e6950e79e805629427af76bf9ddcbc5/chia/wallet/puzzles/everything_with_signature.clvm), which allowed both minting and melting, as long as the issuing key signed the transaction. This CHIP introduces a new TAIL to allow minting and melting if the issuing _singleton_ signed the transaction. +Tokens that follow the CAT2 standard require the use of a Token and Asset Issuance Limitations ([TAIL](https://chialisp.com/cats/#tail)) program, which dictates the rules for when a CAT may be minted or melted. The CAT2 standard was originally released with two [multi-issuance TAILS](https://chialisp.com/cats/#multi). One of these TAILs was [everything_with_signature](https://github.com/Chia-Network/chia_puzzles/blob/b90dcd6c48e748c9c3e83c9133022c7599eebb50/puzzles/cat_puzzles/everything_with_signature.clsp), which allowed both minting and melting, as long as the issuing key signed the transaction. This CHIP introduces a new TAIL to allow minting and melting if the issuing _singleton_ signed the transaction. ## Motivation @@ -70,7 +70,7 @@ A nonce is curried in to allow a single vault to issue multiple different CATs. ## Reference Implementation -[everything_with_singleton.clsp](https://github.com/greimela/chia-blockchain/blob/b29d87fcbecf817bb0eda9c4bd8e823facf5a359/chia/wallet/revocable_cats/everything_with_singleton.clsp) +[everything_with_singleton.clsp](https://github.com/Chia-Network/chia_puzzles/blob/b90dcd6c48e748c9c3e83c9133022c7599eebb50/puzzles/cat_puzzles/everything_with_singleton.clsp) ## Security From 54d9d7a111e17f043f7c43b5e2d878def9d32b7f Mon Sep 17 00:00:00 2001 From: danieljperry Date: Wed, 30 Jul 2025 21:08:30 +0200 Subject: [PATCH 6/7] Move CHIP-40 to Last Call --- CHIPs/chip-0040.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHIPs/chip-0040.md b/CHIPs/chip-0040.md index 7ecb5cc4..99e88229 100644 --- a/CHIPs/chip-0040.md +++ b/CHIPs/chip-0040.md @@ -5,7 +5,7 @@ Description | A new CAT TAIL to authorize mints and melts from a singleton Author | [Andreas Greimel](https://github.com/greimela) Editor | [Dan Perry](https://github.com/danieljperry) Comments-URI | [CHIPs repo, PR #139](https://github.com/Chia-Network/chips/pull/139) -Status | Review +Status | Last Call Category | Informational Sub-Category | Chialisp Puzzle Created | 2024-12-19 From ad38699f54bcdcdf87b4df10b7ba89bdecfef710 Mon Sep 17 00:00:00 2001 From: danieljperry Date: Thu, 14 Aug 2025 10:57:18 +0800 Subject: [PATCH 7/7] Move CHIP-40 to Final status --- CHIPs/chip-0040.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHIPs/chip-0040.md b/CHIPs/chip-0040.md index 99e88229..4ad11654 100644 --- a/CHIPs/chip-0040.md +++ b/CHIPs/chip-0040.md @@ -5,7 +5,7 @@ Description | A new CAT TAIL to authorize mints and melts from a singleton Author | [Andreas Greimel](https://github.com/greimela) Editor | [Dan Perry](https://github.com/danieljperry) Comments-URI | [CHIPs repo, PR #139](https://github.com/Chia-Network/chips/pull/139) -Status | Last Call +Status | Final Category | Informational Sub-Category | Chialisp Puzzle Created | 2024-12-19