Human Friendly Contract Interactions, UX Unconference

UX Unconference at Devconnect Amsterdam 2022 · 30 Jun 2022 · 6:31

Kaan Uzdogan of the Sourcify project tackles blind signing, where users approve transactions without knowing what a contract call does. The talk shows how NatSpec user documentation, with dynamic parameter expressions, flows into the compiler metadata, is published on IPFS and linked from the contract bytecode, and how full verification on Sourcify makes it trustworthy. Wallet designers can then fetch it and show readable prompts. The Q&A covers developer and wallet adoption.

Speakers

Topics

From UX Unconference at Devconnect Amsterdam 2022, hosted by Ethereum DEV NL.

Transcript

foreign [Music] hi everyone um I'm Khan and today I'm going to talk I'll be talking about the human friendly contract interactions that can be made with sourcify the project so again the same question what's wrong with the ux in web3 many things but one of the things that bother me is this like when you are signing a transaction you seriously don't know what's going on like what what we like to call as YOLO signing um

and there is like two points I like I have to categorize this when you're having a contract interaction like one is are you talking to the right contract this can be done like um in metamask for example you can see the website or you can also you might you might also be able to see the contract addressing and um someone by trusted contract registry but this this category is not what we are tackling actually we are having this question is this contract called doing what I really want to do um so possibly we can change this view to something more human friendly like at least you can see uh what the function

does and what um what the parameters are Etc so how do I achieve this um first there are as a contract developer you can do what you can do is you can use the not spec documentation if you are not familiar with with this I try to be as as less technical as possible but so if you are not familiar with this this is the solidity standard for commenting and adding documentation to functions you call so you have the developer documentation you have the user documentation and the parameter documentations and the nut spec also has this neat thing called Dynamic Expressions where you can

have the parameter names replaced when they are being shown to the user so this documentation you see can become this and even better something like this and the documentation gets mapped into the document called metadata Json it's a output document by solidity compiler which has the all information all needed information by the contract and can be seen like this and you then should publish the metadata and the source code on ipfs if you want your source code of course to be public and yeah the mathematic metadata Json is

again a file containing uh compilation info API user documentation and also source file information that looks like this and what's handy here is and this file the hash of this file is appended to the contract bytecode so if the contract byte goes something like this the compiler appends it to the end of the contract and if you decode it it looks like this and it's an ipfs and so the compiler version and finally do a full or perfect help as we call it perfect verification on sourceify um if you are on an ethereum test net or mainnet we do it for you if you publish

it we just automatically verify create contracts but otherwise you have to do it manually and full match perfect match is a different than the current contract verification through etherscan or other places that we have a hundred percent by byte match of the contract thanks to Source hashes being built into a metadata file if you want to learn more you can check out the docs or find me after the talk um as a vault designer or vault developer what can you do um so when you are when your users are interacting with the contract get the contract byte code and get the metadata hash at the end of the contract bytecode and pull the metadata from the ipfs

and pull the of course the documentation and the API take out the parameters and if there is a user documentation show them the user documentation with the dynamic expressions and hopefully you will have a something like this yeah thank you so what are some challenges you guys are facing getting adoption for some of this stuff are there it's basically completely a developer adoption so right now it's more or less the de facto standard to verify on other platforms um we are like the tooling is the most

important thing to integrate this verification step in the contract building and Publishing process right now there are like extensions and tools but still most of people are not aware of them or they have to install an extra plugin so would be nice it would have been nice if we had this more integrated into complete pipeline so basically we need to get information from the dab layer and then the wallet integration will need to happen from the wallets and then yeah first first the contract needs to be verified yeah from the author of the contract and then of course the other side of the adoption is from the wallets from the wallet developers wallet designers yeah so we act it's like more like an infrastructure that we provide

and helping other people to make use of it so as a community what can we do to kind of kick off that adoption um I don't know like to make people aware of this because most of people are not aware of there's this possibility exists um yeah and to let developers know let the world developers or contract developers know something like this some full and open verification exists thank you [Applause] [Music]

Related talks