w3f / PSPs

Polkadot Smart Contract Proposals
Creative Commons Zero v1.0 Universal
158 stars 68 forks source link

PSP -> PCP rename "breaks" all token standards #68

Closed h4nsu closed 1 year ago

h4nsu commented 1 year ago

The recent rename of the whole repo from Polkadot Standards Proposals to Polkadot Contracts Proposals leaves the existing token standards (PSP22, PSP34, PSP37) in a somewhat "broken" state. These documents are named and referred from "outside" as PCPxx, while inside they still use the PSPxx naming. That turns out to be quite problematic, since these token standards define the selectors of all messages based on blake2b_256 hashes of message names prefixed with a "namespace identifier" in a form of PSPxx:: for example:

transfer(to: AccountId, value: Balance, data: [u8]) ➔ Result<(), PSP22Error> Selector: 0xdb20f9f5 - first 4 bytes of blake2b_256("PSP22::transfer")

If the PSP -> PCP rename would be rigorously applied inside the token standards documents, it would change the values of all these selectors. The standards have already been in a Published state for quite some time and there are multiple contracts deployed to production that rely on them. Changing the standards now would be a serious breaking change and could result in severe disruptions in these projects.

On the other hand, leaving the selectors with their current values is also not ideal. The situation in which PCP22 standard defines all its methods based on PSP22:: prefix is very confusing and can potentially lead to many errors and lots of headache from smart contract developers.

Given all the above, I'd like to bring into consideration the suggestion to revert the problematic PSP -> PCP rename. It looks to me that it's a relatively cosmetic change which brings quite a lot of serious problems, and there doesn't seem to be any other easy and elegant solution.

Noc2 commented 1 year ago

How about we change it back to PSP, and from now on, PSP stands for "Polkadot Smart Contract Proposals (PCPs)."?

fbielejec commented 1 year ago

It seems to be a misnomer, since some of the standards aim to describe traits to be implemented in the runtime (e.g. https://github.com/w3f/PCPs/blob/master/PCPs/drafts/pcp-13.md) not just standards for ink! smart contracts.

Edited, since a reply was made before I published the comment

DamianStraszak commented 1 year ago

How about we change it back to PSP, and from now on, PSP stands for "Polkadot Smart Contract Proposals (PCPs)."?

Thanks. I think this is a reasonable way of resolving the issue.

Could you maybe shed some light on what was the original reason for the change?

Noc2 commented 1 year ago

Everything that is not related to smart contracts should be discussed as part of the fellowship: https://github.com/polkadot-fellows/RFCs that is also why the Polkadot Protocol Proposals have been archived: https://github.com/w3f/PPPs In my opinion it might even make sense to create a smart contract focused collective. It's not ideal that the web3 foundation hosts this repository in the first place.

Noc2 commented 1 year ago

It seems to be a misnomer, since some of the standards aim to describe traits to be implemented in the runtime (e.g. https://github.com/w3f/PCPs/blob/master/PCPs/drafts/pcp-13.md) not just standards for ink! smart contracts.

Edited, since a reply was made before I published the comment

I see your point. Do you have a suggestion for a name that makes the difference clear to the RFCs process? But I'm more than happy to simply change it back.

h4nsu commented 1 year ago

@Noc2 Thank you for your answer. I am not aware of the full context here, so it's hard for me to have an opinion whether Polkadot Smart Contract Proposals is a better name than Polkadot Standards Proposals. But I find it crucial that the name shortens to the PSP acronym, to avoid problems I described in the first post.

Noc2 commented 1 year ago

@h4nsu I changed it back: https://github.com/w3f/PSPs/commit/d57b53a716b0cd2a5b6f71d7ea102b60e0e77cfd and will try to kickstart a discussion around the name in the element channel. Let me know if you have any issues with the links or if something is missing, etc.

h4nsu commented 1 year ago

@Noc2 Thanks a lot! :)

Maar-io commented 1 year ago

Since ink!hub is now approved, perhaps the whole PSP repo could be moved there? We have AlephZero, Phala and Astar behind the project and it will be open for community.

image

Noc2 commented 1 year ago

In general, it's a good idea, but it would be nice if, for example, the ink! Team at parity would also be part of such a repo. I think a collective or independent ink! GitHub organization would be ideal.