-
Notifications
You must be signed in to change notification settings - Fork 68
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
Standard Interface Detection PSP #64
base: master
Are you sure you want to change the base?
Conversation
Thanks for preparing the proposal. I would love to see some example for which PSP61 is useful to have and has benefits over not having it. What we need to keep in mind is that a malicious contract can implement PSP61 and return whatever it wants for |
Hey @DamianStraszak! It is useful in case of cross-contract interactions. For example, there is some amount of contracts, and one should call another, but there exists some predefined behaviour if called contract implements some trait, for example in terms of security to call something like |
Yes, so what's the point of implementing the interface if you anyway can't trust the results you get from it. That's why I'm looking for a concrete example... |
I would like to copy here a point from our audit of OpenBrush, where the abscense of such standard was mentioned as an issue. Some advantages of having standardized interface detection are:
|
These are all generic and very vague, and most are not valid in the presence of malicious contracts. I would even make a stronger point: I think it's dangerous to have contracts implement such interfaces. That's because developers don't understand that a particular response from a contract they get using such an interface cannot be trusted, and that's where they can make mistakes. Also implementing such interfaces makes everything more expensive gas-wise. |
Summary
A standard for a standard interface detection for WebAssembly smart contracts which run on Substrate's
contracts
pallet.This proposal aims to define the interface detection standard for WebAssembly smart contracts, inspired by EIP-165 for the Ethereum ecosystem.
Motivation
Motivation of this proposal is to provide a standard way for smart contracts to detect the interface of the smart contract they are interacting with.
This is useful for smart contracts which interact with other smart contracts, as it allows them to detect the interface of the smart contract they are interacting with and adjust their behavior accordingly,
without having any ABI of that contracts.