Building for the Future: NEAR’s Vision for Layer 1 Infrastructure by Bowen Wang
Ethereum Denver·Mon, Oct 9, 2023, 12:00 AM
Usability is the biggest hurdle to Web3 adoption today. In the past, people in the Web3 space have either largely sidelined the usability problem or considered it to be the responsibility of application developers. In this talk, I'd like to present how NEAR thinks about usability and new innovations on the protocol level to make NEAR attractive to both developers and end-users. Bowen Wang
Transcript
cases there are some uh glitches here and there but uh hopefully that'll make the talk even better. Okay, so uh I'm B head of protocol at Pagod. Today I want to talk about protocol innovations powering the boss. So if you have been around this week uh and I've been to any of the near talks you probably seen the word boss being uh spoken a couple times. You might wonder what that is.
Uh if you don't know uh this is one slide refresher. So boss stands for blockchain operating system. Uh this is a common layer for people to discover and browsing open web experiences that's compatible with any blockchain. So this is uh basically entire stack that goes uh from the uh bottommost layer the compute layer uh where there's different blockchains like near or serum and up to the data platform layer where people can have uh data APIs to get access to data and then the discovery layer which is more like a front end a browser that leads to different experiences um like search recommendations chat uh developer console and so on so forth. uh but in this talk specifically I want to focus more on how the near protocol support the boss um as one of the uh core fundamental component of the blockchain operating system.
Uh the near protocol has some of the uh defining features uh that makes it um a very good computer layer for the blockchain operating system. Uh the most important property here is like simplicity. Uh simplicity here means that it is easy for both end users and developers to use and interact with the blockchain. Uh if you were around when Alex was talking about the uh UX problems uh that we're facing the web street today, uh this is exactly what we're thinking about um uh when we developed the near protocol and something that we care about very deeply. uh because in our mind without uh build a protocol that's easy for both the end users to use and also the developers to build on then everything else doesn't matter.
You can build the fastest most performant blockchain in the world but none of that would really matter if there's no one actually using it. Now assuming that we have a very simple to use blockchain it is also very important that it is secure because otherwise people cannot trust the protocol with your asset. uh in addition to that the protocol should also be scalable enough to meet the growing needs uh from the number of users. So we have a goal of uh getting to 10 million monthly act active users by the end of this year and that number is only going to grow and we have a goal of getting to 1 billion active users in five years. Uh and it's very important for the protocol to make sure that it can scale to meet the demand of the users and the user experience don't degrade um as a protocol scales.
So with the high level description side, I want to dive into a specific vertical uh more deeply today uh in the uh blockchain operating system. So this is about on boarding and before I talk more about how we approach it, I want to first talk about the current reality. Uh this is uh based on how u the user experience on near works currently. So if you're a new user to near uh and you just learn about near uh usually you go through the following flow. So you either land in a wallet because that's how you learn about near or you get redirected to a wallet from the app you're trying to use.
And when you log into the when you try to use the app it will say like well you need to log into your wallet and if you don't have a wallet you got redirected to the wallet to create uh your account and then you try to do that realize that well you actually need some near tokens. Now there are several ways you can do that. One is that if the wallet is supported, you can directly buy tokens from within the wallet. But if it doesn't, I probably have to get tokens from centralized exchanges or ask a friend to help. Now after you go through all of that, you can finally create account and start using the apps.
So that is while that is unique to Near, it is actually u pretty similar in the web three space. I mean there are maybe small differences, but overall um it's already almost like established paradigm like how a web 3 user gets on boarded. Uh even though we may take granted uh for that today, it is actually a lot of hoops to jump through uh before a new user can start using app in web 3. And that is sufficient to deter most of the web 2 users from actually trying out any of the apps in web 3. So what do we think is the uh ideal workflow?
It's actually pretty simple. If we think about how the web two apps work today, uh it's usually the just two steps. a user somehow learns about an app uh whether that's through a friend or like they read about it in an article or on some forum and then they decide to give a try uh they just go there open the app and then start using it right away uh pretty simple I mean they may at some point in the future need to pay for the app uh but usually in the onboarding experience uh that's how it works so what are the uh obstacles to the ideal flow here uh we think there are two fundamental obstacles here one is that uh users have to pay for transaction fees in near and also users have to have near in their account to pay for the storage. So those two uh constraints are actually um fundamental to the protocol and while that is uh somewhat unique to near I think other blockchains have more or less similar constraint that makes the uh onboarding flow not as good as what it can be. So what are our solutions to this problem?
Uh it is twofold. One is that we're implementing this feature called um metatransactions. It is a protocol feature that will allow third parties to pay for transactions of a user and that third part is usually in an app. And second, there's a there's a protocol feature called zero balance account which means that uh under some specific conditions, accounts do not need to maintain any minimum balance uh for their storage. And if you're a new user, your account you already meet those requirements.
So let's actually dive deeper uh on the technical level to uh look take a look at how those things actually work. So before we talk about met transactions, let's first take a look at how a regular transaction work. Uh it's pretty simple. A user signs a transaction. They send the transaction to the blockchain.
Uh and then the validator will do some validation before that uh before they actually include the uh transaction into the block. Uh they will check that user actually has uh enough balance on the account to pay for the transaction. and when um and the user is charged when transaction is converted to a receipt meaning that uh it is actually executed on chain. So the metat transaction flow is in general pretty similar to the uh regular transaction flow. The only difference is that instead of uh sending the uh signed transaction to the blockchain directly.
they send it to a relayer which actually wraps the transaction in a new transaction and signs that transaction and then the relayer send the transaction to the blockchain and then when the transaction is executed the relayer uh gets charged. So this is uh uh even one step deeper uh look at how things work. Uh so basically this uh transaction object on near consists a bunch of things and the most important thing here is like the list of actions and the possible list of possible actions are on the right side and as you can see metat transaction is actually just one of them. It's called the delegate action and here's actually an example of um how metat transaction actually works and there's some some very interesting interactions here as well. uh this uh probably too small field actually to see but let let me just uh walk through on the high level.
So let's say uh Alice want to send 10 USDC to Bob or to John actually in this example. Uh but then she doesn't actually has any near today that would just not be possible. uh with meta transaction. However, uh what Alice can do is that uh she can uh have this uh signed delegate action that want basically includes a function call action that transfers 10 USDC to John and then she send this uh sign delegate action to a relayer. relay wraps around that uh in a transaction send it to the blockchain and when uh the transaction gets executed uh the uh metatransaction gets unwrapped and the inner uh action gets executed and when that's get executed it further unwraps itself and then eventually the function call action gets executed and a very a very interesting scene here is that um Alice can actually pay the relayer in the exact same uh metat transaction so basically in In addition to transferring 10 USDC to John, she can also say I want to transfer 0.
1 USDC to the relayer and it will get executed in the uh same transaction and by the end of the execution not only John uh gets 10 USDC but also the relayer gets 0.1 USDC. So that's uh how the metatransaction works and let's take a look at how the other important feature zero balance account works. uh in order to uh better understand um how it works or why it even matters. Uh it's first um let's take a look at how storage on near works.
So there's this uh mechanism called storage staking which means that the account has to lock some near tokens for the uh storage that it occupies and that includes account structure itself and the price is basically one year for 100 kilobytes of storage. So it's worth noting that um it is you're locking near for storage and you're not actually burning those near meaning that if you actually clear the storage you can actually get the near back. So that's um a way to incentivize people to delete things from the state. Now what this means for new account is that um for a new account with one access key uh even though that's very small it still occupies some bytes and as a result you need to maintain a minimum balance of 0.00182 near even though that's a very small amount you still actually need to have some amount of near on your account.
And the the problem here is not about the money it's actually about the flow of getting near and that's actually what makes the onboarding flow very complicated. So what the balance account does is it says well at the account creation time we actually reserve a small number of bytes um in storage for the account so that you don't actually have to pay it later and and the cost for those amount of bytes is actually paid when the account is created and that's actually paid as part of the transaction fee. So what that means is that the new user don't actually have to worry about getting near tokens to maintain their account and also makes it easy for an application to create accounts for the users because they don't actually need to worry about uh malicious attacker grinding their faucet. So how does everything uh come together to uh make a new experience for the on boarding. Uh so basically a user a new user visit an app and through this uh biometric authentication um a key pair is generated locally and that is actually just the user account and then the application would pay for the uh user initial usage of the app as part of the user acquisition cost through metatransactions and since a user don't actually need to maintain any balance on their account they can start using application right away and it's not that this on boarding experience is good for this app specifically Uh it's also great because uh the user only need to create a new account once and then they can use a new account uh for any other application that's on near.
So all of that is great uh and uh give rise to a very promising onboarding experience. Uh but I want also want to talk a bit about some of the more uh exciting stuff that's uh on the horizon and how those protocol features actually support the uh blockchain operating system. So one of the uh most notable thing is account extensions. So today it's very difficult to compose um different account modules together. Uh let's say uh you you want to have more customized control of your account and you want to have both a multisseek and let's say a proxy contract to have very uh customized control of your own account.
Today the way to do that is pretty much like you create a new smart contract out of those two and you have to deploy that to your account. This is both very expensive and also time consuming. uh if we can have those account module deployed globally uh then it's very cheap for user to do that and also very convenient. Another thing is that uh we want to provide primitives um for smart contracts to scale beyond one shard. Uh today even though near is what very well known for uh sharding scaling uh being able to scale linearly with number of shards smart contract themselves don't necessarily take full advantage of that and we want to make sure that even if a smart contract gets say um 100 million users is still um very easy for them to handle that and the way we we do it is basically to provide the primitive that allow developers to easily start the smart smart contract if they want to.
Uh finally um we know that uh while the uh asynchronous execution environment on near uh is what allows us to have the scalability we have today and gives rise to our success, it also creates some problems for some applications especially the D5 ones uh where composibility and safety is very important. So we're also thinking about uh different ways to uh make that experience uh simpler for people uh including different ways to do uh create synchronous execution environment ranging from a synchronous execution vault to more synchronous sharding. So yeah, uh those are some of the uh very exciting stuff uh that's on the horizon and I talk a lot about the protocol features and how it supports the uh blockchain operating system, but I think it's uh great for everyone to try themselves. So uh please check out alpha.org.
This is the uh one of the gateways to the blockchain operating system. And if you are working on the hack zone, uh please check out boss.gg. Uh this is one of the uh gateways that allow people to build uh serum applications on near and yep that's it for my talk.
Automatic transcript — names and jargon may be misspelled.