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

Loading player…

The Essential Pint Workshop with Mohammad Fawaz

ETHGlobalThu, Oct 9, 2025, 12:00 AM

Join us for a workshop with Mohammad Fawaz from Essential titled, "The Essential Pint Workshop." Pint: Introduction to Declarative Programming with Essential. Join us for a workshop on Pint, Essential’s domain-specific language (DSL) designed for creating declarative, programmable smart contracts. In this workshop, we will cover the fundamentals of declarative programming with Pint and demonstrate how it can be applied to create sophisticated DeFi applications. ETHGlobal Bangkok 2024 was a 3-day hackathon that took place November 15 to 17, 2024, and brought together the most skilled web3 developers, designers and product builders from all around the globe for a weekend-long adventure to advance the Ethereum ecosystem! ----------------- Follow us: https://x.com/ethglobal Check us out: https://ethglobal.com/ Email us at: hello@ethglobal.com

Transcript

yeah I do it on yeah it's working well okay I guess we'll uh we'll kick it off um yeah I don't know if you guys are going to be hopefully hacking with us today but I thought we'd go through some some of the dogs and uh just some basic things to get you going um don't have a lot of time to delve into a lot of the details so you know find us after and we can we can help but uh for the most part um essential is a declarative blockchain the idea with the declarative model is that instead of uh you know proposing or submitting transactions of the blockchain that specify how the contracts should should uh execute uh certain algorithms to update the state imperatively um you're going the about this the other way around where you're basically submitting solutions that tell you what the next stage should be uh so for example what your balances should be at at the end of a particular block or a particular solution submission and the job of the validators uh using the contracts is to make sure that that final state is allowed that final state is is possible given uh certain constraints so the basically a contract is just a collection of constraints and those constraints uh make sure that the state you know is not being updated in random ways it the constraints restrict the State updates to specific um a specific space of some sorts and um what you're going to end up with is um every section of the contract will allow you to update the state in a way to achieve a certain um um a certain task for example whether be it a transfer from one account to another or be it a mint um mint minting of a token and a token contract and so on so I encourage you guys to go through um the docs first there's lots of information here about um all the you know the declarative versity the imperative Concepts how declarative chains or specifically our chain differs from imperative uh uh blockchain as well as the difference between declarative and imperative programming yeah you might be familiar with imperative programming from uh languages like solidity and so on um and then there's a bunch of stuff about the protocol itself which you might find interesting and the probably the most important place to start actually getting um things going is with the getting started guide which if you go to in here um basically has an application an example application uh which is you know the counter the canonical uh counter which uh increments by one every time you submit a new solution and so uh you should probably walk through this uh line by line and get it going it basically describes how to start a new project how to compile it what the output uh artifacts are and then lets you interact with the contact using a rust front end uh you know a lot of the we currently only have a way to interact with contracts using rust if you want to build an a full application um you can probably build something in typescript that's going to be a little more involved um but a lot of the infrastructure we have we uses rust and so uh this getting started guide goes through uh how to a rust front end and a bunch of rust tests if you want to test your application and eventually uh there's some form of a CLI that also it provides some examples of how to do a lot of that in the command line and then end up with um a way to interact with with our deployed devet as well um so with with the with the counter example I think might be interesting to go through just as quickly just to find fin form of of a of a contract that increments a counter is is this one which as you may see you know we have our storage which is the counter and we have a predicate which is kind of similar to um a contract method but it's not exactly called and it's it's this whole thing where you're actually solving the predicates which you can solve multiple predicates at the same time so there is no there's no call there's no control flow um you just have uh this this um object here that has a bunch of constraints in this case just one that tells you how the counter is allowed to be changed and in this case the counter um counter Prime which is our notation for the next state we're saying is the counter Prime has to be equals to counter plus one as you see this is kind of a buing expression and nowhere in here do we actually change the state manually there is no manual State update in in the contract it's all done by providing like the solution will propose a new value for the counter and then the validators will check whether that's whe whether this is valid or Not by plugging in the new value plugging in the old value and then checking if the constraint is true or not and that will happen for every constraint and that will happen in parallel um so that's kind of the idea behind the whole thing is smart contracts are basically Gatekeepers they're just there to check whether the state you want whether your your future whether your desires are can be possible or not whether the if the contract allows you to go from from point A to point B then it will it will happen and if you're doing something wild and that's just not possible then the contract will not allow you to do that because one at least one of the constraints will fail um so for the most part you can probably build anything you want um what whatever can be built on uh imperative chains like ethereum you can probably do here as well or you should be able to um but we think this also opens up uh avenues for other applications to be built in in a in hopefully a simpler and more efficient ways and um I know in the previous haathon some people uh built a limit order book and that was fairly easy to do which was nice um which probably can't be said about other other other uh other ecosystems so once you go through the getting started guide um there's a bunch of videos I think we link to in uh if you go to the price page there's a video here that has more information um it it kind of walks through the token contract or at least parts of it uh which you might find helpful and if you want to venture to this repository called essential integration which I link to in the telegram group and we can link to in Discord as well that's a very important repository under apps you'll find the counter the full counter example um with multiple implementation of of the front end but also the token example which is really important um a lot of applications will probably want to use this token um and potentially it will inspire you to implement things in maybe different ways uh so the token example if you go to the p/ Token source contract. pnt um this is the Pint code that describes the token functionality and you'll get used to a lot of this stuff there's a lot of Border plate stuff in here uh but effectively the core logic of of many of these predicates is the invariant you you think of when you think about a transfer or a burn or a mint for example when you think about a transfer the invariant is you want one balance to go down by an x amount and one balance to go up by an x amount and so you encode that in in some constraints for a mint you're saying you want to create tokens uh and then send them to a certain account so there's an invariant for that that says the balance of some of that particular account has to go up by by by some amount and then I have to increase and then the total supply has to be moved by the same amount and so on so all of these invariants are constraints they're not actions you're not saying they're I want to change there is no assignment like you're used you're used to saying you know the value of x must be assigned to or must become this uh we don't have assigned there is no assigned operator in this language it's all constraints it's all boing Expressions so everything here as you can see is Temporaries and just constraints and every constraint takes a barding expression that says what the invariant is to accomplish a certain action and so you can think about you know if you're designing a defi protocol of some sorts all you have to do is think about what the math is what is what are the invariant that take you from State a to State B and then you plug those in into constraints in your contract you don't have to think too much about how to get how to get there um if you need some form of algorithmic computation to actually get there then hopefully that gets done offchain so the point is a lot of that complex heavy lifting should be done in your front end um so yeah I would encourage you to really read the token contract and then go to go back to token and then go to the app under Source you'll find a frontend implementation in Rust that allows you to interact with the contract and then there's a bunch of tests that also show you that you know use the front end then show you how to create a wallet how to sign how to do all the authentication Stuff how to you know invoke methods from from the front end to submit solutions to the contracts to change the state um and um yeah if you can digest everything in this particular application you'll probably be ready to to build anything you want um so yeah I will uh probably stop here we have five more minutes we'll if you have any questions or if you have I mean we can talk about questions now or after yeah so if you want to be like something like an amm and so essentially you will need math to calculate I know whatever tokens you're going to get on the other side how does that work do I like does the offchain computation like does everything un sense like the end desire results and then the constraints actually check the exactly that's the whole point of this whole thing oh so like all the like algorithmic competition is on chain off chain and then you just make sure whatever you're sending to the contract it is valid output yeah if the constraints allow it if the constraints are satisfied with that final solution then you're good then the Builder will build that solution will include in the next block the validators validated everything will be happy I see then the state will be committed and if one of the constraints fail then it's just going to get rejected um yeah that's literally the whole point of this this approach is just move the well there's many many objectives to this but one of the benefits is that we're moving that complex stuff off chain because you think about what a database is or what a blockchain is it's a database where all you get about is updating state from one one it's a state machine it's a state machine and so having you know doing everything and anything on chain is kind of a weird I mean it it's it's it's obviously useful in some cases but it's not not really the point of a blockchain in most cases for most applications and you know I know a lot of uh solidity applications try to do this in an indirect way where you know let's move as much stuff off chain and try to keep the contracts somewhat only caring about start and final State uh but in here in here it's all done at the protocol level everything is is uh is made for that purpose um so yeah yeah yeah we'll we'll talk about this more um I'll be here for the next uh two days and there's a lot of my colleagues who can talk to you about that stuff as well right thank you

Automatic transcript — names and jargon may be misspelled.