class: small, left ## π§ RAEN in NEAR's desert: tooling for ambitious Open Web apps *How to use the slides*: * <kbd>P</kbd> toggle presenter notes * <kbd>?</kbd> help menu * <kbd>→</kbd> next slide Also, here's the [source](https://github.com/raendev/talks/tree/main/nf-pitch) and a [standalone version](../nf-pitch-standalone/) --- class:small # π§ # RAEN in NEAR's desert: *tooling for ambitious Open Web apps*
@raendev
--- ??? We're gonna talk about two problems, a big problem and a small problem. --- # *1* ??? The big problem is ecosystem-wide, blockchain-ecosystem-wide, dapp/web3/Open Web/dweb-ecosystem-wide, and that problem is this: -- no one knows how to build dapps ??? No one knows how to build dapps! Ok that's not strictly true, some people have figured out some useful patterns. But good luck figuring out those patterns if you're new. Most people don't know, most documentation doesn't go that far, most tooling isn't that expansive. --- # *2* ??? The small problem is with NEAR smart contracts. -- black boxes ??? They're black boxes. They don't play nicely with others. Only the author of a contract can really dig in and figure out how to interact with that contract. Everyone else needs to search for the source code, or deconstruct web app workflows, or give up. --- ??? And now I assert -- ## *2* ??? that solving the small problem -- π -- ## *1* ??? is key to fixing the big one. --- ??? And if that's true, that's great! Because we already solved the small problem. The solution -- # *RAEN* ??? is RAEN. --- ??? To understand RAEN, let's see how other people solved this problem. Ethereum solved it with -- # *ABI* ??? an "ABI" system. ABIs are JSON files, generated from a smart contract, that contract authors distribute off-chain, using GitHub or some other system. (Pagoda fka Near Inc are copying this system.) --- class: small *WebAssembly* aka *Wasm* ??? WebAssembly aka Wasm (NEAR's runtime VM), are solving this same problem --- # *WIT* ??? with Wit, -- *WebAssembly* ??? WebAssembly -- *Interface* ??? Interface -- *Types* ??? Types. More compact and readable than the JSON of ABIs, Wit fits easily into a Custom Section of a deployed smart contract. So that's exactly what RAEN does. ---
??? This leapfrogs the ABI system. RAEN inspects your Rust smart contract and generates Wit from it; compiles your contract, injects the Wit, and compresses the whole thing, making the end result smaller than if you built without RAEN. Now anyone can generate any tooling they need for any given smart contract. --- class: left # *some-contract.near* ??? Just by knowing a contract's name, You can generate -- βͺ *some-contract.json* ??? an ABI. --- class: left # *some-contract.near* βͺ *some-contract.ts* ??? Or Typescript. --- class: left # *some-contract.near* βͺ *some-contract.rs* ??? Or cross-contract calls. --- class: left # *some-contract.near* βͺ *some-contract.sh* ??? Or a CLI. --- [![Inspect some-contract.near using a schema built with RAEN and stored on NEAR](img/raen-admin.png)](https://raen.dev/admin) ??? Or an admin panel web app. This one already exists. It's called RAEN Admin. You can `raen build` your contracts and enjoy it teach with it collaborate with it --- # *raen.dev/admin* ??? today. --- ??? A RAEN-maximized version of NEAR becomes a fully-typed smart contract ecosystem, a development platform where all developers can learn about and script against and build on top of any already-deployed program with confidence. Which circles us back to --- # *1* no one knows how to build dapps ??? the big problem. "No one knows how to build dapps" and what this really means is that we're all still figuring it out together. New patterns are emerging, new visions gaining salience. --- ??? One vision for the Open Web --- ![](img/arch/thin-app.svg) ??? is thin apps --- ![](img/arch/thin-app-open-data.svg) ??? that access open data. Apps that read, write, interact with data from many smart contracts, --- ![](img/arch/thin-app-own-data.svg) ??? some the app developers wrote themselves, --- ![](img/arch/thin-app-other-data.svg) ??? some that pre-existedβ public infrastructure. --- ??? And if that's your vision what a boon is a fully-typed ecosystem of public infrastructure. We're going long on this vision. --- ![](img/framework/build.svg) ??? RAEN, born a build tool, will grow into a framework, helping ambitious developers --- ![](img/framework/create.svg) ??? compose secure, well-architected smart contracts, yes, and more than that. Because ambitious apps need more than just smart contracts. --- ![](img/framework/frontend.svg) ??? They need frontends, --- ![](img/framework/indexing.svg) ??? indexing layers, --- ![](img/framework/complete.svg) ??? off-chain storage. RAEN will pull these all together, as well as yet-undiscovered architectural patterns, and help devs keep apps fresh with all these latest discoveries as they emerge. --- class:left ??? Here's what this will look like in practice. Let's follow three builders, -- # π ??? Ali, -- π ??? Bob, and -- π¨ ??? Cal. --- class:left # π ??? Ali just switched to NEAR from some other blockchain, and wants to build new defi offerings. She opens her command line, -- `raen generate contract amm` ??? types "raen generate contract amm", gets a new Automated Market Maker contract, -- `raen generate contract ft` ??? types "raen generate contract ft", gets a new Fungible Token contract, --- class:left # π ``` βββ Raenfile βββ contracts/ β βββ amm/ β βββ ft/ βββ tests/ ``` ??? and starts hooking them together, feels immediately productive and useful in her new ecosystem with her new programming language. --- class:left # π ??? Bob is a business founder frontend dev with a product remixing data from three existing contracts. In his command line, he types -- `raen new project --use` ??? "raen new project --use" followed by the names of those -- `contract1.near` ??? three -- `contract2.near` ??? smart -- `contract3.near` ??? contracts. --- class:left # π ``` βββ Raenfile βββ frontend/ ``` ??? Gets a project configured with a fully-typed frontend app, that even gives him some reasonable starting UI, --- class:left # π ``` βββ Raenfile βββ frontend/ βββ subgraphs/ ``` ??? and some Subgraph code to index those three contracts, --- class:left # π ``` βββ Raenfile βββ frontend/ βββ subgraphs/ βββ tests/ ``` ??? and tests to show how it's done. he's already busy building business logic; doesn't need to bother with boilerplate or any reverse engineering. --- class:left # π¨ ??? Cal is making the switch from web2 to web3, participating in their first hackathon. -- `raen new project` ??? They type "raen new project", get a tutorial appβ --- class:left # π¨ ``` βββ Raenfile βββ contracts/ βββ frontend/ βββ subgraphs/ βββ tests/ ``` ??? contracts, frontend, subgraphs, storage, all hooked together. They learn the ropes and build an app, are proud of what they build, continue hacking with their team after the awards ceremony, grow the codebase easily from proof of concept to full-scale public infrastructure. --- ??? That's where we're headed. That's how easy we want NEAR to be. We will get there in six months. And who are "we" anyway? --- *@chadoh* ![](img/chad.jpeg) ??? Mostly just me and this guy, --- *@willemneal* ![](img/willem.jpeg) ??? Willem, after parting ways with Near Inc last fall, We wanted to keep working on NEAR; explored other options, but we're literally vested in NEAR, and NEAR has the best developer experience, best Account Name system, best scaling architecture. So in January we formed Aha Labs, built RAEN in just 4 months --- *read:* AhaLabs.dev ![](img/ahalabs-recap.png) ??? while delivering on multiple other commitments, including the most-used NFT code in NEAR, TENK. --- *pixel8.io* ![](img/pixel8.png) ??? We also collaborated with the Pixel8 team to make RAEN Admin look slick, and we'll merge with their team for these next --- # π§ ??? Six months. A small team. (A small budget!) Shipping well-loved tools above our weight class. You'll love what we pull off. -- raen.dev twitter.com/raendev github.com/raendev ??? Thanks for listening. See you at NEARCON.