Open source wallet for L1 & L2 implementors and wallet creators - Sergei Boiko | Trust Wallet
ETH Belgrade Community·Sat, Oct 7, 2023, 12:00 AM
Wallet Core - An open source wallet for L1 & L2 implementors and wallet creators - Sergei Boiko - Binance, Trust Wallet
Transcript
hey testers hello everyone thank you for your attention my name is Sergey Boyka and today I'm going to talk about how to develop non-custodial wallets using wallet core SDK so before that I would like to add a few words about my background I joined a trust wallet in March 2023 as a member of the wallet core team before that I used to work in Commodore platform developing Atomic desk color Library so um for over the three years and I have extensive experience in that field developing non-casorial wallets but what are the non-consolable wallets and what's the difference between them and Traditional Bank applications so Traditional Bank applications are centralized just a quick reminder you pay high fees for international transfers you don't have a direct access to the funds verification required for certain usage amounts and kyc can be also required for opening a new bank account but it's not a case for non-custodial wallets they are decentralized so you have a direct access to the funds you pay low fees of course depending on the blockchain you use and no kyc required to create a new wallet and even a batch of new wallets and no verification required for any transfer amount but there are some common considerations when we're developing a crypt wallet whether centralized to that centralized so the main idea is to secure user funds for traditional finance that actually means to avoid doing some crazy things with the user funds like we all know the story about FTX and what in mail it too for non-controller wallets it actually means to protect private keys and store them encrypted so nobody has an access to them the next important point is to minimize application dependencies as the more dependencies you have the more risks you have that one of the library contains a vulnerability but unfortunately it's impossible to avoid using dependencies at all so it's highly recommended to review dependencies with your security team time by time or request an external audit I would like to talk about Wallet current Channel present you the projects that already use it so trust wallet itself crypto.com Frontier wallet and coins wallet developed by coin paprika so pretty big names in the crypto industry I guess okay we talk about what we call for a few minutes already but we still don't know what is it and what problems it might help you to solve wallet core is a low level SDK that provides you capabilities to draft and sign transactions for over 100 blockchains that includes transfer stake in board nft transferring and smart contract manipulations in addition if you if you need to work with the low level cryptographic algorithms you can use user user-friendly interface to hash and sign messages to work with the encoding and algorithms like hex base 58 base 32 Etc the next important feature is key storage so wallet code provides API to protect your private keys and to store them in crypto on the devices for the next point I need to know to let you know that wallet core is a c plus Library it exposes an ff5 interface but it can be used not only by the C plus projects this is my favorite so wallet code provides high level bindings for several languages such as Swift kotlin kotlin multi-platform and typescript so it's easy to integrate into your end user application using your native language we talked about the importance of having low number of the dependencies and this this rule is also applied to wallet core we use low number of dependencies in C plus plus and rust and most of them are reviewed by our security team last but not least wallet core is open source so anyone can use it contribute to and justify the code and features that we provide I would like to compare a few examples so let's imagine we develop a JavaScript application so multi-chain wallet in JavaScript on the left side as you can see so it works okay as you can see we use multiple dependencies to work with the Solana ethereum I need an avalanche blockchains but the list of the dependencies will be longer and longer as you integrate new blockchains so developers team needs to to find a proper library to work with the new blockchain and to figure out how to use the API of the library and how to integrate it into the existing code base on the other hand we have only one wallet core dependency that is completely enough to work with all of these blockchains and not limited what are the advantages of the single dependency concept so you have smaller bundle sizes that means faster performance and faster load times smaller texture phase and fewer security risks one API and protobuf is a standard interface that the developers need to learn only once and then and then apply the knowledge to integrate new blockchains less dependencies also means faster build times and cheap faster probably the most informative part of my presentation today I'm going to show you how it's easy to work with the multiple blockchains using only one wallet core dependency so here we take a mnemonic passphrase generally create an HD wallet and generate addresses for ethereum and Bitcoin blockchains so by typing only three lines of code we achieve uh quite simple but in the same time quite like a complex operations if you like if you like challenges and type in hundreds of lines of code just to achieve the same as behind me probably wallet core is not for you but for the rest I would like to add to explain one more example how to sign an ethereum transfer transaction using wallet core we take an HTT wallet that we just created and drafting ethereum transfer transaction using a high level interface that provided by the wallet core to to work with the protot buff messages you need to specify the destination non's gas price gas limit transaction amount and in the end when you sign the transaction you get an encoded representation that can be broadcasted to the network and quick reminder the same approach is applied to every blockchain supported by wallet core now I would like to focus on ethereum features in wallet core as we add the ethereum conference so wallet core provides capabilities to sign messages in ethereum specific way so eip712 of course it works with the layer 2 Solutions including immutable X optimism arbitrum ZK relapse and smart contract manipulations for transferring funds between layer 1 layer 2. the the next feature is smaller smart wallet and account abstraction so EAP 4337 uh using Altman pool and all of these features are possible because of the full ethereum API support it's well documented and easy to integrate to the user app last but not least wallet core is a highly extensible so adding a new evm compatible chain looks like adding a new Json entry to the registry file I'm going to show you but before that one more example the main idea is to use only one dependency wallet core for everything you need in your if wallet so if you need to sign a message in ethereum specific way and use it as an argument of the smart contract call for authentication purposes for example you can you can specify the private key and message and use ethereum message signer for for these reasons next how to add a new layer to chain to the wallet core so you put this Json entry to the registry file build bindings in C plus plus Swift kotlin and other languages and use it so it's important to know that uh polygons in K Euro up is an evm compatible chain so we are going to use uh ethereum implementation specify that the blockchain field what can be different is the derivation path and a chain idea what about the future wallet core so it's excited where I'm migrating from C plus plus to us due to the following reasons so first of all rust is more secure it's more flexible and has a great package manager that can be that that allows us to update the dependencies faster and to integrate new blockchains easier it also brings us a new cargo build system the next feature we are working on is code generation tool we extend it by integrating by generating bindings for multiple new programming languages such as golang and neem and so on and probably the most important feature we are working on is extending bindings capabilities with the wallet kit so but before I will explain it um I need to to let you know what can be done actually with the wallet core so wallet core provides capabilities to work with the low level transactions to sign them and call them and work with the low level uh cryptographic algorithms but it doesn't work with the network layer so you still need to query the balance to estimate fees to to broadcast the transactions to the network and this is what we get in wallet kit so wallet kit expands the capabilities of wallet core by implementing Network layer and integrating blockchain Services it utilizes the wallet core as a kotlin multi-platform library so um for seamless integration and kotlin multi-platform is a technology that allows you to call the feature one time in in coding and then generate uh Native Native coding Swift kotlin and typescript yes we are still working on it and once it's done it will be available public so we are going to make it open source and publish packages for seamless integration and it's also incredibly extensible so implementing a new blockchain uh is straightforward so we use the same API as you already used with the integrating other blockchains and apply the knowledge to integrate new blockchains the last example today so it's completely enough to develop a multi-chain wallet by using only a wallet core and wallet kit so we create with the uh we we work with the addresses for Bitcoin and ethereum and then query the balances for them and it's easier thank you very much for the for your attention and join us on the social networks hope it was it was injury do we have any questions yeah sure that's that under which license is this published um Apache if I'm not mistaken thank you do we have any more okay to be honest I'm uh I can't be wrong but yeah let me check after the presentation um do you support external sinus like can I use on Hardware Bullet For example to sign my transaction sorry could you please repeat uh do you support external signers of ultra signing transactions so I can for example hook up an USB token to sign the transaction instead of using software so in what core we doesn't support external signers but our end user application support like metamask if I'm not mistaken also okay thank you first time second time sold thank you Sergey
Automatic transcript — names and jargon may be misspelled.