PSP -> PCP rename "breaks" all token standards
h4nsu opened this issue · 10 comments
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.
How about we change it back to PSP, and from now on, PSP stands for "Polkadot Smart Contract Proposals (PCPs)."?
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
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?
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.
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.
@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.
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.