{"id":"9v2iZ1qJ4M8","title":"DevHub Live Workshop on Shade Agents","description":"🧠 DevHub Live: Build Autonomous Multi-Chain Agents with Shade Agents (Workshop with Owen from Proximity)\n\nWe’re back with a special DevHub Live session featuring Owen from Proximity Labs, diving deep into Shade Agents—a powerful new framework for building decentralized, trustless, and AI-capable agents that work across multiple blockchains.\n\nIn this hands-on workshop, Owen walks us through:\n✅ What Shade Agents are and why they matter\n✅ How to deploy verifiable, autonomous agents using TEE (Trusted Execution Environments)\n✅ How to fund and interact with agents that can sign and send transactions across NEAR, Ethereum, Solana, and more\n✅ A live demo showing how to build a Solana agent that randomly airdrops tokens to NFT holders\n✅ How to make agents autonomous using cron jobs, smart contract guardrails, and verifiable logic\n\n💻 This workshop is perfect for developers curious about:\n • On-chain AI agents\n • Multi-chain automation\n • Confidential & verifiable compute\n • Using LLMs in decentralized systems\n • Real-world agentic applications (DAOs, yield optimizers, oracles, and more)\n\n📚 Get started with the docs:\nhttps://docs.near.org\n\n🎥 Timestamped Chapters:\n0:00 – Intro\n2:30 – What Are Shade Agents?\n9:40 – Trustless vs Centralized Agents\n14:00 – Architecture Deep Dive\n24:50 – Quickstart: Deploying Your First Agent\n32:10 – Live Demo: ETH Price Oracle\n47:00 – Editing the Agent for Solana\n58:00 – Airdrop NFTs with Verifiable Randomness\n1:08:30 – Making It Autonomous\n1:14:50 – Deploying to TEE\n1:20:00 – Wrap-Up + How to Start\n\n💬 Got questions or want to show off your agent build? Drop them in the comments or join us on DevHub!\n\n#NEARProtocol #DevHubLive #ShadeAgents #Web3Dev #SmartAgents #ProximityLabs #MultiChain #Solana #Ethereum #AIagents #NEARAI #CryptoDev #DeveloperWorkshop #BlockchainAutomation","channel_name":"NEAR DevHub","published_at":"2025-07-23T00:00:00.000Z","thumbnail_url":"https://img.youtube.com/vi/9v2iZ1qJ4M8/hqdefault.jpg","transcript_text":"We are live today. We are back with a DevHub live. We haven't had one in a while. And I am excited that we are here today with Owen, not from DevHub, but from proximity. Uh here to talk about uh Shade Agents. This is a special workshop edition. And uh this is a good one. You guys are obviously been really popular lately online about some of the stuff that you've been doing with shade agents. I know people are very interested in how to actually get going. We've done some previous kind of workshops, but now it's been a little bit it's almost two months since the last workshop. So, I know things have gotten better and changed, so I'm excited for this one. So, Owen, I'm going to let you drive this and uh teach us all about shade agents. Awesome. Yeah, cheers. Well, thanks for having me um on again. Yeah, really excited to to to talk about shade agents and actually do some live programming, which is always a bit scary. You know, thing something will definitely go wrong, but we'll we'll roll with it as it comes. Um, this morning I sort of vive coded a a new a new example and we're going to base it upon upon that today. And yeah, we we've had some really interesting developments in like the shade agent stack that just basically makes it really quite easy to get started up with um a shade agent building on on whatever whatever chain you want really. And I guess the the purpose of this demo is to show you how simple it is and how you can get go ahead and and do it yourself. Um I think maybe we can get started with just like a bit of an overview of of what shade agents are. And I can start sharing my screen here. Uh let me just resize some things on my screen. Um, right. I'm going to try and here we could Could you put that up, please? Yeah. Cool. So, yeah, if you come to docs.nner.org and you head over to this recently new um tab here, AI and agents, you'll see there's uh shade agents under here. And the first thing we come into is what what are shade agents? Before you build one, you obviously want to know what one is. So basically, shade agents and the shade agent framework is this toolkit that allows you to build these decentralized and and trustless AI agents that can control accounts and assets across basically any blockchain, like 95% of blockchains. And these agents are really built to serve like multiple users trustlessly because um web three agents so far have mainly just been like for an individual user. we see with like bits. These are really good and like near AI. These are really good agents for interacting with the protocol and they're mostly like running on your your own device and you can trust this agent because it's running locally, right? Um and no one else is is interacting with it. But with shade agents, this allows you to build like protocols that have underlying a like agentic protocol uh agentic abilities and can interact with like the web 2 um and have similar security of blockchain. Um so previous agents right uh they were they sort of fell into two camps uh as you can see in the docks. First off, like the first set of agents, they're trustless and verifiable, uh, by running in trusted execution environments, uh, which is basically like an enclave inside a processor that you can't tamper with and you can verify like what code is running in there. But if this TE goes down, the private keys and the funds of the agent are lost, which is obviously not good because if the server just goes down, then you lose your accounts. You lose 100 Bitcoin or whatever was associated with those accounts. And then the sort of second option to try and solve this was that the agents are persistent, so the funds won't necessarily be lost. But to do this, the the agents are centralized and someone has that private key and can rug the system and do whatever what they want with it without you having any any say of it really. Um, and to go into like what you can build here. So shade agents as as we said they're they're AI powered. So you can access LLMs inside an agent verifiably. This today's use case is just going to be a nonAI use case because it's a bit simpler. They're multi-chain, custodial, verifiable. There is an optionality of them being confidential. So if you want to do some things like onchain, but have that be confidential because by default with a blockchain, you can you can see everything that's happening, right? But you can pass things in secretly to this this agent and then perform some action on chain and not really know why it's doing that action. Uh and they're they're flexible. So one of the real powers of shade agents is that you can interact with this like off-chain environment with the same sort of security as blockchain. Um, so you can basically build smart contracts that use LLM. So we've heard a lot about like AI president and AI DAO. So you can really implement this in reality with a shade agent because you can have this agent that is running against a certain like Dow's agenda and then vote on proposals like yes or no for the DAO. um and have that all be verifiable. And a big thing we're pushing here is like aentic protocols as well. So when we all came to web 3, we heard about like smart contracts and they were compared to like legal contract sort of by the name, but they also have smart in the name as well. And I I never really understood that because they're basically just verifiable functions that live on the blockchain and they don't really do anything except sit there and wait for some participant to interact with them. Mhm. Uh but with aic protocols here, what we're trying to do is that these are like autonomous smart systems that are actually proactive. So an example of this is like a yield optimizer that will always be trying to see like where can you get the best yield across protocols or across um different like chains as as they're multi-chain. So you're not just locking your tokens up in like one vault for one asset. with uh these energetic protocols you can really get the most bang for your for your buck. Um so let me I want to stop you just clarify some things for the audience here. So the the term agents being used here is not necessarily directed towards AI. It is more about being uh auton the agent the code is able to interact on its own. That's the agentic part of it. It is not necessarily about having to interact through using any kind of AI. Is that correct? Yeah, that's that's right. So, I think like an agent fundamentally is a piece of code or a system that can take its own actions based upon what it knows. Um and yeah, a lot of these systems will be sort of deterministic or running on on some algorithm and then others will actually be running like using an LLM to make those decisions and it really depends on on the use case for that. Right. Nice. And to get into a little bit about how they're actually working. So in this diagram you can see that we have an agent running in a TE and it has its own like near private key right and what this does this this agent it generates like an attistation that one it's running in a TE which is the attestation and it produces its code hash to say this is like the code I'm actually running and this it uses is the private key to send a transaction to the agent contract which actually lives on near um with this agent register agent function submits these details and the agent contract will verify the attestation and check against its own stored code hash and say like yes this is running in a TE and yes it's running the correct code that we expect and if those two things are ticked off. Then now the agent is registered in this contract and can use this request signature function where it can uh request signatures for like any arbitrary payload which they can then like sign a transaction to do something on sooie or or Salana that could be like a transfer or a function called to stake or uh to like vote on a a D proposal. And inside the system, we could also have like another agent that is actually identical to the first. And like why would you have why would you have two of the same agents? Um the the reason for this is that if this agent were to go down, then you always have like a live instance of an agent that you can always interact with. So you get some some livveness uh guarantees and yeah the the the great part is that if any agent goes down then as long as it's running the correct code and running of TE it can then again register and and do everything um it should be able to do any uh any thoughts on that? So I this is a really different architecture I think than most people are used to. So and I think I think you're going to get to this. So I I think the part that people should probably really pay attention to if this is new completely new to them is going to be like how you actually set this up because yeah there's a few different parts here that I think when you just look at this this diagram like it makes sense at a high level but I think implementation seems a little bit abstract and so I think what you guys are doing at proximity here with the actual shade agent itself is allowing it to be to kind fill in these gaps for them as a protocol and as a way to get to build this, not necessarily to serve every piece of this. Is that right? Like you guys are you guys are setting people up to allow them to fill in their own contracts and uh logic and APIs, not necessarily forcing people to stay wi within a certain subset. Correct. Right. Yeah. I mean the the framework's pretty flexible so you can build uh whatever you want really. Um the the framework is is set up to support most use cases in its like simplest flow, but you can if you see down here we have like deploying your own uh custom agent contract that allows you to do some more really like specific use cases. Um, but yeah, you can do basically anything anything you want in here. And it doesn't really have to be uh an agent as such. It could be like verifiable compute or or confidential compute as such, right? Um, so yeah, I think now we can just go in and actually deploy an agent. So if you come to the docs and to the quick start, this will guide you through how you actually go and deploy this example agent we have. Um, as you'll see in here, there's a few prerequisites, but uh I mean I've I've done this a few times, so I already have them downloaded, so I'm not going to go through that. But basically you just need some near and shade agent tooling and you'll need to create an account which uh which will do um which we'll actually do and you need to have like docker installed and to to host the tees we're using this uh provider called fer cloud and uh yeah it's a really nice system where you can just basically run a docker image inside of the te and It produces all like the artistation reports and everything for you. Is that what you're doing? So just to be clear too here for this. So that is the requirement of building this is you need to generate that docker image to run in the TE. Yeah. So uh we have this like CLI that that hides everything under the hood really and this will basically build your Docker image push it to Docker Hub so it's like accessible by the TE and then it's going to deploy like an agent contract um this like agent contract under the hood um just like a like a really basic one that that can handle most use cases and then it's going to do this like registration process automatically when the agent boots up. Nice. Yeah. So people who are uncomfortable with Docker, you you don't have to now understand and learn Docker, if you've never really used it or got into it or you just didn't like it, this handles all of that aspect for you. Yeah. I mean like you don't need to know about Docker. you can just run shade agent CLI as a command and it will do everything for you. But I mean it's it's always good to have knowledge about the particulars, right? So you can really optimize your uh your agent to do what you need it to do because you can't create the template that will be be best for all as much as we try. Right. Of course. Uh so yeah, this is our template here which is actually just like a verifiable oracle that pushes the price of ETH to a Sapoleia contract. And like how this differs from say chain link or or pith is that this is just only needing to run on one node. Um because the verifiability is coming from the TE whereas with chain link you need to run it on on like 20 nodes or or whatever it may be. So you're saving yourself like 10 uh like 20 times on on compute basically. Uh so yeah, we'll we'll actually get in and and clone this stuff here. So I just have a terminal open here. uh can't spell and I'll enter in this and open it up in the best code editor cursor. So I'll just walk through a bit what this template looks like. So in our in our source folder is where all the code for the agent lives. Um, and in here basically what a shade agent is with like the agent part of the shade agent is just a server that would be running it's like some backend service that would be running and this could be like exposing API routes or it could be uh running like in a in a cron right on repeat. So, what this one is, let me just install dependencies here so I don't get a load of horrible squiggly lines. Um, yeah, this this one is just a server that exposes API roots. So, we have this like ETH account, agent account, and transaction route. And it's exposing it on like port 3000. And if we go into our roots, we can look at each of them. So this agent account basically just gets the account ID of the agent that we were talking about in the in the docs before that has its like own private key that maps to um an agent address. And then also getting the balance for it. So because it's using some like gas, we need to make sure it's always topped up. So we could just call like um SL like local ho if I'm running it locally like localhost slappi/ agent account and that'll give us our uh agents account ID and its address. And then there's also this ETH account um thing that basically does the same as the previous, but it's for like the shade agents uh account as a whole. And this is like an Ethereum address that is controlled by the shade agent. And since this is like an oracle price pusher, we we need an account to like push the price of ETH. And yeah, we we're checking its balance as well to make sure it has enough gas. And then the magic is really happening in this not the magic, but the the core logic is really happening in this uh call this transaction route. I don't know the the framework is the magic. This is just the the meat of it, I guess. Yeah, sure. The meeting. Uh so what this does is it fetches the price of ETH just from some util file we have down here. Uh and this is just taking the average from two APIs. This is from like OKX API and Coinbase API. Then it creates a transaction to set the price of ETH. Uh and it gives you like the transaction payload to sign. And what you'll do is you'll use this request signature function from uh shade agentjs which is a library that we provide and that's going to sign this transaction payload you created before um which will then return like just a signature for that transaction and you'll plop it all together to get a signed transaction and then you just broadcast that to to the Ethereum network. Um, and I can I can give a show of what this actually will like look like. So, uh, I think this should work. So, you can actually like this front this actually has a front end with it that you can locally host to interact with this. I mean, you could just interact with the APIs themselves, but we we include a front end here to make it a bit nicer. So, you can see uh you can see what the price of ETH is. Uh I mean that that's that's increased a bit recently. So, one second here. So, I want to just so we're keeping up. So this front end that's in here is all part of this docker image that is getting deployed to the failure network which is the TE correct? Uh so this is like an old version which that actually was but we split it up now. So all that's getting deployed now is this server bit and then the front end lives separately but this is what you'll see if you like locally host your front end. This one's just hosted. So it shows your like worker account ID uh like your agent account ID and its balance and it shows you uh the sapoleia like the Ethereum account and its balance and then you can click here which will then update the price of ETH. Now, if you make this autonomous, is it something where you have to be conscious of actually having a function in there that you can stop it? Like, how do you I mean, I guess the way you stop it is you shut down the TE, but like like what if it starts going rogue? Like, is what is the process there when you start to consider building out something? Yeah. So like in reality for this Ethereum price pusher we have it we have it just as API routes but you should really build it in a loop so it's it's pushing by itself. Um and in the case of it going rogue as such. I think you just design your agent so it can't. And the great thing about shade agents is we have the agent contract there and you can like smart contracts are really strict in what they can do and you should design your agent contract such that it doesn't allow for bad actions because LLMs can spit out anything really. So, you should allow it to spit out whatever it wants, but then your agent contract should say, \"Hey, this transaction doesn't seem quite right. I'm not going to permit it.\" Or like, \"This is an action that this agent should usually take, and it's the best action that it should be taking to like optimize your your yield or whatever.\" And then it will permit you to take that action. So you can really bake in some like guard rails here. So again I I want to just make this super clear for everybody here. So I've now I deploy my Docker image on my TE which is through um that is going to have all of these different actions. I then have a smart contract that is deployed on near right. Yeah. That is then like the manager of that. And so I may have logic in my image that is doing particular actions but then I have what's I would like a controller that is the smart contract uh that is given the yes you know thumbs up thumbs down to these behaviors. Is that do I have that right? Yeah. Yeah. Absolutely. Like I mean in in the most basic version it just allows any action um in the contract to make it flexible but for production apps you should really be setting these guard rails um and the agent contract has these like strict rules right so so yeah you were right um so going back to this this repo in here we also have some like docker specific stuff and this is what is going to get deployed to fa cloud and we have this like API image that makes it easier to interact with the agent so you don't need to know anything about any details about the agent contract really and you don't need to know any details about like how tees work we just handle all of that behind the hood and then you have your your app image as well uh inside of there. Nice. So to deploy this, you actually need some environment variables which we'll go ahead and and fill out. I'm just changing getting rid of the example bit here. So first we'll create a near account uh which I'm just doing with like the near CLI. We'll sponsor it by the faucet. We'll call what you want to call it. Um, Devub live. I feel like that's going to be taken. Let's see. Deub live 4. Wait, what? Do Do we have the episode number like 53 or something? Something like that. It would be that. Yeah. Debub live 1000 test net. Um, hopefully no one's taken that one. I'm just going to print the the credentials to uh the terminal. Please don't rock my test net tokens whilst demoing. So, you just need just need to like copy and paste your your seed phrase here. Yeah. And your uh what did we even call it? Your account ID. Plop that in there. And then this like contract ID bit, this is where your agent contract is going to get deployed by to. This is a sub account of your near account. Uh and we have like two settings for this. So we have agent contract proxy and we also have this option of sandbox. So the the proxy this is for like local development and it doesn't require this like attistation because since you're going to be running it locally you can't actually provide an attistation. So you can't interact with it if you're requiring one. Uh right. So we just have that that for local testing. But this sandbox one here actually requires the act station and this is what you use in in production. I'm just going to change this to dev hub live. Uh this is like the project name on docker hub. Yeah. And we need if we're actually uploading to Fallow, we'll need an API key. Um, I'm just going to like hide this because I don't want like you can have my test net stuff, but I don't want you having my my Falor API keys. Um, but I'll just generate one. Uh, you just go to Fowler cloud dashboard. come over to your I think it's over here. Your API tokens um don't know why that's not loading. We'll give it a minute. It's my account settings. Yeah, I don't I don't know why these it won't give me access to my API. Well, we'll we'll figure that out later or we'll uh just run it locally, I guess. Um so I can show the local flow instead here. Sure. Uh so we've got it set to AC proxy. So you just run shade agent CLI which is going to deploy this this uh API image and run it locally and then we need to use we need to run our actual uh app locally as well. So we can do that with npm rundev and that's going to give us yeah it's running on on port 3000. So if I open this up. Ah I think I had some tokens before. I'll actually create a token now. Um it's not it's not showing me what the token is now. Any we'll we'll keep doing it locally. Um, so if I go to localhost 3000, it shows me my app is running and I can do api slash e uh account which is going to show me like my Ethereum account and its balance. And then I can also do the transaction one to set the price of ETH but it it's not going to uh we can right we can fund it here. Um, let me copy this address fund it with uh 0.01. That should be enough. We can also see our agent account here as well. And that has balance there because we auto fund it on deployment. Uh, it has balance now. So we should be able to call this transaction route which is going to call the agent contract under the hood call the MPC service and then give us a transaction back. So we get a transaction hash here which we can look on explorer to see it was executed and then we get the new the new price which has gone down since it was last set. Um and I actually have an API token now. It finally appeared. So, let me just set that off screen. Sure. Um. Oh, okay. Cool. So, I can change this to AC sandbox here now and run again. Uh, just close this one. If I run shade agent CLI, this is now actually going to build a Docker image for my app, not just the the API image. And it's going to take all of these and then deploy it to Fer Cloud in a minute. And we have we need to pass some like environment variables and we have this Docker compose, but the CLI matches everything up. So, it makes sure we're deploying the correct image directly after it's built. And this is all automatically updated. Uh, and we can see, yeah, that didn't take that long to deploy, but we can open it now in Fell Cloud. We should be able to see Yap DevHub live. And it's going to take a bit to boot up, but what we'll be able to do in a minute is take this URL down here and it'll probably give us an error now. Yeah. But once it's booted up, it will say like app is running and we'll be able to interact with the the roots like we were before. um but just an actual verified service in a TE rather than than running locally. So you can see app is running. Then if we do API slash uh agent account, we can get that agent account again but this is actually in a in a TE here. So the agent account, why is that in an implicit address versus didn't you isn't it creating one when you add the the sub account? Um so the the sub account this is the agent contract not the agent address itself. Um because like an agent needs to be unique and it's the the agent like private key is randomly generated based upon the TE's hardware. Um so it's it's going to be some random private key and then that's mapped to an address. Uh, and then like we're it has balance because we're just funding it with this account and that's why we're passing our seed phrase so we can auto fund it basically. Uh, okay. Well, actually I spent a fair bit time like explaining stuff, but we can go ahead and start editing this. So what I want to do is like my example before I I created earlier today was this system on Salana that will like randomly pick a holder of an NFT and airdrop them some Salana. So, the first thing we're going to do is set up um set up like a a new function. So, instead of getting the price of ETH, we're going to want to get the um get like a random NFT holders account. And to do this, we can use this. I don't know if you've heard of uh Helas and like everyone knows M I guess who is the CEO of of of Helas, but they explore some pretty cool APIs and one of them is get um just get the owners of like an NFT collection. So, we have this get assets by collection function which we can pop in here and and we'll set the collection address in a minute um here. And the one we want to actually use is this one down here. So, we can set that. And this is I think it's called like Mad Yeah, Mad Lads collection. Um, so we'll call this collection address and set it to that. And I'm just going to pop over to my thing I did earlier to try and remember what I was doing next. Um, so yeah, we have this this function that is going to get the assets in a collection. We can just remove this because we're storing it as a constant. And we can call it uh get assets by collection. We need to set an API key which I'm just going to copy some code over. Um I need to import M. There we go. Cursor is amazing. So, we need a Helas API key, which I'm going to set in my environment variables, but off screen again because I don't want you see my Helas keys either. Um, so in my environment variables, I'm just setting Helius API key, which I'm going to set to just grab that. Um, pop that in real quick. Okay, so I've set that in my environment variables and I can bring it on back on screen now and we should be able to actually test this now. So if I do get assets by collection, I can't remember what the command is to run. So if we do tsx source utils uh we'll rename this to get account uh get salt account I think utils get salt I need to update some things in here. Uh we can we can worry about that later. I didn't print anything. So that's probably why it did nothing. So yeah, this returned like a load of a load of responses. Uh but just cuz we're running out of time here a little bit, I'm going to copy over some some code. I'm trying to find Here we are. So, yeah, just to skip ahead a little bit, we can replace this with uh with this. So, it's it's getting we've edited the code to get all the assets in a collection essentially. And because before we were just fetching like the first 100 as you can see here, but this collection actually has like 9,000 in them. So we're just going to iterate all over all of them and then add that to a list. And then we're going to once we have that list, we're just going to select a random one of them where you can see like the math.random random and just pick a random item in that list and then that's going to submit an owner address. So I can use that now get Salana address and run that and this should produce a different account ID uh each time it takes a little while because it has to query it a bunch of times. Sure. And and in this scenario too, so now you you get the information back, you get that wallet back and now your contract is going to be the one to then through chain signatures whatever then actually follow through or are you doing that still within this agent code here? So, what I'm going to do is like I'm going to get this address and then I'm going to do something with that address inside of the Asian, but we obviously need to um we obviously need to like change the code further to work for Salana. Does that answer your question or Yeah. Yeah, I think I think that's that that's a good I mean obviously there's a lot you can go different paths down here, but the key is that the the logic in that kind of those actions stay within here. So it doesn't force users to then have to write overly complex smart contracts to then handle this. You can really actually just continue writing in Typescript and get all your actions done. Yeah, exactly. I mean, we're trying to design it so it's language agnostic as well, but with this simple example, you don't need to go ahead and and actually um you don't need to edit, right, the agent contract. You're just writing TypeScript like you say. Nice. Um and baked in here, we had this like Ethereum.ts TS file. Yeah. But I'm gonna since we're working with Salana, I'm going to update that to Salana obviously. And delete all of this. We don't need any of that cuz we're not calling a contract. We don't need that. And I'm just going to update it to um some Salana specific thing. So, we need this like connection thing which will allow us to connect to an RPC on Salana. I think I'll have to import is it npm npm add or no mpm I right and then just install that dependency. Um, so I can create this will change this stay the same cuz we're interacting with like uh the MPC contract still. Uh, I'll set up a Salana connection and just copy over a URL here. And now we're going to be setting up um a Salana chain adapter. So because we're obviously using Salana here instead of EVM and this one is called uh Salana uh oh we can just have Salana connection and that should work. So this is this is all set up to interact with Salana now. And we're actually using this exported chain adapter in this transaction folder uh transaction file here. So we're going to adapt this to uh actually first we'll adapt this ETH account to Salana account so we can get the Salana details instead of Ethereum details. So, I just need to import Salana instead and change everything to be Salana specific. I mean, that was that was pretty quick. But in this transaction thing, we need to do a bit more. We don't need any of this. We just need to import Salana. Uh yeah, we're now calling this function get Salana address. We don't need this contract stuff. Um, and then we can just go ahead and update this. So, we'll call this receiver address here. Recipient address. I guess we were doing we were like creating a function call here before in Ethereum because we were like calling a function on Ethereum contract but instead we're just going to be sending some like Salana to someone. So it's a bit simpler. we can just delete all this function and um instead we need to derive the the account again that's going to be pushing uh going to be sending that transaction. We're actually going to send this to um public key because the public key of a Salana um account is actually the same as the Salana address. M and I need to copy that code over to here. So we need the recipient address but we also need the sender address which is also the public key and then we can construct a transaction now uh not here down here. So we were using this function get price payload before but we can prepare a transaction to sign. Let's just yeah I don't know cursor is bogging out here. I'll just copy that. So we're preparing a transaction here which is sending from my address I'm deriving which is my shade agent controlled salana account. We're getting the recipient address from this function we created before. Mhm. And we're selecting the amount to send here, which is going to be 0.1 Salana. Um, and then we're going to request the signature. So, I need to change the path. The path is what sets which Salana account we're using because a shade agent can have like an infinite amount of Salana accounts uh or an infinite amount of Ethereum accounts. So we're just setting this to one of them. I think we need to change some details here. Uh so yeah, Salana uses like a different signature scheme to uh to Ethereum. So this one is using EDDDSA and we need to swap this to Salana. There's some weird Salana specific. So we need to specify the transaction here but the actual transaction is part of a transaction object. So we're going to get transaction from transaction. Yeah. Um, and we do we get the we retrieve the signatures a little differently which I'm gonna copy over here because we need to basically the different signature schemes have different formats. So we just need to have this bit of code to transform it to the signatures that this function expects. And we're going to need to set the sender address uh as well, which is the public key. Uh as we said, they're the same. Change this to Salana and we'll we'll return the recipient address. So I think I think this should work. Um, so what this is basically going to do when we're calling this this transaction route now, it's going to fetch a random account ID from uh from this list from this like NFT collection. is going to select a random NFT and who is the owner of that NFT and then airdrop them some Salana because maybe the creators want to have this verifiable service that rewards uh its NFT holders and then so it's going to select this address and then basically construct a transaction and send that through the shade agent. So, if I set this to we'll set it to local first to make sure everything is working. Um, let me just make check one thing. I think I need to update this. So, yeah, let's just make some naming a little nicer. um agent sol account. So yeah, let's set this to import sol count. There we go. Yeah, just a bit of nicer naming. And we can run the CLI again. And let's see if this spits out any errors here. So, it's creating our um our agent contract under the hood, initializing it with the code hash and running it locally. And then I'm going to run that my app locally as well. And let's see if we can do something here. So, let me just check it's running first. So my app is running and we'll check if we can get our Salana account. So salt account and yeah we see it produces a salana account now and has our balance. So I just actually give this agent some balance now. Um here we go. Recipient address. Let's send it 0.5 Salana. And we should be able to call this just in a minute. And we'll see it has more balance. It might take a while. I don't know how long it takes to send. There we go. I have balance now uh from what I just sent. And now I should be able to call this transaction route to randomly select an NFT holder and airdrop them some Salana. And the good thing about this is that people can verify that this selection is like completely random and that it's actually sending it to a uh an NFT holder. Nice. Awesome. Well, we'll see if it's awesome in a minute to see if it actually Oh, there we go. There we go. It looks like it worked. So, it's selected this this address and it's given us a transaction hash. So, I'll copy this and go to Salana DevNet Explorer. Paste that in here. And let's see what this did. It sent 0.1 Salana to this random account NFT holder. So, it did what we wanted on a live demo, which is pretty unusual. Um, and one last thing we'll do here is actually go ahead and and deploy it to to the TE because this isn't verifiable yet. But once we deploy to the TE it should be so shade agent CLI build our docker image push the docker image in a second once that's built any second it's taking a bit of time any questions whilst the the docker image is building. Joe, I think Joe might have I think Joe might have disappeared for a second. I'll take over, I guess. Um, yeah. So it's just deploying everything under the hood and approving these code hashes, the API code hash, the app code hash, and it's deployed onto Fer Cloud now, which I can show over here. This just take a minute to load up again. What I really wanted to do in in this session was actually modify this repo um to be like what I created earlier which actually just runs this system on like a cron job. So instead of calling an API route, it will just loop every like 24 hours and send Salana like autonomously. So it's just behaving by itself and you don't have to interact with anything. And to do that basically you just write the same code but instead of having it as a root we've removed our transaction route and put it in this like cron folder. And when the server boots up um when the server boots up, it's has this function to check whether it should start the crown job yet. And when it's going to start the chron job is when the derived account balance is over 0.5. So we're checking the account actually has some salana to deposited to run this system. And once this turns to true, then it's funded and it should start the crown. Then it's going to uh run one job immediately. So it will do this random selection and then it will run again every X period. So I set it to a minute, but you could set it to be 24 hours or whatever cadence you want. So it's it's pretty simple to to change that into be like an autonomous system. Uh and we can see this is live now. So I'll grab my deployment ID and actually interact with it. So API slash soul uh account. I think I might have to fund it again. Uh, don't know why that didn't work. It might have not booted up yet. Let's check. Uh, maybe I copied it wrong. Who knows? Maybe something in the demo did go wrong. Uh, let's refresh and check out the logs here. Ah, I know what I did wrong. I need to actually pass so it's running fine locally, but I need to actually pass my Helios API key um into the Docker Compose file and then this system should work. Now, let me delete these ones. Delete this one. It just it should be a bit quicker this time. Yeah, we have cashing on so everything's going pretty rapid. Let's see where we're up to. Okay, it says it's deployed. We'll see if that's true. Yeah, it's just taking some time to boot up, but we can we can get ready. So once this goes green, we should be able to actually check it. takes about um normally takes about a minute to deploy um and initialize like all the contract stuff and build the image and then it'll take about a minute to uh get the the TE app operating. So this should say it's yeah it's it's running now. It's going to take a minute to Oh, everything is is up and running it seems. So, let me check what the Salana account is here. I guess it wasn't working. Maybe it's taking some time solid address. Maybe it's Here we go. Or did I call it soul account? Did I call it soul account? Ah, I called it soul account. So again, we can fund that now um with a bit of soul. I'll give it 0.5 again. And once that is in there, we can run the transaction. Come on, give me my Salana. Okay, cool. We're funded. Let's do it. So, we should get this success again. And yeah, you can see this is actually running in a TE now, which is pretty cool. And we can like verify it's running in a TE by by just checking the smart contract because it could only register if it it's running in a T. So that's all handled for us. Cool. Once again, we have a transaction address, a transaction hash, and a new recipient of this eyrop. Cool. Um, yeah, that's that's that's pretty much everything. I just encourage you to go ahead and and try this out for yourself. Try building um try building your own shade agent. If you head over once again to docs.n org and go to AI and agents shade agents and then the quick start. You'll see step by step how you can do all of this by yourself and look into the structure of the project. Uh how everything's working and then how you can actually modify this example to do do what we did. And I'm going to try and stop the stream here. We'll see how that works. Uh not quite sure if I can do that. We'll see. Well, see you in another life. Goodbye and thank you for watching.","transcript_synced_at":"2026-11-03T03:51:12.985Z","segments":[{"start_seconds":16,"text":"We are live today. We are back with a DevHub live. We haven't had one in a while. And I am excited that we are here","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=16s"},{"start_seconds":25,"text":"today with Owen, not from DevHub, but from proximity. Uh here to talk about uh","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=25s"},{"start_seconds":32,"text":"Shade Agents. This is a special workshop edition. And uh this is a good one. You guys are obviously been really popular lately online about some of the stuff","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=32s"},{"start_seconds":40,"text":"that you've been doing with shade agents. I know people are very interested in how to actually get going.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=40s"},{"start_seconds":44,"text":"We've done some previous kind of workshops, but now it's been a little bit it's almost two months since the last workshop. So, I know things have","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=44s"},{"start_seconds":52,"text":"gotten better and changed, so I'm excited for this one. So, Owen, I'm going to let you drive this and uh teach us all about shade agents.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=52s"},{"start_seconds":61,"text":"Awesome. Yeah, cheers. Well, thanks for having me um on again. Yeah, really excited to to to talk about shade agents","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=61s"},{"start_seconds":69,"text":"and actually do some live programming, which is always a bit scary. You know, thing something will definitely go","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=69s"},{"start_seconds":76,"text":"wrong, but we'll we'll roll with it as it comes. Um, this morning I sort of","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=76s"},{"start_seconds":83,"text":"vive coded a a new a new example and we're going to base it upon upon that","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=83s"},{"start_seconds":90,"text":"today. And yeah, we we've had some really interesting developments in like the shade agent stack that just","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=90s"},{"start_seconds":97,"text":"basically makes it really quite easy to get started up with um a shade agent","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=97s"},{"start_seconds":105,"text":"building on on whatever whatever chain you want really. And I guess the the purpose of this demo is to show you how","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=105s"},{"start_seconds":113,"text":"simple it is and how you can get go ahead and and do it yourself. Um I think","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=113s"},{"start_seconds":120,"text":"maybe we can get started with just like a bit of an overview of of what shade agents are. And I can start","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=120s"},{"start_seconds":130,"text":"sharing my screen here. Uh let me just resize some things on my screen.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=130s"},{"start_seconds":136,"text":"Um, right. I'm going to try and here we could Could you put that up, please?","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=136s"},{"start_seconds":145,"text":"Yeah.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=145s"},{"start_seconds":146,"text":"Cool. So, yeah, if you come to docs.nner.org and you head over to this recently new","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=146s"},{"start_seconds":156,"text":"um tab here, AI and agents, you'll see there's uh shade agents under here. And","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=156s"},{"start_seconds":164,"text":"the first thing we come into is what what are shade agents? Before you build one, you obviously want to know what one","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=164s"},{"start_seconds":172,"text":"is. So basically, shade agents and the shade agent framework is this toolkit that allows you to build these","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=172s"},{"start_seconds":179,"text":"decentralized and and trustless AI agents that can control accounts and assets across basically any blockchain,","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=179s"},{"start_seconds":188,"text":"like 95% of blockchains. And these agents are really built to serve like","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=188s"},{"start_seconds":197,"text":"multiple users trustlessly because um web three agents so far have mainly just","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=197s"},{"start_seconds":204,"text":"been like for an individual user. we see with like bits. These are really good and like near AI. These are really good","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=204s"},{"start_seconds":212,"text":"agents for interacting with the protocol and they're mostly like running on your your own device and you can trust this","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=212s"},{"start_seconds":221,"text":"agent because it's running locally, right? Um and no one else is is interacting with","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=221s"},{"start_seconds":229,"text":"it. But with shade agents, this allows you to build like protocols that have","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=229s"},{"start_seconds":236,"text":"underlying a like agentic protocol uh agentic abilities and can interact with like the web 2","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=236s"},{"start_seconds":245,"text":"um and have similar security of blockchain. Um so previous agents right","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=245s"},{"start_seconds":254,"text":"uh they were they sort of fell into two camps uh as you can see in the docks.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=254s"},{"start_seconds":258,"text":"First off, like the first set of agents, they're trustless and verifiable, uh, by running in trusted execution","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=258s"},{"start_seconds":266,"text":"environments, uh, which is basically like an enclave inside a processor that you can't tamper with and you can verify","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=266s"},{"start_seconds":275,"text":"like what code is running in there. But if this TE goes down, the private keys and the funds of the agent are lost,","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=275s"},{"start_seconds":283,"text":"which is obviously not good because if the server just goes down, then you lose your accounts. You lose 100 Bitcoin or","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=283s"},{"start_seconds":291,"text":"whatever was associated with those accounts. And then the sort of second option to try and solve this was that","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=291s"},{"start_seconds":300,"text":"the agents are persistent, so the funds won't necessarily be lost. But to do this, the the agents are centralized and","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=300s"},{"start_seconds":308,"text":"someone has that private key and can rug the system and do whatever what they want with it without you having any any say of it really.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=308s"},{"start_seconds":319,"text":"Um, and to go into like what you can build here. So shade agents","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=319s"},{"start_seconds":326,"text":"as as we said they're they're AI powered. So you can access LLMs inside an agent verifiably.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=326s"},{"start_seconds":334,"text":"This today's use case is just going to be a nonAI use case because it's a bit simpler. They're multi-chain, custodial, verifiable.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=334s"},{"start_seconds":343,"text":"There is an optionality of them being confidential. So if you want to do some things like onchain,","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=343s"},{"start_seconds":352,"text":"but have that be confidential because by default with a blockchain, you can you can see everything that's happening,","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=352s"},{"start_seconds":360,"text":"right? But you can pass things in secretly to this this agent and then perform some action on chain and not really know why it's doing that action.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=360s"},{"start_seconds":371,"text":"Uh and they're they're flexible. So one of the real powers of shade agents is that you can interact with this like","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=371s"},{"start_seconds":379,"text":"off-chain environment with the same sort of security as blockchain. Um,","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=379s"},{"start_seconds":386,"text":"so you can basically build smart contracts that use LLM. So we've heard a lot about like AI president and AI DAO.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=386s"},{"start_seconds":395,"text":"So you can really implement this in reality with a shade agent because you can have this agent that is running","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=395s"},{"start_seconds":403,"text":"against a certain like Dow's agenda and then vote on proposals like yes or no for the DAO. um and have that all be verifiable.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=403s"},{"start_seconds":416,"text":"And a big thing we're pushing here is like aentic protocols as well. So when we","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=416s"},{"start_seconds":424,"text":"all came to web 3, we heard about like smart contracts and they were compared to like legal contract sort of by the","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=424s"},{"start_seconds":432,"text":"name, but they also have smart in the name as well. And I I never really understood that because they're","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=432s"},{"start_seconds":439,"text":"basically just verifiable functions that live on the blockchain","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=439s"},{"start_seconds":446,"text":"and they don't really do anything except sit there and wait for some participant to interact with them. Mhm.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=446s"},{"start_seconds":455,"text":"Uh but with aic protocols here, what we're trying to do is that these are like autonomous","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=455s"},{"start_seconds":464,"text":"smart systems that are actually proactive. So an example of this is like a yield optimizer that will always be","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=464s"},{"start_seconds":474,"text":"trying to see like where can you get the best yield across protocols or across um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=474s"},{"start_seconds":483,"text":"different like chains as as they're multi-chain. So you're not just locking your tokens up in like one vault for one","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=483s"},{"start_seconds":490,"text":"asset. with uh these energetic protocols you can really get the most bang for your for your buck. Um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=490s"},{"start_seconds":498,"text":"so let me I want to stop you just clarify some things for the audience here. So the the term agents being used","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=498s"},{"start_seconds":506,"text":"here is not necessarily directed towards AI. It is more about being uh auton the","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=506s"},{"start_seconds":514,"text":"agent the code is able to interact on its own. That's the agentic part of it.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=514s"},{"start_seconds":520,"text":"It is not necessarily about having to interact through using any kind of AI. Is that correct?","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=520s"},{"start_seconds":526,"text":"Yeah, that's that's right. So, I think like an agent fundamentally is a piece","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=526s"},{"start_seconds":533,"text":"of code or a system that can take its own actions based upon what it knows. Um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=533s"},{"start_seconds":541,"text":"and yeah, a lot of these systems will be sort of deterministic or running on on some algorithm and then others will","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=541s"},{"start_seconds":549,"text":"actually be running like using an LLM to make those decisions and it really depends on on the use case for that.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=549s"},{"start_seconds":557,"text":"Right. Nice.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=557s"},{"start_seconds":560,"text":"And to get into a little bit about how they're actually working. So in this diagram you can see that we have an","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=560s"},{"start_seconds":567,"text":"agent running in a TE and it has its own like near private key right and what","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=567s"},{"start_seconds":575,"text":"this does this this agent it generates like an attistation that one it's running in a TE which is the attestation","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=575s"},{"start_seconds":585,"text":"and it produces its code hash to say this is like the code I'm actually running and this it uses is the private","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=585s"},{"start_seconds":594,"text":"key to send a transaction to the agent contract which actually lives on near um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=594s"},{"start_seconds":600,"text":"with this agent register agent function submits these details and the agent contract will verify the attestation and","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=600s"},{"start_seconds":610,"text":"check against its own stored code hash and say like yes this is running in a TE and yes it's running the correct code","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=610s"},{"start_seconds":619,"text":"that we expect and if those two things are ticked off.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=619s"},{"start_seconds":624,"text":"Then now the agent is registered in this contract and can use this request signature function where it can uh","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=624s"},{"start_seconds":633,"text":"request signatures for like any arbitrary payload which they can then like sign a transaction to do something","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=633s"},{"start_seconds":640,"text":"on sooie or or Salana that could be like a transfer or a function called to stake or uh to like vote on a a D proposal.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=640s"},{"start_seconds":651,"text":"And inside the system, we could also have like another agent that is actually identical to the first. And like why","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=651s"},{"start_seconds":660,"text":"would you have why would you have two of the same agents? Um the the reason for","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=660s"},{"start_seconds":667,"text":"this is that if this agent were to go down, then you always have like a live instance of an agent that you can always","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=667s"},{"start_seconds":676,"text":"interact with. So you get some some livveness uh guarantees and yeah the the the great part is that if any agent goes","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=676s"},{"start_seconds":685,"text":"down then as long as it's running the correct code and running of TE it can then again register and and do","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=685s"},{"start_seconds":694,"text":"everything um it should be able to do any uh any thoughts on that? So I this","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=694s"},{"start_seconds":703,"text":"is a really different architecture I think than most people are used to. So and I think I think you're going to get","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=703s"},{"start_seconds":711,"text":"to this. So I I think the part that people should probably really pay attention to if this is new completely new to them is going to be like how you","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=711s"},{"start_seconds":720,"text":"actually set this up because yeah there's a few different parts here that I think when you just look at this this diagram like it makes sense at a high","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=720s"},{"start_seconds":728,"text":"level but I think implementation seems a little bit abstract and so I think what you guys are doing at proximity here","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=728s"},{"start_seconds":735,"text":"with the actual shade agent itself is allowing it to be to kind fill in these","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=735s"},{"start_seconds":742,"text":"gaps for them as a protocol and as a way to get to build this, not necessarily to","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=742s"},{"start_seconds":749,"text":"serve every piece of this. Is that right? Like you guys are you guys are setting people up to allow them to fill","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=749s"},{"start_seconds":756,"text":"in their own contracts and uh logic and APIs, not necessarily forcing people to stay wi within a certain subset.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=756s"},{"start_seconds":767,"text":"Correct.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=767s"},{"start_seconds":769,"text":"Right. Yeah. I mean the the framework's pretty flexible so you can build uh whatever you want really. Um the the","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=769s"},{"start_seconds":778,"text":"framework is is set up to support most use cases in its like simplest flow, but you can if you see down here we have","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=778s"},{"start_seconds":787,"text":"like deploying your own uh custom agent contract that allows you to do some more really like specific use cases. Um, but","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=787s"},{"start_seconds":796,"text":"yeah, you can do basically anything anything you want in here. And it doesn't really have to be uh an agent as","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=796s"},{"start_seconds":803,"text":"such. It could be like verifiable compute or or confidential compute as such, right?","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=803s"},{"start_seconds":811,"text":"Um, so yeah, I think now we can just go in and actually deploy an agent. So if you come to the docs and to the quick","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=811s"},{"start_seconds":820,"text":"start, this will guide you through how you actually go and deploy this example agent we have. Um,","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=820s"},{"start_seconds":829,"text":"as you'll see in here, there's a few prerequisites, but uh I mean I've I've done this a few","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=829s"},{"start_seconds":837,"text":"times, so I already have them downloaded, so I'm not going to go through that. But basically you just need some near and shade agent tooling","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=837s"},{"start_seconds":845,"text":"and you'll need to create an account which uh which will do um which we'll actually do and you need to have like","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=845s"},{"start_seconds":853,"text":"docker installed and to to host the tees we're using this uh provider called fer","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=853s"},{"start_seconds":860,"text":"cloud and uh yeah it's a really nice system where you can just basically run","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=860s"},{"start_seconds":866,"text":"a docker image inside of the te and It produces all like the artistation reports and everything for you.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=866s"},{"start_seconds":874,"text":"Is that what you're doing? So just to be clear too here for this. So that is the requirement of building this is you need","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=874s"},{"start_seconds":882,"text":"to generate that docker image to run in the TE.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=882s"},{"start_seconds":889,"text":"Yeah. So uh we have this like CLI that that hides everything under the hood really and this will basically build","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=889s"},{"start_seconds":898,"text":"your Docker image push it to Docker Hub so it's like accessible by the TE","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=898s"},{"start_seconds":905,"text":"and then it's going to deploy like an agent contract um this like agent contract under the","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=905s"},{"start_seconds":912,"text":"hood um just like a like a really basic one that that can","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=912s"},{"start_seconds":918,"text":"handle most use cases and then it's going to do this like registration process automatically when the agent boots up.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=918s"},{"start_seconds":928,"text":"Nice. Yeah. So people who are uncomfortable with Docker, you you don't have to now understand and learn Docker, if you've never really used it or got","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=928s"},{"start_seconds":936,"text":"into it or you just didn't like it, this handles all of that aspect for you.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=936s"},{"start_seconds":941,"text":"Yeah. I mean like you don't need to know about Docker. you can just run shade agent CLI as a command and it will do","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=941s"},{"start_seconds":949,"text":"everything for you. But I mean it's it's always good to have knowledge about the particulars, right? So you can really","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=949s"},{"start_seconds":956,"text":"optimize your uh your agent to do what you need it to do because you can't create the template that will be be best for all as much as we try.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=956s"},{"start_seconds":967,"text":"Right. Of course. Uh so yeah, this is our template here which is actually just like a verifiable oracle that pushes the","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=967s"},{"start_seconds":976,"text":"price of ETH to a Sapoleia contract. And like how this differs from say chain","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=976s"},{"start_seconds":984,"text":"link or or pith is that this is just only needing to run on one node. Um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=984s"},{"start_seconds":992,"text":"because the verifiability is coming from the TE whereas with chain link you need to run it on on like 20 nodes or or","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=992s"},{"start_seconds":1003,"text":"whatever it may be. So you're saving yourself like 10 uh like 20 times on on compute basically.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1003s"},{"start_seconds":1013,"text":"Uh so yeah, we'll we'll actually get in and and clone this stuff here. So I just have a terminal open here.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1013s"},{"start_seconds":1023,"text":"uh can't spell and I'll enter in this","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1023s"},{"start_seconds":1034,"text":"and open it up in the best code editor cursor.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1034s"},{"start_seconds":1040,"text":"So I'll just walk through a bit what this template looks like. So","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1040s"},{"start_seconds":1047,"text":"in our in our source folder is where all the code for the agent lives. Um, and in","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1047s"},{"start_seconds":1053,"text":"here basically what a shade agent is with like the agent part of the shade agent is just a server that would be","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1053s"},{"start_seconds":1062,"text":"running it's like some backend service that would be running and this could be like exposing API routes or it could be","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1062s"},{"start_seconds":1070,"text":"uh running like in a in a cron right on repeat. So, what this one is, let me just install dependencies here so I","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1070s"},{"start_seconds":1079,"text":"don't get a load of horrible squiggly lines.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1079s"},{"start_seconds":1085,"text":"Um, yeah, this this one is just a server that exposes API roots. So, we have this","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1085s"},{"start_seconds":1093,"text":"like ETH account, agent account, and transaction route. And it's exposing it on like port 3000.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1093s"},{"start_seconds":1101,"text":"And if we go into our roots, we can look at each of them. So this agent account basically just gets the account ID of","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1101s"},{"start_seconds":1110,"text":"the agent that we were talking about in the in the docs before that has its like","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1110s"},{"start_seconds":1116,"text":"own private key that maps to um an agent address. And then also getting the","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1116s"},{"start_seconds":1123,"text":"balance for it. So because it's using some like gas, we need to make sure it's always topped up. So we could just call like","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1123s"},{"start_seconds":1131,"text":"um SL like local ho if I'm running it locally like localhost slappi/ agent","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1131s"},{"start_seconds":1140,"text":"account and that'll give us our uh agents account ID and its address.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1140s"},{"start_seconds":1147,"text":"And then there's also this ETH account um thing that basically does the same as the previous, but it's for like the","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1147s"},{"start_seconds":1156,"text":"shade agents uh account as a whole. And this is like an Ethereum address that is controlled","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1156s"},{"start_seconds":1164,"text":"by the shade agent. And since this is like an oracle price pusher, we we need","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1164s"},{"start_seconds":1171,"text":"an account to like push the price of ETH.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1171s"},{"start_seconds":1175,"text":"And yeah, we we're checking its balance as well to make sure it has enough gas.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1175s"},{"start_seconds":1181,"text":"And then the magic is really happening in this not the magic, but the the core logic is really happening in this uh call this transaction route.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1181s"},{"start_seconds":1192,"text":"I don't know the the framework is the magic. This is just the the meat of it, I guess.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1192s"},{"start_seconds":1198,"text":"Yeah, sure. The meeting. Uh so what this does is it fetches the price of ETH just from some util file we have down here.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1198s"},{"start_seconds":1207,"text":"Uh and this is just taking the average from two APIs. This is from like OKX API and Coinbase API.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1207s"},{"start_seconds":1216,"text":"Then it creates a transaction to set the price of ETH. Uh and it gives you like the transaction payload to sign. And","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1216s"},{"start_seconds":1225,"text":"what you'll do is you'll use this request signature function from uh shade agentjs which is a library that we","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1225s"},{"start_seconds":1234,"text":"provide and that's going to sign this transaction payload you created before","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1234s"},{"start_seconds":1240,"text":"um which will then return like just a signature for that transaction and you'll plop it all together to get a","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1240s"},{"start_seconds":1248,"text":"signed transaction and then you just broadcast that to to the Ethereum network.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1248s"},{"start_seconds":1256,"text":"Um, and I can I can give a show of what this actually will like","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1256s"},{"start_seconds":1264,"text":"look like. So, uh, I think this should work.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1264s"},{"start_seconds":1272,"text":"So, you can actually like this front this actually has a front end with it that you can locally host to interact with this. I mean, you could just","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1272s"},{"start_seconds":1280,"text":"interact with the APIs themselves, but we we include a front end here to make it a bit nicer. So, you can see uh you","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1280s"},{"start_seconds":1289,"text":"can see what the price of ETH is. Uh I mean that that's that's increased a bit recently.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1289s"},{"start_seconds":1296,"text":"So, one second here. So, I want to just so we're keeping up. So this front end that's in here is all part of this","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1296s"},{"start_seconds":1304,"text":"docker image that is getting deployed to the failure network which is the TE correct?","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1304s"},{"start_seconds":1310,"text":"Uh so this is like an old version which that actually was but we split it up now. So all that's getting deployed now","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1310s"},{"start_seconds":1319,"text":"is this server bit and then the front end lives separately but this is what you'll see if you like locally host your","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1319s"},{"start_seconds":1326,"text":"front end. This one's just hosted. So it shows your like worker account ID","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1326s"},{"start_seconds":1333,"text":"uh like your agent account ID and its balance and it shows you uh the sapoleia like the Ethereum account and its","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1333s"},{"start_seconds":1342,"text":"balance and then you can click here which will then update the price of ETH.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1342s"},{"start_seconds":1347,"text":"Now, if you make this autonomous, is it something where you have to be conscious of actually having a function in there that you can stop it? Like, how","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1347s"},{"start_seconds":1356,"text":"do you I mean, I guess the way you stop it is you shut down the TE, but like like what if it starts going rogue?","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1356s"},{"start_seconds":1362,"text":"Like, is what is the process there when you start to consider building out something?","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1362s"},{"start_seconds":1369,"text":"Yeah. So like in reality for this Ethereum price pusher we have it we have it just as API routes but you should","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1369s"},{"start_seconds":1378,"text":"really build it in a loop so it's it's pushing by itself. Um and in the case of","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1378s"},{"start_seconds":1384,"text":"it going rogue as such. I think you just design your agent so it can't. And the","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1384s"},{"start_seconds":1391,"text":"great thing about shade agents is we have the agent contract there and you can like smart contracts are really strict","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1391s"},{"start_seconds":1400,"text":"in what they can do and you should design your agent contract such that it doesn't allow for bad actions because","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1400s"},{"start_seconds":1410,"text":"LLMs can spit out anything really. So, you should allow it to spit out whatever it wants, but then your agent contract","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1410s"},{"start_seconds":1419,"text":"should say, \"Hey, this transaction doesn't seem quite right. I'm not going to permit it.\" Or like, \"This is an","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1419s"},{"start_seconds":1427,"text":"action that this agent should usually take, and it's the best action that it should be taking to like optimize your","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1427s"},{"start_seconds":1435,"text":"your yield or whatever.\" And then it will permit you to take that action. So you can really bake in some like guard rails here.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1435s"},{"start_seconds":1444,"text":"So again I I want to just make this super clear for everybody here. So I've now I deploy my Docker image on my TE","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1444s"},{"start_seconds":1453,"text":"which is through um that is going to have all of these different actions. I then have a smart contract that is deployed on near right.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1453s"},{"start_seconds":1462,"text":"Yeah. That is then like the manager of that.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1462s"},{"start_seconds":1467,"text":"And so I may have logic in my image that is doing particular actions but then I have what's I would like a controller","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1467s"},{"start_seconds":1476,"text":"that is the smart contract uh that is given the yes you know thumbs up thumbs down to these behaviors. Is that do I have that right?","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1476s"},{"start_seconds":1485,"text":"Yeah. Yeah. Absolutely. Like I mean in in the most basic version it just allows any action um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1485s"},{"start_seconds":1493,"text":"in the contract to make it flexible but for production apps you should really be setting these guard rails um and the","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1493s"},{"start_seconds":1502,"text":"agent contract has these like strict rules right so so yeah you were right um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1502s"},{"start_seconds":1509,"text":"so going back to this this repo in here we also have some like docker","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1509s"},{"start_seconds":1517,"text":"specific stuff and this is what is going to get deployed to fa cloud and we have this like API image that makes it easier","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1517s"},{"start_seconds":1526,"text":"to interact with the agent so you don't need to know anything about any details about the agent contract really and you","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1526s"},{"start_seconds":1535,"text":"don't need to know any details about like how tees work we just handle all of that behind the hood and then you have","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1535s"},{"start_seconds":1542,"text":"your your app image as well uh inside of there. Nice.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1542s"},{"start_seconds":1548,"text":"So to deploy this, you actually need some environment variables which we'll go","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1548s"},{"start_seconds":1555,"text":"ahead and and fill out. I'm just changing getting rid of the example bit here. So first we'll create a near","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1555s"},{"start_seconds":1564,"text":"account uh which I'm just doing with like the near CLI. We'll sponsor it by the","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1564s"},{"start_seconds":1571,"text":"faucet. We'll call what you want to call it.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1571s"},{"start_seconds":1576,"text":"Um, Devub live. I feel like that's going to be taken. Let's see.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1576s"},{"start_seconds":1583,"text":"Deub live 4. Wait, what? Do Do we have the episode number like 53 or something? Something like that. It would be that.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1583s"},{"start_seconds":1591,"text":"Yeah. Debub live 1000 test net. Um, hopefully no one's taken that one.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1591s"},{"start_seconds":1601,"text":"I'm just going to print the the credentials to uh the terminal. Please don't rock my test net tokens whilst demoing.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1601s"},{"start_seconds":1613,"text":"So, you just need just need to like copy and paste your your seed phrase here. Yeah.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1613s"},{"start_seconds":1620,"text":"And your uh what did we even call it? Your","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1620s"},{"start_seconds":1627,"text":"account ID. Plop that in there. And then this like contract ID bit, this is where your agent contract is going to get","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1627s"},{"start_seconds":1635,"text":"deployed by to. This is a sub account of your near account. Uh and we have like","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1635s"},{"start_seconds":1643,"text":"two settings for this. So we have agent contract proxy and we also have this","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1643s"},{"start_seconds":1648,"text":"option of sandbox. So the the proxy this is","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1648s"},{"start_seconds":1655,"text":"for like local development and it doesn't require this like attistation because since you're going to be running","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1655s"},{"start_seconds":1663,"text":"it locally you can't actually provide an attistation. So you can't interact with","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1663s"},{"start_seconds":1671,"text":"it if you're requiring one. Uh right. So we just have that that for local testing. But this sandbox one here","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1671s"},{"start_seconds":1679,"text":"actually requires the act station and this is what you use in in production.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1679s"},{"start_seconds":1685,"text":"I'm just going to change this to dev hub live. Uh this is like the project name on docker hub.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1685s"},{"start_seconds":1696,"text":"Yeah. And we need if we're actually uploading to Fallow, we'll need an API key. Um, I'm just going to like hide","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1696s"},{"start_seconds":1706,"text":"this because I don't want like you can have my test net stuff, but I don't want","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1706s"},{"start_seconds":1712,"text":"you having my my Falor API keys. Um, but I'll just generate one.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1712s"},{"start_seconds":1722,"text":"Uh, you just go to Fowler cloud dashboard. come over to your I think","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1722s"},{"start_seconds":1728,"text":"it's over here. Your API tokens um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1728s"},{"start_seconds":1738,"text":"don't know why that's not loading. We'll give it a minute.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1738s"},{"start_seconds":1749,"text":"It's my account settings.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1749s"},{"start_seconds":1754,"text":"Yeah, I don't I don't know why these it won't give me access to my API. Well, we'll we'll figure that out later or","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1754s"},{"start_seconds":1763,"text":"we'll uh just run it locally, I guess.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1763s"},{"start_seconds":1768,"text":"Um so I can show the local flow instead here. Sure.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1768s"},{"start_seconds":1773,"text":"Uh so we've got it set to AC proxy. So you just run shade agent","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1773s"},{"start_seconds":1781,"text":"CLI which is going to deploy this this uh API image and run it locally and then","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1781s"},{"start_seconds":1789,"text":"we need to use we need to run our actual uh app locally as well.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1789s"},{"start_seconds":1798,"text":"So we can do that with npm rundev and that's going to give us","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1798s"},{"start_seconds":1804,"text":"yeah it's running on on port 3000. So if I open this up. Ah","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1804s"},{"start_seconds":1812,"text":"I think I had some tokens before. I'll actually create a token now.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1812s"},{"start_seconds":1820,"text":"Um it's not it's not showing me what the","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1820s"},{"start_seconds":1829,"text":"token is now. Any we'll we'll keep doing it locally. Um, so if I go to localhost 3000, it shows","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1829s"},{"start_seconds":1838,"text":"me my app is running and I can do api slash e uh account which is going to","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1838s"},{"start_seconds":1848,"text":"show me like my Ethereum account and its balance. And then I can also do the transaction one to set the price of ETH","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1848s"},{"start_seconds":1856,"text":"but it it's not going to uh we can right we can fund it here. Um,","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1856s"},{"start_seconds":1863,"text":"let me copy this address fund it with uh 0.01.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1863s"},{"start_seconds":1873,"text":"That should be enough.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1873s"},{"start_seconds":1875,"text":"We can also see our agent account here as well.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1875s"},{"start_seconds":1881,"text":"And that has balance there because we auto fund it on deployment.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1881s"},{"start_seconds":1888,"text":"Uh, it has balance now. So we should be able to call this transaction route which is going to call the agent","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1888s"},{"start_seconds":1895,"text":"contract under the hood call the MPC service and then give us a transaction back. So we get a transaction hash here","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1895s"},{"start_seconds":1903,"text":"which we can look on explorer to see it was executed and then we get the new the new price which has gone down since it","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1903s"},{"start_seconds":1913,"text":"was last set. Um and I actually have an API token now. It finally appeared. So,","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1913s"},{"start_seconds":1921,"text":"let me just set that off screen. Sure. Um.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1921s"},{"start_seconds":1932,"text":"Oh, okay. Cool. So, I can change this to AC sandbox here now and run again.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1932s"},{"start_seconds":1944,"text":"Uh, just close this one. If I run shade agent CLI, this is now actually going to build","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1944s"},{"start_seconds":1953,"text":"a Docker image for my app, not just the the API image. And it's","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1953s"},{"start_seconds":1959,"text":"going to take all of these and then deploy it to Fer Cloud in a minute. And we have we need to pass some like","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1959s"},{"start_seconds":1968,"text":"environment variables and we have this Docker compose, but the CLI matches everything up. So, it makes sure we're","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1968s"},{"start_seconds":1977,"text":"deploying the correct image directly after it's built. And this is all automatically updated.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1977s"},{"start_seconds":1985,"text":"Uh, and we can see, yeah, that didn't take that long to deploy, but we can","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1985s"},{"start_seconds":1991,"text":"open it now in Fell Cloud. We should be able to see Yap DevHub live.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=1991s"},{"start_seconds":2002,"text":"And it's going to take a bit to boot up, but what we'll be able to do in a minute","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2002s"},{"start_seconds":2008,"text":"is take this URL down here and it'll probably give us an error now. Yeah. But once it's booted up, it will say like","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2008s"},{"start_seconds":2017,"text":"app is running and we'll be able to interact with the the","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2017s"},{"start_seconds":2023,"text":"roots like we were before. um but just an actual verified service in a TE","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2023s"},{"start_seconds":2031,"text":"rather than than running locally. So you can see app is running. Then if we do API slash uh agent account, we can get","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2031s"},{"start_seconds":2042,"text":"that agent account again but this is actually in a in a TE here. So the agent account, why is that in an implicit","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2042s"},{"start_seconds":2050,"text":"address versus didn't you isn't it creating one when you add the the sub account?","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2050s"},{"start_seconds":2058,"text":"Um so the the sub account this is the agent contract not the agent address","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2058s"},{"start_seconds":2064,"text":"itself. Um because like an agent needs to be unique","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2064s"},{"start_seconds":2071,"text":"and it's the the agent like private key is randomly generated based upon the TE's hardware. Um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2071s"},{"start_seconds":2081,"text":"so it's it's going to be some random private key and then that's mapped to an address. Uh, and then like we're it has","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2081s"},{"start_seconds":2088,"text":"balance because we're just funding it with this account and that's why we're passing our seed phrase so we can auto fund it basically.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2088s"},{"start_seconds":2098,"text":"Uh, okay. Well, actually I spent a fair bit time like explaining stuff, but we can go ahead and start","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2098s"},{"start_seconds":2106,"text":"editing this. So what I want to do is like my example before I I created earlier","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2106s"},{"start_seconds":2115,"text":"today was this system on Salana that will like randomly","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2115s"},{"start_seconds":2122,"text":"pick a holder of an NFT and airdrop them some Salana. So, the first thing we're","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2122s"},{"start_seconds":2130,"text":"going to do is set up um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2130s"},{"start_seconds":2138,"text":"set up like a a new function. So, instead of getting the price of ETH, we're going to want to get the um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2138s"},{"start_seconds":2150,"text":"get like a random NFT holders account. And to do this, we can use this. I don't know if you've","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2150s"},{"start_seconds":2158,"text":"heard of uh Helas and like everyone knows M I guess who is the CEO of of of","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2158s"},{"start_seconds":2168,"text":"Helas, but they explore some pretty cool APIs and one of them is","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2168s"},{"start_seconds":2175,"text":"get um just get the owners of like an NFT collection. So, we have this get","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2175s"},{"start_seconds":2184,"text":"assets by collection function which we can pop in here and","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2184s"},{"start_seconds":2190,"text":"and we'll set the collection address in a minute um here. And the one we want to","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2190s"},{"start_seconds":2198,"text":"actually use is this one down here. So, we can set that. And this is I think it's called like Mad Yeah, Mad Lads","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2198s"},{"start_seconds":2206,"text":"collection. Um, so we'll call this collection address","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2206s"},{"start_seconds":2216,"text":"and set it to that. And I'm just going to pop over to my thing I did earlier to try and remember","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2216s"},{"start_seconds":2223,"text":"what I was doing next. Um, so yeah, we have this this function that","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2223s"},{"start_seconds":2231,"text":"is going to get the assets in a collection. We can just remove this because we're storing it as a constant.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2231s"},{"start_seconds":2239,"text":"And we can call it uh get assets by collection. We need to set an API key","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2239s"},{"start_seconds":2247,"text":"which I'm just going to copy some code over. Um I need to import","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2247s"},{"start_seconds":2256,"text":"M. There we go. Cursor is amazing. So, we need a Helas API key, which I'm going","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2256s"},{"start_seconds":2264,"text":"to set in my environment variables, but off screen again because I don't want you see my Helas keys either.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2264s"},{"start_seconds":2275,"text":"Um, so in my environment variables, I'm just setting Helius API key, which I'm going","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2275s"},{"start_seconds":2284,"text":"to set to just grab that. Um, pop that in real quick.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2284s"},{"start_seconds":2291,"text":"Okay, so I've set that in my environment variables and I can bring it on back on screen now and we should be able to","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2291s"},{"start_seconds":2300,"text":"actually test this now. So if I do","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2300s"},{"start_seconds":2306,"text":"get assets by collection, I can't remember what the command is to run. So if we do tsx","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2306s"},{"start_seconds":2315,"text":"source utils uh we'll rename this to","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2315s"},{"start_seconds":2323,"text":"get account uh get salt account I think","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2323s"},{"start_seconds":2332,"text":"utils get salt I need to update some things in here.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2332s"},{"start_seconds":2339,"text":"Uh we can we can worry about that later.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2339s"},{"start_seconds":2347,"text":"I didn't print anything. So that's probably why it did nothing.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2347s"},{"start_seconds":2355,"text":"So yeah, this returned like a load of a load of responses.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2355s"},{"start_seconds":2360,"text":"Uh but just cuz we're running out of time here a little bit, I'm going to copy over some some code.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2360s"},{"start_seconds":2372,"text":"I'm trying to find Here we are. So, yeah, just to skip ahead a little bit,","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2372s"},{"start_seconds":2380,"text":"we can replace this with uh with this. So, it's it's getting we've","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2380s"},{"start_seconds":2386,"text":"edited the code to get all the assets in a collection essentially. And","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2386s"},{"start_seconds":2393,"text":"because before we were just fetching like the first 100 as you can see here, but this collection actually has like","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2393s"},{"start_seconds":2402,"text":"9,000 in them. So we're just going to iterate all over all of them and then add that to a list. And then we're going","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2402s"},{"start_seconds":2410,"text":"to once we have that list, we're just going to select a random one of them where you can see like the math.random","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2410s"},{"start_seconds":2418,"text":"random and just pick a random item in that list and then that's going to","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2418s"},{"start_seconds":2425,"text":"submit an owner address. So I can use that now get Salana address and run","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2425s"},{"start_seconds":2434,"text":"that and this should produce a different account ID uh each time it takes a","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2434s"},{"start_seconds":2441,"text":"little while because it has to query it a bunch of times.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2441s"},{"start_seconds":2444,"text":"Sure. And and in this scenario too, so now you you get the information back, you get","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2444s"},{"start_seconds":2453,"text":"that wallet back and now your contract is going to be the one to then through chain signatures whatever then actually","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2453s"},{"start_seconds":2462,"text":"follow through or are you doing that still within this agent code here?","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2462s"},{"start_seconds":2468,"text":"So, what I'm going to do is like I'm going to get this address and then I'm going to do something with that address","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2468s"},{"start_seconds":2475,"text":"inside of the Asian, but we obviously need to um we obviously need to like change the code further to work for Salana.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2475s"},{"start_seconds":2488,"text":"Does that answer your question or Yeah. Yeah, I think I think that's that that's a good I mean obviously there's a lot you can go different paths down","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2488s"},{"start_seconds":2495,"text":"here, but the key is that the the logic in that kind of those actions stay within here. So it doesn't force users","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2495s"},{"start_seconds":2503,"text":"to then have to write overly complex smart contracts to then handle this. You can really actually just continue","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2503s"},{"start_seconds":2511,"text":"writing in Typescript and get all your actions done.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2511s"},{"start_seconds":2516,"text":"Yeah, exactly. I mean, we're trying to design it so it's language agnostic as well, but","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2516s"},{"start_seconds":2523,"text":"with this simple example, you don't need to go ahead and and actually um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2523s"},{"start_seconds":2532,"text":"you don't need to edit, right, the agent contract. You're just writing TypeScript like you say. Nice.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2532s"},{"start_seconds":2539,"text":"Um and baked in here, we had this like Ethereum.ts TS file. Yeah.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2539s"},{"start_seconds":2544,"text":"But I'm gonna since we're working with Salana, I'm going to update that to Salana obviously. And","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2544s"},{"start_seconds":2553,"text":"delete all of this. We don't need any of that cuz we're not calling a contract.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2553s"},{"start_seconds":2560,"text":"We don't need that.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2560s"},{"start_seconds":2563,"text":"And I'm just going to update it to um some Salana specific thing. So, we","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2563s"},{"start_seconds":2570,"text":"need this like connection thing which will allow us to connect to an RPC","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2570s"},{"start_seconds":2578,"text":"on Salana. I think I'll have to import is it npm npm add or no mpm I right","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2578s"},{"start_seconds":2587,"text":"and then just install that dependency.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2587s"},{"start_seconds":2593,"text":"Um, so I can create this will change this stay the same cuz we're interacting with","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2593s"},{"start_seconds":2601,"text":"like uh the MPC contract still. Uh, I'll set up a Salana connection","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2601s"},{"start_seconds":2609,"text":"and just copy over a URL here. And now we're going to be setting","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2609s"},{"start_seconds":2616,"text":"up um a Salana chain adapter. So because we're","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2616s"},{"start_seconds":2624,"text":"obviously using Salana here instead of EVM and this one is called uh Salana","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2624s"},{"start_seconds":2635,"text":"uh oh we can just have Salana connection and that should work. So this is this is all set up to interact with Salana now.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2635s"},{"start_seconds":2646,"text":"And we're actually using this exported chain adapter in this transaction folder uh transaction file here. So we're going","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2646s"},{"start_seconds":2656,"text":"to adapt this to uh actually first we'll adapt this ETH","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2656s"},{"start_seconds":2661,"text":"account to Salana account so we can get the Salana details instead of Ethereum","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2661s"},{"start_seconds":2670,"text":"details. So, I just need to import Salana instead and change everything to be Salana specific. I mean, that was","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2670s"},{"start_seconds":2679,"text":"that was pretty quick. But in this transaction thing, we need to do a bit more. We don't need any of this. We just","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2679s"},{"start_seconds":2688,"text":"need to import Salana.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2688s"},{"start_seconds":2692,"text":"Uh yeah, we're now calling this function get Salana address.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2692s"},{"start_seconds":2698,"text":"We don't need this contract stuff. Um,","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2698s"},{"start_seconds":2705,"text":"and then we can just go ahead and update this. So, we'll call this receiver address here.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2705s"},{"start_seconds":2717,"text":"Recipient address. I guess we were doing we were like creating a function call here before in Ethereum because we were","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2717s"},{"start_seconds":2726,"text":"like calling a function on Ethereum contract but instead we're just going to be sending some like Salana to someone.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2726s"},{"start_seconds":2737,"text":"So it's a bit simpler. we can just delete all this function and um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2737s"},{"start_seconds":2745,"text":"instead we need to derive the the account again","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2745s"},{"start_seconds":2753,"text":"that's going to be pushing uh going to be sending that transaction.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2753s"},{"start_seconds":2759,"text":"We're actually going to send this to um public key because the public key of a","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2759s"},{"start_seconds":2767,"text":"Salana um account is actually the same as the Salana address.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2767s"},{"start_seconds":2774,"text":"M and I need to copy that code over to here.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2774s"},{"start_seconds":2782,"text":"So we need the recipient address but we also need the sender address which is","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2782s"},{"start_seconds":2788,"text":"also the public key and then we can construct a transaction now","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2788s"},{"start_seconds":2796,"text":"uh not here down here. So we were using this function get price payload before","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2796s"},{"start_seconds":2804,"text":"but we can prepare a transaction to sign. Let's just","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2804s"},{"start_seconds":2812,"text":"yeah I don't know cursor is bogging out here. I'll just copy that. So we're preparing a transaction here which is","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2812s"},{"start_seconds":2821,"text":"sending from my address I'm deriving which is my shade agent controlled salana account.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2821s"},{"start_seconds":2829,"text":"We're getting the recipient address from this function we created before.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2829s"},{"start_seconds":2835,"text":"Mhm. And we're selecting the amount to send here, which is going to be 0.1 Salana. Um, and then we're going to","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2835s"},{"start_seconds":2844,"text":"request the signature. So, I need to change the path. The path is what sets which Salana account we're using because","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2844s"},{"start_seconds":2853,"text":"a shade agent can have like an infinite amount of Salana accounts uh or an infinite amount of Ethereum accounts. So we're just setting this to one of them.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2853s"},{"start_seconds":2865,"text":"I think we need to change some details here. Uh so yeah, Salana uses like a different signature scheme to","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2865s"},{"start_seconds":2875,"text":"uh to Ethereum. So this one is using EDDDSA and we need to swap this to Salana.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2875s"},{"start_seconds":2886,"text":"There's some weird Salana specific. So we need to specify the transaction here","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2886s"},{"start_seconds":2893,"text":"but the actual transaction is part of a transaction object. So we're going to get transaction from transaction.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2893s"},{"start_seconds":2903,"text":"Yeah. Um, and we do we get the we retrieve the signatures a little","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2903s"},{"start_seconds":2910,"text":"differently which I'm gonna copy over here because we need to basically the different signature","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2910s"},{"start_seconds":2917,"text":"schemes have different formats. So we just need to have this bit of code to transform it to the signatures that this","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2917s"},{"start_seconds":2925,"text":"function expects. And we're going to need to set the sender address uh as well, which is the public key. Uh","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2925s"},{"start_seconds":2935,"text":"as we said, they're the same. Change this to Salana and we'll we'll return the recipient","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2935s"},{"start_seconds":2943,"text":"address. So I think I think this should work. Um, so what this is basically going to do when we're","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2943s"},{"start_seconds":2952,"text":"calling this this transaction route now, it's going to fetch a random account ID","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2952s"},{"start_seconds":2960,"text":"from uh from this list from this like NFT collection. is going","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2960s"},{"start_seconds":2967,"text":"to select a random NFT and who is the owner of that NFT and then airdrop them","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2967s"},{"start_seconds":2974,"text":"some Salana because maybe the creators want to have this verifiable service that rewards","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2974s"},{"start_seconds":2982,"text":"uh its NFT holders and then so it's going to select this address and then basically construct a transaction and","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2982s"},{"start_seconds":2991,"text":"send that through the shade agent. So, if I set this to","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2991s"},{"start_seconds":2999,"text":"we'll set it to local first to make sure everything is working.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=2999s"},{"start_seconds":3004,"text":"Um, let me just make check one thing.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3004s"},{"start_seconds":3011,"text":"I think I need to update this. So,","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3011s"},{"start_seconds":3019,"text":"yeah, let's just make some naming a little nicer.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3019s"},{"start_seconds":3024,"text":"um agent sol account. So yeah, let's set","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3024s"},{"start_seconds":3030,"text":"this to import sol count.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3030s"},{"start_seconds":3036,"text":"There we go. Yeah, just a bit of nicer naming. And we can run the CLI again.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3036s"},{"start_seconds":3043,"text":"And let's see if this spits out any errors here.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3043s"},{"start_seconds":3050,"text":"So, it's creating our um our agent contract under the hood,","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3050s"},{"start_seconds":3057,"text":"initializing it with the code hash and running it locally. And then I'm going to","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3057s"},{"start_seconds":3065,"text":"run that my app locally as well. And let's see","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3065s"},{"start_seconds":3072,"text":"if we can do something here. So, let me just check it's running first. So","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3072s"},{"start_seconds":3078,"text":"my app is running and we'll check if we can get our Salana account. So salt","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3078s"},{"start_seconds":3085,"text":"account and yeah we see it produces a salana account now and has our balance. So I","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3085s"},{"start_seconds":3093,"text":"just actually give this agent some balance now. Um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3093s"},{"start_seconds":3104,"text":"here we go. Recipient address. Let's send it 0.5 Salana.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3104s"},{"start_seconds":3113,"text":"And we should be able to call this just in a minute. And we'll see it has more balance.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3113s"},{"start_seconds":3123,"text":"It might take a while. I don't know how long it takes to send. There we go. I have balance now uh from what I just","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3123s"},{"start_seconds":3130,"text":"sent. And now I should be able to call this transaction route to randomly select an NFT holder and airdrop them","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3130s"},{"start_seconds":3139,"text":"some Salana. And the good thing about this is that people can verify that this selection is like completely","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3139s"},{"start_seconds":3148,"text":"random and that it's actually sending it to a uh an NFT holder.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3148s"},{"start_seconds":3156,"text":"Nice. Awesome.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3156s"},{"start_seconds":3159,"text":"Well, we'll see if it's awesome in a minute to see if it actually Oh, there we go. There we go. It looks like it","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3159s"},{"start_seconds":3165,"text":"worked. So, it's selected this this address and it's given us a transaction","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3165s"},{"start_seconds":3172,"text":"hash. So, I'll copy this and go to Salana DevNet Explorer.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3172s"},{"start_seconds":3181,"text":"Paste that in here. And let's see what this did.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3181s"},{"start_seconds":3186,"text":"It sent 0.1 Salana to this random account","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3186s"},{"start_seconds":3193,"text":"NFT holder. So, it did what we wanted on a live demo, which is pretty unusual.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3193s"},{"start_seconds":3201,"text":"Um, and one last thing we'll do here is actually go ahead and and deploy it to","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3201s"},{"start_seconds":3209,"text":"to the TE because this isn't verifiable yet.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3209s"},{"start_seconds":3214,"text":"But once we deploy to the TE it should be so shade agent CLI","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3214s"},{"start_seconds":3221,"text":"build our docker image push the docker image in a second once that's built any second","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3221s"},{"start_seconds":3230,"text":"it's taking a bit of time any questions whilst the the docker image is building.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3230s"},{"start_seconds":3242,"text":"Joe, I think Joe might have","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3242s"},{"start_seconds":3251,"text":"I think Joe might have disappeared for a second. I'll take over, I guess. Um,","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3251s"},{"start_seconds":3258,"text":"yeah. So it's just deploying everything under the hood and approving these code hashes, the API","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3258s"},{"start_seconds":3267,"text":"code hash, the app code hash, and it's deployed onto Fer Cloud now, which I can show over here.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3267s"},{"start_seconds":3279,"text":"This just take a minute to load up again. What I really wanted to do in in","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3279s"},{"start_seconds":3285,"text":"this session was actually modify this repo um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3285s"},{"start_seconds":3292,"text":"to be like what I created earlier which actually just runs this system on like a","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3292s"},{"start_seconds":3300,"text":"cron job. So instead of calling an API route, it will just loop every like","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3300s"},{"start_seconds":3307,"text":"24 hours and send Salana like autonomously. So","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3307s"},{"start_seconds":3314,"text":"it's just behaving by itself and you don't have to interact with anything.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3314s"},{"start_seconds":3320,"text":"And to do that basically you just write the same code but instead of having it as a root we've removed our transaction","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3320s"},{"start_seconds":3328,"text":"route and put it in this like cron folder.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3328s"},{"start_seconds":3331,"text":"And when the server boots up um when the server boots up, it's has this","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3331s"},{"start_seconds":3340,"text":"function to check whether it should start the crown job yet. And when it's going to start the chron job is when the","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3340s"},{"start_seconds":3349,"text":"derived account balance is over 0.5. So we're checking the account actually has","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3349s"},{"start_seconds":3356,"text":"some salana to deposited to run this system. And once this turns to true,","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3356s"},{"start_seconds":3363,"text":"then it's funded and it should start the crown. Then it's going to uh run one job","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3363s"},{"start_seconds":3371,"text":"immediately. So it will do this random selection and then it will run again every X period. So I set it to a minute,","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3371s"},{"start_seconds":3380,"text":"but you could set it to be 24 hours or whatever cadence you want. So it's it's pretty simple to to change that into be like an autonomous system.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3380s"},{"start_seconds":3392,"text":"Uh and we can see this is live now. So I'll grab my deployment ID","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3392s"},{"start_seconds":3401,"text":"and actually interact with it. So API slash","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3401s"},{"start_seconds":3408,"text":"soul uh account. I think I might have to fund it again.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3408s"},{"start_seconds":3414,"text":"Uh, don't know why that didn't work. It might have not booted up yet.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3414s"},{"start_seconds":3421,"text":"Let's check. Uh, maybe I copied it wrong. Who knows?","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3421s"},{"start_seconds":3429,"text":"Maybe something in the demo did go wrong.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3429s"},{"start_seconds":3432,"text":"Uh, let's refresh and check out the logs here.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3432s"},{"start_seconds":3440,"text":"Ah, I know what I did wrong.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3440s"},{"start_seconds":3444,"text":"I need to actually pass so it's running fine locally, but I need to actually pass my Helios API key um into the","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3444s"},{"start_seconds":3453,"text":"Docker Compose file and then this system should work. Now, let me delete these ones.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3453s"},{"start_seconds":3467,"text":"Delete this one.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3467s"},{"start_seconds":3470,"text":"It just it should be a bit quicker this time.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3470s"},{"start_seconds":3474,"text":"Yeah, we have cashing on so everything's going pretty rapid.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3474s"},{"start_seconds":3489,"text":"Let's see where we're up to. Okay, it says it's deployed. We'll see if that's true.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3489s"},{"start_seconds":3498,"text":"Yeah, it's just taking some time to boot up, but we can we can get ready.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3498s"},{"start_seconds":3506,"text":"So once this goes green, we should be able to actually check it.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3506s"},{"start_seconds":3514,"text":"takes about um normally takes about a minute to deploy um and initialize like all the contract","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3514s"},{"start_seconds":3522,"text":"stuff and build the image and then it'll take about a minute to","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3522s"},{"start_seconds":3528,"text":"uh get the the TE app operating. So this should say it's yeah it's it's running now.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3528s"},{"start_seconds":3537,"text":"It's going to take a minute to Oh, everything is is up and running it seems. So, let me check what the Salana account is here.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3537s"},{"start_seconds":3551,"text":"I guess it wasn't working. Maybe it's taking some time solid address.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3551s"},{"start_seconds":3560,"text":"Maybe it's Here we go. Or did I call it soul","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3560s"},{"start_seconds":3569,"text":"account? Did I call it soul account?","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3569s"},{"start_seconds":3578,"text":"Ah, I called it soul account. So again, we can fund that now um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3578s"},{"start_seconds":3586,"text":"with a bit of soul. I'll give it 0.5 again.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3586s"},{"start_seconds":3593,"text":"And once that is in there, we can","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3593s"},{"start_seconds":3600,"text":"run the transaction. Come on, give me my Salana.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3600s"},{"start_seconds":3609,"text":"Okay, cool. We're funded. Let's do it.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3609s"},{"start_seconds":3615,"text":"So, we should get this success again.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3615s"},{"start_seconds":3619,"text":"And yeah, you can see this is actually running in a TE now, which is pretty cool. And we can like","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3619s"},{"start_seconds":3627,"text":"verify it's running in a TE by by just checking the smart contract because it could only register if it it's running in a T.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3627s"},{"start_seconds":3639,"text":"So that's all handled for us. Cool. Once again, we have a transaction address, a transaction hash, and a new recipient of this eyrop.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3639s"},{"start_seconds":3650,"text":"Cool. Um, yeah, that's that's that's pretty much everything. I just encourage you to","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3650s"},{"start_seconds":3659,"text":"go ahead and and try this out for yourself. Try building um","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3659s"},{"start_seconds":3666,"text":"try building your own shade agent. If you head over once again to docs.n org and go to AI and agents shade agents","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3666s"},{"start_seconds":3677,"text":"and then the quick start. You'll see step by step how you can do all of this by yourself and look into the structure","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3677s"},{"start_seconds":3686,"text":"of the project. Uh how everything's working and then how you can actually modify this example to do do what we","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3686s"},{"start_seconds":3695,"text":"did. And I'm going to try and stop the stream here. We'll see","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3695s"},{"start_seconds":3703,"text":"how that works. Uh not quite sure if I can do that.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3703s"},{"start_seconds":3709,"text":"We'll see. Well, see you in another life. Goodbye and thank you for watching.","url":"https://www.youtube.com/watch?v=9v2iZ1qJ4M8&t=3709s"}],"youtube_url":"https://youtube.com/watch?v=9v2iZ1qJ4M8","url":"https://near-pedia.xyz/videos/9v2iZ1qJ4M8"}