New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Getting Started on Solana | Ethan Francis - Particle Network

Ethereum DenverWed, Oct 9, 2024, 12:00 AM

Speaker

Ethan Francis

This workshop will help developers jump start their build on Solana and get their hands on the right resources. APPLICATIONS FOR ETHDenver 2024: #YearOfTheSpork ARE OPEN APPLY NOW https://ethdenver.com/apply

Transcript

[Music] it's really great to see already a pretty good crowd here at e Denver for only the first day um happy to see that as a Colorado Native and uh specifically I'm excited today to talk about salana so I guess for a little bit of context kind of the point of the workshop or the talk today is going to be about kind of giving you an initial introduction to salana and kind of building some initial understanding of everything that you need to know to kind of get start building on salana but uh before I kind of dive into the specific agenda for the next 20 minutes or so um as a quick introduction uh my name is Ethan although I go by the Alias Tabasco and I do develop relations at particle Network um I actually am not with the Sal Foundation because the Sala Foundation I think is flying in two or three hours from now so I'm filling in for them um but this is their presentation so I'm just kind of the proxy for it um but really excited to kind of dive into these Concepts today I've been building between both evm and salana for almost three years now and definitely when it comes to building on Sal there's a lot of nuances that are important to understand but it comes with a lot of benefits that we'll talk about in a moment so uh kind of what I want to go over today is going to be broken down into three main categories three kind of sections the first is that we're going to go through the technical advantages of salana so kind of the reason why people want to build in salon and the reason why the ecosystem is as large as it is today but then going to go through kind of the salon programming model so we're going to go through four Core Concepts accounts programs transactions and instructions um these are like the sort of building blocks of understanding development on Sal so go through these and Define each one go through even like how they're uh formatted architecturally and stuff like that and then finally we'll end it off with this kind of context that we build through the technical advantages and through the programming model um to show you what actually the life cycle of a transaction looks like and if you're familiar with building on evm uh hopefully it should kind of give you an insight into what salana actually you know looks like in the background how it functions so first what I want to do is talk about the technical advantages I'm sure everybody here is probably heard about salana before and specifically salana is known for having uh high performance so this includes number one very quick confirmation time uh so I believe it's about 400 milliseconds for a transaction to be processed which is Major I mean as a user you can imagine uh sending a transaction or interacting with an application and basically confirming instantaneously this is a really big component of salon and why people enjoy building within the ecosystem because of this lightning quick transaction time the second is that this transaction time doesn't come at the cost of High fees actually the fees on Sal are very low um usually 100th of a cent fraction of a penny um so this is another big component right as a user you can imagine uh I work at a company that is user experience so you know building applications where users can start doing large volumes of transactions you know large sequences of transactions where they're happening almost instantly and they're paying a very negligible amount of fees this is a major component of why a salana is as popular as it is and then kind of in achieving these another big part of salana that you might find interesting is that programs which are basically contracts we'll get into this in a moment these are executed in parallel so salana has parallel execution and all these benefits don't come at the cost again of decentralization actually salana maintains uh like full Ledger State broadcast Ledger entries to every Val of the network to I believe now almost over 2,000 across the world um so this is a major part of salana get fast transaction times low transaction fees parallel execution well of course having full broadcast of uh block propagation across the entire network so what I want to do is you know we just went over like three quick highle benefits of of why salana is as high performance as it is and kind of the numbers attached to that um so how does this actually work how does salana achieve this this performance how is this you know 400 millisecond uh transaction confirmation possible so I'm going to go through very quickly the high level overview of salana and kind of how it works in terms of a transaction um being processed so number one is that like most proof of stake networks that you're probably familiar with Sona elects a lead leader so a a voting consensus validator for processing transactions in a block so this leader receives all transactions it then processes these transactions and packages them all into a block now unlike ethereum Sal doesn't have uh mempool uh for pulling and processing transactions instead Sal basically has every leader that's elected in the cycle already with a large you know batch of transactions that they can execute and then uh kind of or or process and then have in a block so um son has kind of this interesting cycle of its continual leadership uh election uh and then transactions are processed and packag into blocks and this happens very quickly and as we'll get into a moment like I mentioned uh number one is that you know this allows for Block propagation across every validator in the network through turbine so turbine again a little bit too technical for this potentially but turbine is the block propagation protocol that Sal uses um to over uh 2,000 different validators now like I mentioned earlier uh a big part of the performance here and kind of why this model is unique is for kind of two reasons the first is that transactions are executed in parallel so this is very important um because of course it contributes to a lot of the performance I talked about a moment ago in terms of the uh quick transaction times and the low transaction fees um and it's also important and we're going to get into this in a moment but transactions are stateless essentially transactions uh can kind of be defined as an array of instructions now these instructions basically tell different contracts or programs on the salon Network what to do and what to execute uh data to read data to write Etc and essentially transactions and programs themselves um they don't contain a single state rather programs and transactions interact with data within different accounts across the Sal Network and uh this will make more sense in a moment once I get into the kind of account structure on salana um so this parallel execution this kind of a mechanism of electing a leader and then processing transaction packaging it into blocks and then propagating it across the entire network Um this can kind of be defined under this idea of proof of History so this is a big part of again why Solana has the performance that it does um now I won't get into too much about proof of History essentially it involves kind of like time stamping events on chain through a vdf um but definitely if you're interested in kind of understanding this consensus mechanism more that's something to to definitely look into um but these kind of collective Innovations proof of History parallel execution and again like the core mechanism I just described uh contribute significantly to why salana can achieve kind of those previous core benefits I mentioned a moment ago so some key takeaways from this uh those few slides is that number one uh transaction has fast confirmation times number two transaction or Sal has very low trans transaction fees usually uh you know 100th of a cent sometimes a little bit more uh Sal executes transactions or uh programs in parel and uh of course Sal is ideal for high performance application so whenever you're building maybe something that uh needs this performance for some reason whether it's for a consumer facing application where you know slow transaction times and uh expensive transaction fees can make or break your application Sal is a perfect case for this because of course you know these fees and processing times are extraordinarily low so now within like kind of the the 12 minutes I have left I want to go through two key Concepts that are very important the number one is we're going to go through kind of four um major parts of you know building on Sal and kind of the the the building blocks of that after that we're going to go through the transaction life cycle using this as context so salana there's kind of four Concepts that are very important to understand number one is accounts number two is programs which is a type of account we'll get into in a moment um and then we have transactions which is a collection of instruction so these are kind of components of each other and they all fit together uh very seamlessly so number one is accounts this is probably if there's one thing that you take away from this talk when you're understanding salana um this is one of the most important things so everything on salana is an account um this means that from the contract that you're executing or as Sal calls it a program all the way down to data that you're storing or even like the uh method that users use to interact with blockchain this is all happening through different types of accounts um accounts that are some executable some are just for data storage and some are actually for like user level interaction so all accounts are unique 256bit addresses um they all hold some balance of Soul or kind of the smaller denomination of that which is lamp ports they can store arbitrary data so we'll talk more about this as well um but accounts can store you know for example token balances or something that indicates data on chain now this data storage you know storing arbitrary data on chain it's not free salon uses uh this concept of rent um to kind of charge data storage on chain uh kind of corresponding with the volume of data that you're storing in a given account now with accounts anybody can credit soul and anybody can send soul to an account regardless of the type of account it is anybody can read data from the account so this is uh important to understand um from this only the accounts owner can actually debit Soul so that spend Soul make kind of a state changes to the the soul balance or modify data on the account itself so um to give some additional context and maybe visualize this in a programmatic sense um accounts are basically made up of these kind of five key Fields the first is the key which is the public address of the account then you have lamp ports um lamp ports uh for those of you that are familiar with ethereum are kind of the equivalent of wayy or if you're more Bitcoin native kind of like SATs they're just a very small denomination of Soul data is basically a collection of data bytes stored in the account and is executable is a Boolean that basically determines um is this account a program or is it not a program so does it have code within the data that is executable um or is it just a normal account for data storage or for user level interaction then the owner is a public key uh which actually is a program so essentially you have accounts that are owned by programs on salana um for example like a normal account that you might use uh for sending soul to you know person a that would be owned by the system program on salana or an SPL token could be owned by by the uh there's like a specific program for that um so basically accounts on salana are owned by programs so the owner parameter here um is the program that has right access to the account so like I mentioned soul is a denomination or Lamport is a denomination of Soul one soul is 1 billion lorts so now that we understand the account structure on salana everything on salana is an account from Smart contracts or programs uh all the way down to user level interaction so those are of course accounts as you might be familiar with with and then even data storage um these are all accounts and I mean to draw a parallel here like on evm usually you'll have like two types of accounts externally owned accounts um and uh contract accounts so there's usually a differentiation with what you might be used to but on Sala everything has this data standard of account and programs are no different so programs you know or smart contracts as you might know them better as um are also accounts on Sal so a special type of account that has executable code um that works with other accounts to store data and execute different instructions so the data stored with an account is evf bite code um this is a Berkeley packet filter that's what that stands for uh programs are written in rust or uh C and C++ so you know of course ethereum and evm has solidity um Sal uses rust which I'm sure many guys are a fan of this is compiled to llvm and programs are stateless um kind of like we talked about same thing with transactions everything on salana the program itself uses um kind of you know uh the logic to then execute and do things on other accounts so data storage accounts that maybe hold results or hold some sort of uh you know resulting logic that happens after the execution of a program as well as of course with accounts that users might use so programs can basically read andr write data to other accounts like I just mentioned and uh a big part of this is that it allows programs to be executed in parallel like we talked about in the beginning so basically with programs you must be the owner to to modify them and programs process instruction so this is very important um because like like I kind of alluded to originally uh hopefully like this is clear in terms of on salana everything is an account transactions are basically collections of instructions these instructions are very simply uh you know things that we want programs to do or things that we want uh you know different accounts to do within programs um so programs must process instructions things that call methods that are outlined within uh their code um looks like some of this got cut off but programs can also send instructions to other programs which is CPI which is cross program invocation so from this we talked about two very large concepts of salana very quickly number one is that everything is an account on salana from the user side to the actual data storage side to the program or smart contract side everything is an account all accounts hold Soul or usually programmatically denominated in lorts um accounts can hold arbitrary data in the form of bytes so this can be anything usually uh working hand in with some sort of program to dictate what this data is and how it changes um accounts can also store executable programs so contracts basically written in Rust and accounts are passed into programs allowing for parallel execution so now I want to go into kind of a more granular understanding of kind of the topics that we just looked at at a high level so number one is instructions like I mentioned instructions are very simply just calls to the methods uh or calls to a spefic program uh that allows you to execute logic um on chain this is the way that you send data to the salon of blockchain um and we're going to get into a moment they kind of unique data structures where you have to list every count involved in a given instruction um and transactions are collections of these instructions so you can then do complex things on salana while retaining those score benefits like parallel execution So the instructions on salana this is kind of what they look like again a programmatic example of what the fields of an instruction are number one is the program ID this refers to the program that the instruction is targeting number two is an array uh this array basically refers to every account that's involved at every step of the process with actually executing a given instruction and of course this contributes pretty significantly to uh the uh performance of Salon as well and it contributes to parallel execution in that sense I think my slide is broken there we go um and uh data is basically uh specific instruction discriminator plus the actual Arguments for the instruction that you want to execute so this is the idea um instructions are just calls to different programs these are usually bundled in transactions or is an execute on chain and this is how you uh do things on salon now salon and transactions like I've talked about a little bit basically contain one or more transactions these uh or one or more instructions sorry about that um these instructions are executed automically and essentially uh like you might be familiar with most blockchains is that these transactions require a small fee to be paid to transmit them to the rest of blockchain this fee is quite low on Sala um and transactions must be signed by one signer so the transaction needs to be signed by an account um just like you might be familiar with within evm environments so transactions um this is again another programmatic example of what a transaction structure looks like um number one is that transactions contain an array or a list of instructions so things that are dictating what you want to execute within different programs um you also have to include the recent blockcast is used for D duplication again can contribute to efficiency and security you also have the fee pair which is a public key that determines who's paying the gas fee of this transaction and finally you have the signers parameter which Ates basically the signed versions of this transaction um so this is again what I alluded to a moment ago which is needing to sign transactions before they can be executed on chain just like you're used to already so some takeaways from that data is stored in accounts including programs which again everything is an account programs are invoked by instructions instructions are sent via transactions and transactions are Atomic and must be signed so hopefully this kind of idea or this visualization is kind of becoming clear about the architecture of Salon you have this really high uh performance that is coming from this kind of unique architecture around stateless program stateless transactions and of course having this Universal kind of generalized data standard of accounts across the entire network so now to end it off here within the next three minutes or so um we're going to go through the life cycle of a transaction so from the point where you interact with Jupiter or something of this nature and then you actually execute a transaction then it gets completed on chain what happens within that process so to illustrate this we're going to go through an example um we're going to basically say let's you know let's say we've deployed a counter program so something that whenever you call an instruction on this program um it's kind of increments a single numeric value on chain so what this would look like is that number one uh on the client side which refers to uh decentralized application or some sort of website that is initiating this transaction it's constructing this transaction um basically you perform it it sends us to an RPC client so an RPC node um this RPC then takes it to uh V voting validators um which then basically kind of like we went through originally in terms of that initial process that we talked about um eventually executes the instruction for uh the the program um which increments the count on um on the counter account so what I want to highlight here is that in this example of we're creating a counter program all we want to do is increment a number on chain the actual number that's being incremented is not on the program itself but rather it's on a counter account that stores the data that's resulting from the execution of this program so again this refers back to the idea that everything on is an account and kind of data is stored within their own accounts programs are stor within within their own accounts and so on so some takeaways from that the client applications take transactions um usually constructed in tandem with the user send that to an RPC client the RPC client then sends these transactions to the network uh validators then execute these transactions which invoke programs via instructions and then of course programs update account State as a result so this is I have about a minute 50 left uh this is kind of the introduction or the high level overview of salon's architecture so it is a really cool Paradigm that salana is building here in terms of you have this very unique kind of uh you know architectural makeup um that sets a stage for major major Innovations when it comes to again performance transaction fees Etc um so this is kind of the the major benefits of using salana now salana Foundation is actually here I believe they're going to have four or five team members here um throughout the the you know few weeks of e Denver I believe their devil should be here in three or four hours at this venue so if you guys want to keep a lookout for him but definitely take a look at this QR code this is the ethereum to salana development course so you know over the past uh 15 20 minutes I've talked a little bit about like some parallels between salana and ethereum and the concepts that kind of overlap a little bit like programs and smart contracts and so on so uh rare skills is actually launching and they've launched an ethereum to development course that I definitely recommend you take a look at if you are interested in kind of learning the the process of building on salana and making that transition or kind of expanding your skill set to uh to this kind of slightly different different environment and of course Sal is also doing a few different bounties I believe they're doing four one is for the best custom token integration uh best Salon integrated game best salana dy/ payments integration and best salana social app so a lot of cool bounties to participate for as well gives you a good incentive to maybe try to pick up salon and build something cool take advantage of that high performance over the next few weeks um and submit your project to their different bounties so thank you that's about it about 20 seconds left if you want to ask questions about salana learn more about salana the Sal eem is amazing I've been a part of it for a long time and their developer base is always more than eager to help you definitely head over to salana. stackexchange.com follow salor devs on Twitter and check out this QR code for more developer resources in terms of learning about salana diving into the ecosystem and potentially building an application for yourself that's about it thanks guys

Automatic transcript — names and jargon may be misspelled.