Learn to verify calldata with safe-tx-hashes from Cyfrin

Cyfrin Updraft: safe-tx-hashes Workshop · 2:57:42

Patrick Collins, Cyfrin co-founder and educator, leads a hands-on webinar on verifying multisignature transaction calldata before signing. Using real incidents and tools such as Cast and safe-tx-hashes, he examines transaction hashes, Safe operations and delegatecall risks so signers can inspect proposed actions independently.

Speakers

Topics

From Cyfrin Updraft: safe-tx-hashes Workshop, hosted by Cyfrin.

Transcript

[Music] guys you want to know what the the secret was I just needed to quit Discord and reopen Discord isn't that fun sorry about that y'all um welcome welcome to Safe hashes uh with me so uh I'm just going to jump right into stuff so we currently have about 107 people in the chat here um which is lovely um we're going to try to do a lot of

stuff on this call I don't think we're going to need uh 3 hours of your Saturday hopefully I'm going to be able to cut it down to just an hour um but essentially we're going to be teaching you all what uh the basics of what you need to know uh when it comes to signing transactions and you are all getting kind of the sneak peek the demo uh the trial run if you will of an upcoming uh cyphon Workshop um that we're going to be giving more regularly on you know certifying people in this power in this uh ability because it's come to our attention as the industry uh uh in the industry that most people when it comes to signing

transactions are kind of quote unquote uh yoloing their transactions so you know if you're a wallet signer and you're in charge of a wallet that has a billion dollars in it you should really know what you're signing and that hasn't been the case now that hasn't been the case for a number of reasons number one signing stuff has been difficult to understand what your wallets are saying a lot of Hardware wallets and software wallets don't do a great job of showing that information a lot of them are fixing that now um but that's not really an excuse if you are in charge of a lot of money on your wallet so we're going to be giving you all the kind of the um the rundown of how this works and like I said this kind

of a trial run so bear with me um clearly you know I didn't even know how to get my Discord audio working this is kind of a trial run um of this type of workshop and I'm going to be iterating on this uh to make it more fun and more engaging moving forward so um please bear with me as uh as we figure this out so uh let's go ahead let's let me show what we're working with here working with nothing ha one sec

T okay cool great uh let's jump into it so yeah essentially we've been seeing kind of this uptick in these different types of attacks uh the North Korean team has been heavily at work they've decided hey you know what hacking smart contracts is too hard people are stupid though let's just go back to hacking the humans that worked way better and they've been cashing out on some big payday switching from hacking smart contracts to just hacking people you know people are so much Dumber so North Korea responsible for the $ 1.5 billion bit hack for those of you who are unfamiliar with this hack a essentially

a um the bybit uh team is they are in exchange and they signed a malicious transaction that allowed for the North Korean team to basically steal all their money inside of their wallets why well because the team who was doing the signing wasn't verifying what they were signing now you might think hey that's crazy why would you ever do that well to them it looked like oh it looked like this is a like a a really minimal transfer this is kind of a routine event um but what actually ended up happening was the safe UI itself was hacked so um this website which we're going to be going over a little bit more today was hacked and it was showing them a

transaction that said hey this is a good transaction this is safe go ahead and send it but this was hacked and what actually got sent to their wallet was a malicious transaction and they went ahead and signed it so we're going to learn how to protect ourself against that if you want to learn more about the bybit hack in particular I've got a couple videos uh about this on my YouTube channel where we break down you know what happened what were the you know what were smart contract changes that they made what were the um uh how was the front end compromis etc etc um so for this presentation we're going to be going over basically uh okay when your metamask or your Hardware wallet pops up and says would you like

to sign this and it gives you this lumpsum of random crap um what is going on like what what are what are we actually doing here like like how do we know if this is safe to hit confirm or sign or Etc uh now in particular who this Workshop is for anyone who wants to be able to sign transactions with some Assurance in particular this is for developers and Security Professionals if you're non-technical you're welcome to participate in this Workshop as well um but some parts of this might be a little bit challenging we're going to be using um a tool to help verify signature to help verify signatures um and make sure

we know uh what we're doing so uh here's the agenda I know we set it aside for 3 hours but hopefully we're going to be uh much quicker than that uh we're going to start off with wallets because this is where everything starts what type of wallet should you use um because the wallet is your gateway to this whole ecosystem and then we're going to just jump into you know right into some Hands-On learning how to verify our transactions with minam mask and then how to verify uh transactions with a hardware wallet as well so before we get started um if you can go ahead and enter into the chat here your experience level with wallets and signatures um please please do this in one message cuz we have 100 people here

which is awesome your experience level with wallets and signatures number two if you have a hardware wallet you'd like to trial today and this must not be a hardware wallet uh that you use for real stuff this must not be a hardware wallet uh this must be like a separate Hardware wallet uh and then finally if you have a metamask wallet you'd like to try out today and of course if you are um I am sharing my screen can you guys not see my screen and if you have a metamask you'd like to try today as well which if you're taking Cypher updraft you 100% should because I told you you have to um

yeah I I'm not sharing my face I'm sharing my screen uh yeah so can you put into the chat the answer to these three pieces of information here hi now you can see me okay so okay inner level no yes

okay can you move your footage of yourself to the left uh I can but I don't want to I'll just get rid of myself so a lot of people say they don't have much wallet experience they don't have a hardware wallet they do have a metam mask okay okay cool about to finish Foundry fundamentals but there's no signature stuff the signature

stuff comes in advanced Foundry beginner no yes beginner level can Okay Okay cool so that's enough um that's enough uh information there okay let's let's continue then okay so so first off um let's start with wallet recommendations so I'm going to share this link in the chat here uh I actually have to go and update this because I'm in the middle of um kind of a

big Hardware wallet Deep dive um there was a little bit of a sneak peek on some of my testing I bought like you know couple thousand doar worth of Hardware wallets and I'm like using all of them to run like a hundred transactions and signatures and do all this stuff and figure out which ones are the best um so I'm going to update this article shortly with all the findings from this um but just kind of a quick rundown on uh on wallets so um if you're a complete noob if you do not know how to actually verify your transactions um at this time in web 3's curric um or in in the web 3 era I think you should use a custodial wallet and I

know that that's blasphemous because you know not your keys not your crypto um however so many people have no idea what they're signing and they don't bother checking what they're signing that it's probably better to trust somebody else than trust yourself um now we teach on Cipher updraft all the information for you to be able to learn this stuff so uh you should not stay here but if you don't know what you're signing I don't want you signing stuff like that's that's the way it is like the downside here is if one of these exchanges goes under or one of these custodial wallets go under you lose all your money which obviously super sucks custodia Walt kind of defeat the purpose

of crypto in the first place because they're holding your crypto then like what the hell like you're that's way worse uh cuz anybody could send you a malicious transaction you could lose all your money so uh if you don't know what you're signing first off if you're if you're here and you're like hey Patrick I want to learn about this signing stuff um if you drop off this call and you don't learn about signing then you should take all your money off your your self custodial wallets and put them on into exchange because you'll you'll sign something stupid and you lose all your money and that's just the way it is so uh next up yep once you learn how to sign stuff then you can move stuff to you know browser wallets desktop wallets Hardware wallets My ultimate uh recommendation is to use uh

an advanced multisig for everything that you do and that's what we're going to be going over today the safe uh wallets are kind of the most popular one they are multi- wallets they require multiple signatures um these are great because even if you're like Pat W Patrick I only want one wallet I only have one wallet well what you can do is you can um you can sign uh well excuse me this is what you should store for like long-term storage for like holding lot uh lots of crypto uh if one of your wallets gets compromised the beauty is you can just swap it out for something else which is fantastic whereas if you lose your private key you're just effed so um that's kind of my quick recommendations

here I highly recommend you all uh read this article uh to learn more about uh different wallets uh and that's pretty much it so just a recap on uh on this article here number one if you uh I saw a lot of people dropped off the call if you dropped off the call those are the people that should probably keep their Wallets on centralized exchanges because they don't know what they're doing um until you're confident that you know what you're doing leave your money here because you're going to screw something up um once you learn what we're going to be teaching you here then you can move to something better uh any questions on that before I move on no it was very clear okay

great okay so now we're actually going to move into verifying some stuff and we're going to do it live um with a safe wallet here so uh I am on uh the sapoia test net and I'm going to show you um I'm going to do a couple things and I'm going to pause uh and ask questions I'm going to ask you is the transaction safe is the transaction what we want and you're all going to need to find out by watching me if what we're doing is correct and when it is not correct or when it is correct I'll tell you where it's correct um Etc so I'm on this multisig wallet uh it is a one of two two signatures uh which

means uh which means that uh you only need one of two people um to send a transaction so first question here is my wallet set up um here's the scenario I am the CEO of a multi-billion dollar exchange and this is going to be my wallet I can even pop this out over here this is going to be my wallet on ether scan that h is that controls $10 billion is it a good idea for this to be a one of two signatures multisig yep you're you're all pretty

much God of the people who answered no this is a terrible idea so what does a one of two multisig mean well so um this uh address here on ether scan is a wallet however unlike a wallet inside of like a metamask here if we go to like the settings we can see that this is a uh one of two multi uh so there's two addresses in here there's Ledger test in metamask and there's this Anvil 10 which we'll talk about in a little bit um this means that if one of two of these sign something a transaction can

go through typically we want at least a two of three where you need two people to sign something um out of a possible three you know five of nines are pretty popular three of fives etc etc um if you're going to be storing lots of money you obviously want more than this so right away this would be dumb but because I don't want to have to like wait 10 years for 10 people to sign stuff this is what we're going to be rolling with uh now let's create a transaction here shall we new transaction I'm going to use this transaction Builder um and what we're going to be doing oops uh what we're going to be doing is we're going to be um just calling approve on this contract address

here and I'll post a link to it in the Discord chat here this is an erc20 token wrapped ether um and again I know there's a little bit of um kind of knowledge I'm not really explaining like like if you're unfamiliar with erc20 tokens if you're unfamiliar with um yeah if you're unfamiliar with erc20 tokens if you're unfamiliar with metamask uh this is going to be quite there's going I I've already introduced a lot of terms that you're unfamiliar with hopefully you're all with me so far um there's there's a couple questions actually in here uh yes we are showing the screen if you look at my speaker you

can see like that's me showing the screen I wonder if I can like make it bigger for y'all um um and then uh a question for you all here who has never heard of metamask before um yeah who's who's like never heard of metamask before who's never heard of yeah who's never heard of metamask before is has everyone like do I need to explain what metamask is I don't think I do everyone's s a metam mask everyone knows what like an account

is well you could have I mean you could have heard so I guess I should have gone over some of the assumptions here so the assumptions are you you know what metamask is you've heard of safe multisig before um Etc okay cool sounds like it's it's good enough um anyways so what we're going to be doing is we're going to be sending some of this token here so this is an erc20 token this is a we 9 token on the sapoia Chain so I don't think I have any in my my account here what I can do is my metamask I'm going to import the token to paste the token address in here next import now we have some we 9 in here now I'm going to mint

myself a little bit of w going to connect to a metamask here call deposit do I have any sapoia eth I have a tiny bit ofo e um give me a second sorry I know it went black relax um going to just send myself some sapoia on a different um on a different account um I think in the future versions of this Workshop I'm going to be using tenderly virtual test Nets to make everyone's life a little bit easier I was actually trying to do that before the call today um but uh the

safe UI wasn't playing well with me so okay so cool I have a little bit of suppo Ethan here now we're going to do 0.0 one I'm going to call this deposit function and what this is going to do is it's going to um deposit one eth and mint me one we now we can already get into verifying some transactions here so before we even look at a safe multisig transaction we can look at a basic mamass transaction isn't that

wonderful so here is what we see in our metamask and right at the top um we see estimated changes we see all this information here so before we even get started before we even get started doing the safe stuff let's let's do a little recap of of what we're trying to do here and then let's see if this transaction is actually doing that and how we can verify this transaction is actually doing what we expect it to do so we're not even talking about multi we're talking about verifying a basic transaction here so what are we trying to do well we are trying to deposit some ethereum and get minted the exact same amount of ethereum in terms of we which

is a wrapped erc20 token it is basically an erc20 token version of ethereum why would you want to do that that's a long story trust me there are good reasons for you to want to do this now um question how can we verify this is doing exactly what we want it to do let's look at the top we have this estimated changes bit it says minus uh 01 sapoia plus 01 of this address here I'm unfamiliar with this address so let me do a little little lookup Areno on uh sapoia pesis

in aha this is indeed the the token that I wanted yay huzzah so um oh do I have to like redo that again uh oops there it is um um so I said okay cool I'm on the spoon Network great and I have this estimated changes cool this looks good to me is this safe to sign based off of the

amount of verification that I've done so far I see estimated changes at the top I go hey that looks great to me I'm going to get minus one suppo eth plus one of this we erc20 that's exactly what I want to do I'm going to go ahead and confirm right a whole bunch of you uh go ahead keep keep putting in the chat come on be brave be brave am I good to sign this I see some yeses I see some NOS if yes type why yes and if no type why not

and for those in particular for those of you who said yes please tell me why yes okay we got some good chat answers check the hex everything looks good no it could do all things on top of the deposit you confirm the contract address

of the token you were trying to get no why not okay this is this is already been great so I want somebody uh who said yes so everyone everyone stop stop typing so somebody who said yes yes please tell me why you think yes all we checked was the contract address the network and estimated changes I can see the deposit method okay

well okay well uh I'm going to stop playing now so based off what we checked which was the network the address uh excuse me the the network um well yeah and the address and the estimated changes that is not enough information these estimated changes at the top are is my is my screen backwards by the way or is it like the correct way for you guys it should be the correct way is it backwards it's good okay um these estimated changes are just estimated

changes I as a smart contract developer me Patrick Hollins I could very easily trick metamask into saying estimated changes um that look like this and then totally destroy and rug pull you because uh I'm really good at coding smart contracts and I'm really good at doing that type of stuff so estimated changes are not something that we can trust so if you see estimated changes and you go oh this looks good it's not necessarily good you know I can front run your transaction I can hot swap the code if it's a proxy um this is not safe this is a nice indicator but this should never never never never never be

um uh all that you check so uh great so we know we can't rely on estimated changes however These are nice to have um so we go down we say Okay interacting with this address we want to check this is the correct address we're working with I have already done that uh which was great we checked and it is indeed the W9 address um this is when you would you know you double check like oh like is this you know you go to like the docs is this the correct contract blah blah whatever uh this is indeed the correct oops uh this is indeed the correct contract address great now I see method which says

deposit now the next question now this is a much harder question the method says deposit and we have amount 0.01 suppo e that looks good to me is checking all of this enough for me to send the transaction I've looked at all this is that enough can I send the transaction no why not why is it not enough look at the hex okay so some of you have taken Cipher updraft I love the fact that you're all saying look at the

hex uh and I agree no it's not look at the hex as developers as security researchers what I want to tell you is you you should always look at the hex data here this is the transaction that you're sending you're sending this data to this contract now this is something where uh if you're non technical you're like what do you mean like verify the hex call data Patrick you're crazy I'm not going to do that well I don't know what to tell you uh CU maybe you shouldn't be signing uh transactions um this is what we're actually doing so what's cool about this though and so some people actually might say hey uh I actually do

think it's enough data that we have because essentially all I'm doing is checking that that hex call data is the deposit method right so for those of you who have taken Cypher updraft you know that um this hex data this is the first four byes of the hex data which stands for something called the function selector so this hex data here is going to is going to represent um the function that we're calling we do want to make sure we're calling the deposit function the reason we don't want to trust this method thing here is because um sure it's saying deposit but maybe you know there's some extra call

data that's being proped or there's like some extra data that's making it doing something something sus once again I as a smart contract developer I am smart enough that I can trick metamask into you know saying deposit but do some other malicious stuff so uh what we what we can do though is we can see this um this hex data and we can make sure um that uh the function that we're calling matches this exactly so I want to call the deposite function and so what I can do is I can use foundaries cast which uh oops um if you don't have Foundry

Foundry uh oops Foundry eth ww um give me The Foundry restaurant nearby in the Boston area um so this is The Foundry Tool uh if you're going through Cypher updraft uh we use this and what we can do is we can use Foundry to get the hex call data of the function we're expecting to call so we're expecting to call the deposit function so I can do cast Sig deposit and this is called the function signature here oop sorry I totally made the format of this crap um hold on uh

this is called the function signature it's like the name of the function and all its parameters and this cast Sig function which comes built in with Foundry will return us the function selector associated with this function right because we we want to make sure we want to make sure two things we want to make sure we're calling the correct function on the correct address we verified it's the correct address now we're going to verify it's the correct function by checking uh this call data and I can see it is the exact correct call data um because I do a little a little copy of this command F and I see it is exactly

this nuns looks fine Network stuff whatever so now is this safe to sign now can I sign it I have verified it is the correct address I verified the hex data is the correct function now is it safe for me to sign for those of you who said no why not somebody says deadline what does deadline mean verify the data being passed to the

function said eus what if it's a delegate call sign function can be used again Sig replay Sig replay ah I'm so glad this is happening oh this is great metam Mas okay okay okay ah oh my God this chat is amazing this chat is amazing this chat is fantastic because this chat is so fantastic because a lot of you are saying hey this isn't safe to go yet but you're actually wrong this is safe to go and let me explain why so uh a couple

people said hey you need a deadline you need a um uh you need a deadline in order uh to prevent against replay attacks so there's no slippage here there's no um this is a this is a basic transaction there's nothing uh there's there this isn't um the way the rlp and that's a much longer conversation um there you're not [Music] um I don't really want to explain rlp encoding uh that's a much longer conversation why do you think uh there's

there's no um there's no replay attack here because we're not um sending a transaction uh that takes like a signature parameter here when we confirm this transaction we're confirming it you know on this network let me let me actually you know what who here knows what R rlp encoding is H yeah I don't I don't feel like

explaining this if you want to learn more about what transactions are go to the eth org website you can read more about transactions here um essentially um yeah there's so yeah actually so Equus had uh Cody explain replay attacks um an attacker can duplicate a user transaction on different chain versions potentially leading to unintended transfers of assets so you you don't need a you don't need a deadline here you don't need um uh really anything this this

transaction um works for this network and that's it um so you you'll see on different we're not going to go over that here but like replay trans replay attacks are when you're going to be like taking signatures as an input to a function which we're not doing here um for those of you who are concerned about like repay attacks on this type of transaction we talk about replay attacks in the security portion of Cypher updraft um and it's not applicable here so we don't need a deadline we don't need like signature transaction pre prevention um I I don't really want to go super

deep into that because that's like a really long uh but but hey but code cap person uh in the chat anybody who's said um no we can't send this yet thank you for being here uh somebody else said metamask UI could be hacked and this was actually a great point that somebody brought up so when you're sending these transactions you want to know what your trust assumptions are so what are what are our trust assumptions here we are assuming that our browser is not hacked right where's the source of Truth here is a source of Truth The Ether scan website well The Ether scan website is going to send us the data that is popular ated on our metamask here right uh ether scan sent us this data that's

being populated here so if ether scan is hacked that doesn't matter to us because we're verifying at the source of Truth we're verifying uh at the wallet level which the wallet we're using right now is metamask so if somebody said hey if your browser is hacked then yes you're right we couldn't we couldn't um uh it wouldn't be safe to send this now this is where understanding and knowing what your trust assumptions are is actually really important I said is this safe to send and I said yes but that's actually assuming that my uh browser is safe and it's assuming that my um that the address that I'm interacting with is also save so you

always want to understand your trust assumptions number one we are assuming that the address we're interacting with um because it's the correct address it's not going to rug pull us so there's a little bit of trust assumption there we don't want to have to audit every single contract that we interact with that's ridiculous um and number two we're assuming that our brave um browser and our metamask is also safe now this is why a lot of times Hardware wallets are better than your software wallets your metamask and your browser are a lot easier to hack often than your physical like Hardware devices right because you're using your computer every day you're using um you know uh uh your your computer you turn off and all all the

time uh this is why this is one of the reasons why Hardware wals are better because your metamask and your browser is much easier to hack you download a PDF you click it it installs some stupid malware on your computer boom you're screwed right maybe this transaction shows up like this we hit confirm and boom we send all of our money away this is actually why um for signing big amounts of money and a lot of money uh the recommendation is actually to have a separate device uh that does all the signing so um for like bybit for example what's something they could have done to mitigate uh risks is have a a completely separate computer that does all the signing uh of these transactions but so those are trust assumptions the address

uh information is correct and the uh browser and metamask are actually safe so this was great that that Elmore uh brought that up that is a trust assumption here what's next some people also said hey Patrick you didn't check um the data we only checked the function signature well this was kind of a gotcha because since this um uh function the posit function doesn't take any arguments this is all the data the function selector is also all of the call data so again so this piece of hex data represents the deposit function and since there are no arguments to be sent with a deposit function this is all the data right this is the whole thing

so we could even see the arguments we could do like cast call data deposit and then paste this in and it'll say uh that's it buddy like there's no other data um so so with all this information yes this is now safe to send um any other questions yeah like an air graft or DMZ Network just for executing transactions for viate yep like an air graft device um uh a separate computer for sure I wasn't pay attention I assumed you were passing an argument yep no argument here okay so now I'm going to go ahead and send this and um I'm glad we got

this this part out of the way because uh now we're going to this is this is just like a basic transaction and we already have disagreements on how to verify this stuff right but that's what we want to do we want to check the call data so great confirm oops and now I've definitely lost my page um okay it's it's going through now let me get rid of my get rid of myself it's gone through so now if I go to tokens I see I have uh it's kind of small but 0.01 we great somebody said you know from ether

scan point of view that contract is correct um that's another good point uh uh I kind of was assuming um that ether scan wasn't hacked so there another trust assumption that you want to keep in mind um but I know this is the correct um address because I deployed this address um yeah you could also check gas spend like there's there's a number of parameters you want to check but U we checked the the address was correct and the call data was correct and that's good to sign that's it right cool so now we have a token so let's let's do a more uh a more interesting transaction though so we have this um we have this we now I'm going to

transfer the we to I have all these like random wallets to another wallet I'm going to send 0.001 we continue um now I have this to review uh we would go through the exact same process here except for when we get to the bottom we see the data we see metamask actually kind of decodes the transfer function for us so it says data function transfer pram 1 Pam 2 which is really nice that metamask does this if we don't trust the metamask UI and it's decoding we can hit this little copy button here pull back up this we can do cast call

data uh transfer uh what is it address un 256 U 256 paste in the call data uh and transfer address parser error invalid string length cast call data transfer address well this is actually good too because if we get an error here we can go uh hold to decode oh whoops I'm an idiot call De

code sorry um uh which is if you see anything weird that's should be like I I'm not going to send this but I was just being stupid and using the wrong keyword here call data de code uh this will decode our call data into the parameters so it's saying address U it's saying the first uh parameter is this address this is who we're sending to and then this second one is the amount 1 e14 both of these if both these look correct to you we've successfully decoded the call data we can confirm it matches what's in metamask and we could hit confirm but I'm going to cancel so um because I've already done that but so um we've checked call data here

and I'm pretty sure we're going to check signature data metamask as well but um that's the basics of stuff right that's how we check the call data in our our metamasks we and if we're signing stuff in our metam if we're signing transactions this is specifically for transactions that's how we want to verify the call data any questions on verifying the call data here we go through this on Cypher updraft as well we also have uh some YouTube videos that go over this as well but this is kind of the first step are there any other questions on doing that it's hard to check if using your phone

there's no Foundry cast Etc uh yeah uh I don't recommend signing transactions on your phone for that reason uh there's a couple types of transactions that I'm pretty good at verifying with like just my eyes like I've seen so many transfers that I can like literally look at transfer call there I can like look at this and I can be like okay yeah I know what that's doing um which is like cuz you know cuz I look at I stare at call data all day um like I I can tell right away I go yep that's the function selector Yep this is who is being sent to and uh yep that's the amount and then I've seen you know I know what that number is um

unfortunately that's the the beauty of staring at call all day you just you know you can sign stuff like this on your phone because you know exctly what the call looks like okay but let's get into the more interesting stuff now now we're going to go over to a safe wallet a multisig wallet and here's where we start to get uh we to ramp up here and I'm going to have you all uh join me pretty soon in verifying some transactions I'm going to have you pull up the safe UI yourself um and you can sign stuff you canot sign stuff um uh uh yeah but let's uh let's start here so I have this multisig wallet address this one right here and I want

to um to send a transaction for this multisig whenever we send a transaction from multisig it's a twostep process right so or a three-step process I guess so number one you propose the transaction why does it keep doing this stupid thumbs up thing um you get all the signatures and then you execute so it's basically three steps so let's start with proposing excuse me and we're going to do the exact same original one we're going to deposit um uh actually you know what Let's do let's call

proof on this we 9 this token address I'm going to paste the address in here I'm actually going to grab the ABI as well contract API and we're just going to call approve we're going to call the approve function on ourselves for zero amount so pretty harmless transaction but you know this is what our transaction Builder is saying we're going to do I'm going to add this new transaction and we're going to see if we can verify this actually does what we want it to do so I hit add new transaction I'm now going to create batch and now I'm going to send the batch here's what pops up on my

UI I see Advanced details I'm calling approve on wrapped ether this address that address looks good value is zero we see all this transaction data which is cool Transaction hashes what the hell are these we'll talk about that in a second transaction checks blah BL blah like whatever and if we scroll to the bottom we see confirm you're about to read and confirm this transaction would you like to execute this transaction immediately the reason we see this is because since this is a one of two signature um the safe UI is smart enough to know hey like if you sign this you can also execute it right away so if we hit yes execute it'll both sign and

execute if we do no later it will just sign and then we will have to execute it later excuse me so what we're going to do now is for the time being we're going to hit no later and we're going to sign and the question once again is can we sign this is this safe for us to sign let's take a look and if you've never um and if you've only sent transactions before and you've never signed transactions the answer should be no because you probably don't know how to verify y this

signature here so having this here is this safe for us to sign and why yes or no is it safe for us to sign yes or no and why the signature dealing no need to verify

the hex data now it's time to verify the hex in the deadline as well said said code cap no we need to verify no we need to verify the hex data okay cool so you guys are are uh are following are starting to pick it up right we need to verify the hex data but if I I scroll down it says signature request what what is the hex data okay let me you know what did we do before well we hit that copy button so I'm going to hit that copy button again and I'm going to paste it in here what what the what the hell what the hell is this um don't worry I'm going to show you what the hell this is um so when I hit that copy

button G to pull this up I'm going to call this uh hold on one sec Hardware Workshop uh was this do Jason yeah cursor is lame Blasphemous I know get up co-pilot I think is better cursor is too invasive and stupid and pisses me off anyways so when we hit the copy button um I also don't like wind surf

shoot me um when we hit the copy button this is what we see we see all this stuff here and all this stuff for the bottom but wait a minute Patrick that's totally different than what we saw before Patrick what the heck when we did wait a minute when we went to the contract um we did write contract connect yeah blah blah blah metamask blah blah blah deposit you know 0.1 or whatever uh wait let me cancel this one when we hit the copy button before what do we get right go back here paste it in we got just this hex data what the heck let me cancel this one go back here let's try again sign

now when I hit the copy button I get this come on format there we go I get this wacka dooodle nonsense what's going on what's the difference here well the difference here is this is a signature request which is different from a transaction right so this is saying uh sign something versus the transaction is saying send something now what's kind of confusing is that when we send a transaction we still have to sign something we sign the transaction and then we send it here we're just signing we're not doing any

sending but we're signing something as an input to a um to a function so if we go back to our our safe wallet and I got to zoom out just a little bit whenever you send a transaction on a multisig let's go toya. scan. death. net this is a cool trick to kind of get um any ether scan contract into like a vs code look uh oh this is the proxy son of a um where's the implementation more options is this a

proxy okay here we go whenever we send a transaction on a multisig you're calling this function exec transaction your multisig wallet is a smart contract that acts as a wallet and to send any transaction you have to send a transaction which is kind of confusing but let me visualize it so if I want to send you know 10 10 we token I first need to call exact

transaction which will then call the transfer function so every single transaction that you send through a multisig gets called through this exact transaction here so and in this exec transaction we have this signatures parameter so we need as an input parameter to Call Exec transaction with a list of signatures so we need to sign signatures um excuse me we need to sign um all this data and add it as a signature and in here there's a little uh verification

bit there's a little function called check signatures which takes all the data and makes sure that that the signatures you send are correct so the first thing we need to do is sign stuff and um this is why we get prompted with this weird uh Json object because this is what we're actually signing we're signing this data it's going to generate this signature object uh where did that go did I delete that uh yeah it did exec it's going to ass the signature object and it's going to send that as an input parameter to our exec transaction function

so um back to metamask so we need to now verify that this data is what we want we need to verify we are signing the correct thing so how do we do that who here knows who here knows how to verify what we're signing uh two two questions who here knows how to verify what we're signing and if you're lost also tell me okay so so dominee cast call Dat code

the function and parameters and add the data so what call data though what call data do you want us to decode also um Microsoft Word is the best text uh editor not notepad not cursor not vs code just that's terrible joke just kidding it's it's that nobody take that seriously are Harwell wallets now adding

this kind of option to have this process available I will show you a hardware wallet um soon we're going to take a break pretty in the next um 15 minutes by the way because I've been rambling for 80 minutes I opened Vim 3 years ago and I'm able to close this so how do we verify this somebody said cast pretty call data I don't think that's a thing oh it is the thing oh what the heck what does this do try to code the call that you're using oh okay cool actually didn't know that I've been using it the um hardcore way the whole time add and function go back to ID to

pull the function s there so there's a number of things to to kind of unpack here so this is the data that we're going to be signing okay all this stuff in here is what we're going to be signing and we want to make sure um that this is like what we want to sign so um whenever we sign something uh and this this is in the EIP 712 format we want to make sure the EIP 712 data is

correct with the message hash domain hash and safe transaction hash so back in the safe UI it actually gave us these transaction hashes safe TX hash domain hash and message hash these are the things we want to verify are correct that we are signing these are created based off of all of this data excuse me all of of this data in here so all of this data gets basically hashed together to make these hashes now in a perfect world um ideally uh our wallet would give us those hashes as well the safe hash the domain hash the

message hash um but metamask does not however we can technically derive these hashes from what metamask gives us and this is where we can use the cyphon safe TX hash's tool or um Pascal's original one we're also making a rust Edition as well but we want to verify our signature here is correct so what we can do is after you install the Tool uh with safe hashes or safe hashes oh I don't have that one I have this safe uncore hashes by the way if you're ever creating a CLI never use underscores um as the command that's

like so stupid I was like kind of in a rush when I made this tool and then I felt like I couldn't go back after I made it um so we're going to use the safe hashes tool to verify uh this signature is actually what we want so we're going to do safe hashes and we're going to pass in the address of our multi- which is going to be this one here we're going to put the network which is sepolia uh we're going to put the nun which is number zero and we're going to use something called offline mode um where uh we don't we pass in like the

raw data essentially I'm going to pass in data which this is the call data and we're going to get back to this in just a second data and it actually automatically uh sets a lot of the these other values um actually it automatically sets a lot of these other values to default so two we do need to add oops d-2 and it sets value to zero it sets all these to zero it sets all of these to zero but if you want to add these in as well you can do like D- gas price you know blah blah whatever oh my God I just deleted the whole thing same ases uh d d address I got to do the

whole thing again because I D Network aoia D- offline D- nuts Zero D offline D data and like I said we're going to get to the data in a second is that everything did I miss something I missed two d-2 is uh and now it'll calculate the hashes for us so we can even see if this hash matches what we see in the safe UI and

we do indeed see so if our mamass gave us the safe transaction hash all we would have to do is compare the safe transaction hash uh and we would be good to go it does not so we have to um actually manually verify kind of all the parameters in here ourselves so we're signing this safet TX hash we have to check the two address um we go to like seoa ether scan or whatever um I'm going to say Yep this looks good uh value is zero yep that's good data who knows what this data bit is

what is this data bit message hash nope it's not the message hash good good guess though hex to the action yes exactly this is the hex of the data so remember of the data to the action what does that actually mean well remember whenever we call a function on our multisig we're going to be passing in a list of signatures and we're going to be calling this function which will then call another function so we're going to be calling remember call

exact transaction to then call the you know the approve or the transfer or whatever this data here is the hex data of that second call right of the approv SL transfer so we actually want to um decode this data to be um so that it is what we expect it to be exactly the same way we decoded a regular transaction so what I'm going to do cast call data decode what are we doing we're calling approve I know it's been forever since we um looked at this but remember

we're calling approve right for for zero amount so we're saying okay call approve um what's the so many tabs which takes an address and a unit 256 so we'll say address unit 256 and this is the call data that our metamask is saying we're going to send and now we're saying okay this is the address we're calling the approval on and for this amount so we can go to the UI we can say oh that is what we want and the value is what we want um well

actually we just we would say okay is this the person we're trying to prove it sure is and is this the value we're trying to prove it sure is right so this this data is the actual like transaction that we want to send um and then the rest of these uh look fine to me one of the most important things to always check is this operation if it's a zero this is going to be a basic call if it's a one it's going to be a delegate call and if you see it is is a one you should Panic a little bit uh I have a question though is the B 32 the kak 256 safety x56 Etc uh which

bites 32 what are you talking about the data we see this data no so this data is the call data um here actually you know let me show you if I were to go back to the contract here and I were just call write contract and call approve on I think it's this address uh yeah this address for this

amount all right let me cancel this one cancel and hit right and I grab the call data by clicking this button here the data we see in our metamask is actually exactly this so if I were to send a transaction I would get this call data to send directly to this contract but for signing this let me cancel this one for signing this the data we see in here is the exact same data if I were just going to directly call approve but since again I'm calling the approve through my

multisig I have to call exact transaction first um and then we call approve afterwards and so that data um so this data here is the exact same data as if we were just call approved directly on the contract itself does that make sense where the constants are in here wait

what do you mean the top code of the safe like the code in here is this version one or two version one or two of what I'm not sure I'm following not sure what uh the question is oh I'm I'm going to finish this um this example and then we'll we'll pause take some questions so I just uh verified this call data right cast call data code and

I see that those are correct so this looks good to me the rest of these look good to me so now I can be feel safe to confirm this now this process is going to look a little bit different for Hardware wallets and I would actually wish metamask would change the uh how they do it too but we'll talk about that in a bit once I confirm you'll see uh the approve is now in Q and I can see it's now um I now have a new transaction in my que but is not executed all I've done is signed it so back in the exec transaction function I now have created the signature I'm going to add to this

signature section here so every call of approve has the same hash uh every call of approve with the exact same parameters have the same hash yes ah okay I what you're asking um uh the type hash so this is um version 1.3.0 um in my safe uh TX hashes script uh it automatically calculates the uh

the type hash this is actually one of the reasons why I wish the um minam mask would show you the domain hash um and message hash because that would give me more confidence that I was actually doing it correct so um yeah you're looking at the uh the typ has I guess what what's the question that you have with this so the data we saw and the metadata

isn't typ has since it doesn't display e p712 it is not the typ has um let me show you something so [Music] um so the type hash is like basically this hash that tells you what the types are um getting uh leading into like a message hash and domain hash um the data we saw metad day was not the typ pass no the data we saw was like just the data um uh for the approval metamask actually doesn't show us like what you um the

message hash or the domain hash is which is what you need the type hash for um for those of you who don't know what we're talking about that's okay um mamass doesn't show this information anyways which I don't love um but we'll get to that uh in a bit maybe this will take three hours um Let me let me finish this and we'll take a we'll take a 10 minute uh 105 minute break but any case now that we've um uh but but keep that thought keep that thought because the typ has will come up shortly but no the data that we saw is the approval data um for the transaction but so now that we've signed it we can now execute it

um and and once again you know I could look um through all the data in here and I could say Yep this all looks good but I don't want to trust the safe UI I want to trust my wallet which again the trust assumption there is my wallet is hacked uh my wallet is not hacked but my wallet is easier to be safe than the safe UI um so if I'm happy with this I can now send it and now this is going to be a classic transaction right so now this is a transaction request not a signature request so when I copy the data and I paste it in here now I get kind of the classic hex data and so if I pull up my

terminal now I can do cast call data decode and this is where uh I would put in the um the signature for exact transaction I put this signature in this is like a lot I would need to do add R56 bytes all this stuff uh I have a little shortcut that I use that automatically does all that for me uh MSC paste in the call data hit enter and now I can see all the decoded parameters um in here very easily so we see the two we see the value we see the data we see all these zeros and then at the bottom

we see the signatures which this is the signature that we just signed in that last of uh section uh and then I would of course verify all this looks good like a normal transaction and it does so then I would go back to my metamask I would say yep oh oh and then once again metamask actually does decode it already for us right exact transaction all the different parameters and I'll hit confirm and then it'll send the transaction msse msse is uh my short hand for multisig um yeah multi say call data decode um it's it's like an alias that I use because I um decode multi-stake transactions

relatively often now before we take the break I want to show you one more real quick thing transaction Builder uh we paste it in give me the uh ABI contract or code copy this paste it in here copy this again paste this in let's say zero add new transaction create batch send batch if I were to hit yes execute and execute what's going to pop up is only the transaction data but here's

what is super frustrating parameter 10 should be the signatures right remember last time it was two steps right we signed it then we executed it and then I kind of GL glossed over it but we showed that parameter 10 was the signatures that we just signed now it's different it's actually um you can't see it it's actually a placeholder without our address it's not the actual signature so here's what I don't like uh

oh at all when we do sign and execute our metamask uh tries to be clever and just has this place over here and says oh yeah like you'll sign the data and send it over we don't actually get to see what we sign we don't actually get to see what our signature is this is bad because what could be done was the website could send a malicious signature which even if everything here looks good it would uh it would break this and we'd be like oh that's weird let me just run this again um and we'd rerun

it uh wait this is a different what am I calling 4 by oh am calling approve oh that's super weird formatting I hate that but fine whatever um so typically we never want to do this

we never want to do uh sign and execute we always want to sign first and then execute after because because if we do sign and execute it metamask and most Hardware wallets too won't show you what you're signing so we want to do no later we hit sign and then it'll show us okay here's what you're signing classic signature um so we never want to do sign execute we always want to sign first and then execute uh okay any questions on all this before we take a break I give give everyone like 10 minutes to to digest um and ask questions actually yeah let's start the break now um and we'll just yeah we'll we'll restart I'll start the next um section

at 2 uh 38 so we're in literally 10 minutes um so we'll do 10 minutes of questions or if you want to like go to the bathroom grab some food or something uh or ask questions great uh s can I like highlight comments or something no oh whoops you mean you set MSC as an alias for the cast call Dat to code rest of the command uh yes exactly I have a lot of aliases um for stuff like that because um you know rewriting all of that is uh annoying right so like the actual um command would be like cast all data decode

decode exec transaction and then like address un 256 um bytes maybe like un blah blah a whole bunch of stuff and I can't be bothered to type that out every time so great question other questions multi signature cast I believe yep yeah yeah yeah yeah multisig cast or I call it I in my in my brain I had it um as an acronym for multisig uh call data to code but same thing minass front front endev should stop Vive coding and fix this see like the thing is it's it's not uh this is actually a great a great

point it's not super dire because um I can go through so like they give me all the information that I am signing right they give me the safe t uh TX struct um uh and I can verify all the parameters it would just be easier if they just gave me that hash um and if they something up on their side and they' give me like the wrong domain hash or something like that I would be able to see that um right now I am kind of trusting that metamask isn't that up which is a bit which is a bit spooky um most actually all Hardware wallets uh except for my testing it seems like Ledger might be the only one

um that will show you like the domain hash and message hash as of today because I just spent you know like 12 hours yesterday like ripping through Hardware wallets to test this those two might be the only wallets that as of today show you the domain hash and the message hash um most of them um don't which is not great so pram 3 function selector can't be identified maybe it's metamask causing the issue what do you mean pram 3 what are you talking about how did you learn all these without Cypher updraft uh um

yeah uh lot I spend a lot of time you know reading documentation the hardest part was AI didn't know any of this you know what I mean like that was the that was the hardest part it's getting better because we've written a lot of information about it now but you said uh we should never use underscore while building a CI command any specific reason uh yeah it's hard to type so you have to do shift you have to hit the shift key um and that's annoying you don't you don't want to have to have people do hit the shift key to type um characters uh in your CLI like it should just be like all overc case um no shift

weirdness that's it straight 12 hours no I like you know I like went to the gym you know I like ate food you know was straight 12 hours the hex code you couldn't identify just now in the um metamask modal oh yeah yeah when I hit um sign yeah it's super weird I don't know if that was like a a really weird bug that I saw cuz like yeah looking at it now it's like like this is correct the reason it jumped out to me cuz I didn't see the zero here um but maybe it's maybe it's not a bug

maybe it's fine but that was really odd you know i' never seen cuz cuz I I see this and my brain goes oh yeah that's the approved function select there um but I didn't see the zero here I'm pretty sure right like am I crazy I mean we can go back and look at the recording um yeah I didn't see the zero here right 1 two 3 4 5 6 7even eight I guess it doesn't matter because it's just like assumed that the zero is there I guess that's fine I just I've never seen it not have the zero there I don't know weird one of your Cypher up boys should

have um represented e Denver I spent a lot of time Shilling hey I appreciate that I appreciate that um eth eth Denver uh feel like it's it's a little bit less developer these days um but maybe I mean I'd rather people go to like python conferences and shill eat Denver or like Javas not sh or like JavaScript conferences and sh'll um Cypher upd draft right really want to get those people over here I appreciate you for for Shilling that

though yeah so we'll take four or five minutes for for more questions have people take potty breaks is all this making sense or are people still lost starting to make sense okay makes sense it might it might not settle you know the pace is good okay I'm trying to like make sure like to like kind of Rego over stuff and yeah what what's what's nice is we have what we have uh we went

from 100 to 48 so now it's like kind of a a more of a tightnit group which is cool the people who dropped off are the people who are going to sign a$ 1.4 billion transaction and lose all their money so uh aquous we should take a screenshot of like the people who started and the people who ended and then just like follow the people who dropped off and be like oh I see you all signed uh malicious transactions whoopsy Daisy that's you know what no I'm kidding I'm kiding don't don't put him on blast I'm joking don't do that I'm I'm joking I'm joking I'm joking it's I'm I'm 100% bad joke bad joke it's definitely bad joke bad bad bad joke do not yeah I it's definitely not our s cuz yeah PE people

have stuff to do people have stuff to do and um this is being recorded which is good too and a lot of this information is already on C updraft so helps paint the picture Okay pace is good I did the hacking on ate up so much time they didn't really seen the main events I love that I whenever I went you know when I was first starting coding I just showed up to like drink energy drinks and like code like that's it for hackathon we we got a couple more things to show you um and then I can send you on your way I think the problem is always going

to be convenience man the average person will put themselves through hell theyve a t bit of work this seems to be part of the process too uh instead of an extra one how do we get there good question I'm going to I'm going to try to get to that a little bit too we go through 5 billion hacks a month

and people still get lazy yeah we're thinking of turning this into a certification because if you're in charge of even if you're in charge of just like you know less than a million dollar even if you're in charge of like 50 Grand you know you should really know what you're signing um and once you get fast at this like CU I yeah I literally you know I go through um I'm a multiple security councils you know I sign transactions all the time um you get really fast at doing this like it does it doesn't take like once you get in the in the zone like once you get into the

flow it doesn't take that long to to to do this to just add this verification step so enjoying the call so far okay cool feel like because we went from 100 people to 50 people I'm doing a a bad job I'm like rambling on but I appreciate you all being on here for the uh this uh this trial run hopefully you're all learning a lot um okay cool it's time to be back so let's flip back over and I I told you guys I was going to have you all um so for those of you who stayed have you all actually do this yourselves and we're going to get to that very

shortly so um cool so um what's next well I still want to get to Hardware Walts uh but somebody talked about convenience so we showed that Tool uh the safe hashes tool to kind of get the safe TX hash domain hash and message hash which mamass didn't show us anyways which was super annoying um yes Susan this should be recorded um but there's another Tool uh one that the open Zeppelin team gave us uh which is awesome called safe utils.py hashes for you however once again if you use this website there's a trust

assumption that this is correct um so it would be better if you downloaded our tool use that on an isolated device uh and use that to get uh hashes but what you do is basically kind of the same thing as the tool put in uh chain ID your safe address your NS so for our NS NS one save version uh ours is 1.4.1 but it actually doesn't matter 1.4.1 and 1.3.0 have the same type hash um uh recipient address aka the 2 normally you wouldn't want to copy off

the UI because you don't want to trust this UI but I'm going to do it because I don't care um because it's just like a demo like normally you'd copy it out of your your wallet or you'd like go directly to the address to make sure it's what you want recipient address value transaction data this is where you would um like do it yourself so like you know I would say okay what do I expect cast call data I'm calling approve address uni6 um the address I'm calling approv on I think it's this one no it's this one yeah this one and zero gives me this call data so I can copy the call data paste it in

here I want it to be a call I'm going to hit continue all the zeros here look fine and I would hit calculate hash and it would give me the safe TX hash domain hash message hash we can double check those are the same as what's on the UI here the safe TX hash is kind of the combination of these two so I'm for now I'm actually just going to check that one and I see that they're the same so that's really good to see right just check what you're pasting yeah exactly so and then if your computer has like a copy um copy paste malware like you're screwed right this is another reason why it might be a good idea to have

different devices anyways um I'll hit sign you know and this is where I would love metamask to show that safe hash because that at least I could like really quickly check um since it's not there I I do have to kind of manually check all these parameters here which is annoying but fine whatever not the end of the world and I'm also trusting metamask isn't screwing up like the calculation of the domain hash and message hash and blah blah blah so hopefully in a future version of metamask they actually update this what is nice about metamask is they do decode it for you like rabby wallet and other wallets that hour testing don't do that

yet so cool um now the final thing uh I want to show you all before we before I give you a chance to try this yourself is I'm going to show you all this on a hardware wallet so why do we want to use Hardware wallets instead of like metamask software wallets so can somebody um somebody tell me in the chat while I uh add this Hardware wallet why we'd want to use a hardware wallet instead of a software wallet okay I'm seeing

uh a lot of different stuff here so um because it's a cold wallet so uh this is this is actually one of my one of my favorite things to talk about so uh let me ask a different question what is a cold wallet versus what is a hot wallet so people say you should use a hardware wallet because it's a cold wallet what is a cold wallet what is a cold wallet somebody tell me tell me what tell me what's a cold wallet isn't a cold wallet offline

wallet hot wallet is browser base only cold wallet is a wallet that is not connected to the internet okay so um kind of it looks like you you're just about there but uh let me ask you this when you connect your Hardware wallet to the safe UI is it still a cold wallet you didn't think about this one did you no no no a lot of people are saying no okay so then let me ask you this is is a hardware wallet a cold wallet some ah somebody said yes okay cool love it okay so is the hardw wallet

Co okay so I feel like I just mind destroyed you all right you all just said no Hardware wallets aren't cold wallets uh you all just said hey when I connect my Hardware wallet to the internet is it a hardware wallet you all said no excuse me I just said when I connect my Hardware wallet to the safe UI is it a cold wallet you all said no it's it's not a cold wallet and then I said okay well it's a hardware wallet a cold wallet and you said yes that doesn't make any sense it's still a cold wallet even when connected I love this so uh this shows that the industry doesn't know what the hell a cold wallet is or a hot wallet is um because the definition has been very vague these uh I'm going to tell you what the cphon

definition is um and this is what I think the definition should be everywhere because I think it's actually very confusing um a cold wallet is a wallet that is not connected to the internet a hot wallet is a wallet that is connected to the internet when I connect my ledger device or my Hardware wallet to the safe UI it is no longer a cold wallet it is a hot wallet it is connected to the internet that is my definition so if your device gets um so if you're saying hey oh I'm using my Hardware wallet I'm using my cold wallet I would say what do you mean what do you mean how do you send transactions then huh what what you never how how are you sending

transactions without being connected to the internet huh what it signs the transactions offline uh if it signs the transactions offline uh and then you send it to a physical device a different physical device and then manually grab the signatures and put it into your into the internet then great then it truly is a cold wallet um but I'm going to argue that a lot of your definitions of cold wallets are not correct because when you connect your wallet to your to your computer to you to the internet it is no longer a cold wallet so the private key isn't stored online um that's not true either because your metamask your private key is not

stored online either your metamask your private key is stored in your browser so hot wallet your wallet is connected to the internet cold wallet is it cold when you disc disconnected again or is it tainted forever I would argue when it is disconnected it is a cold wallet when it's connected it's a hot wallet You could argue yeah it could be like a binary oh like if you ever connect to the internet like it's a hot wall it's cold wall I just think if it's disconnected it's cold if it's connected it's hot that's that's how I think about it and it can switch between being hot and cold so the buybit um wallet they called it their cold wallet it was a multisig uh and that's like kind of more interesting because it's like a smart contract and it's like on the blockchain but I would argue that a multisig

contract is um is a cold wallet um because it is actually never connected directly to the internet because it's just like amalgamous code um but that's a that's I don't know now we're getting to weird philosophical arguments uh now see now I've opened up a box worms about um about wallets haven't I you know what I mean um uh I I didn't mean to get into this box of worms here uh I'm sorry I did this to you

all uh we we can go over fighting about whether or not it's a uh a hard hot or cold wallet like another day uh anyways okay uh so what we're going to do um it's just it it is something that I I want you all to think about though like when you're using these terms what do you actually mean what is a hot wallet what is a cold wallet I guarantee you if you drill into it a lot of people don't know what the hell they're talking about and that's okay and that's okay but it is important that we say okay like a lot of people will blank and say cold wallets are better than hard wallets excuse me cold wallets are better than

hot wallets my Hardware wallet is a cold wallet but I connect it to the internet to send transactions you know like what what what are your trust assumptions right um anyways I want to show you what this transaction looks like on a ledger device I'm using a ledger because the Ledger is actually going to show us the domain hash and the message hash which you combine those together you get the safe TX message hash which is like going to be the quickest way to verify um these multi transactions are good which is why I wish all wallets uh did this so I've just added Aigner here um we can do another new transaction

here transaction Builder let's leave that open and this is kind of the the Crux of what we're doing here so now we're going to do the exact same thing we're going to approve we're going to call the approve function we're going to approve zero on just itself which is like kind of a stupid transaction but whatever but we're going to do this on the hardware W outside and that means I need to disconnect I need to reconnect uh with my uh okay let's edit let's go to Ledger 2 let's update so um the reason I'm connected through my metamask

like this is because the safe website uh recently removed access to like connect the safe website directly to your Ledger and so what I've done is I've actually set my metamask up to be kind of a proxy between the safe UI and my ledger so my my um metamask will pop up to say hey do you want to confirm this transaction but it'll send everything to my ledger device and I have to confirm on my ledger device why am I using Ledger um no form of endorsement here uh I have Keystone with me I have a treasure with me I have have um a grid lattice plus with me I have um I have a

a tangent wallet with I have a ton of Wallets on my desk the reason I'm using Ledger for this demo is because Ledger at the time shows you the domain hash and the message hash um which is something I wish all wallets uh would do so but I have a deep dive on like Hardware wallets um coming up soon because I just spent a grto amount of time but anyways um so I've set up my metamask to be a proxy for my ledger there are some um docs on how to do this it's actually pretty straight forward um on how to like connect your metamask to your uh Hardware wallets so I'm going to update going to

connect uh great now I'm going to uh do add transa and now you can see this is the address of my ledger this is correct I've checked it myself add transaction now create batch send batch and we're going to do the exact same thing right um would you like to execute this transaction immediately no why not somebody tell me um why I should not execute this transaction immediately I taught you this maybe 30 minutes ago why should I not execute this immediately so you can verify the signature first correct yes because if I hit execute it's not going

to show me what I'm signing I would like to see what I'm signing I would love it if wallets if I hit this if wallets showed you what you're signing but they currently do not which is super freaking frustrating so let's verify what we're signing so remember it's two steps what are the two steps sign the transaction and then execute the transaction two steps we want to verify the signature and then we want to verify the transaction call data two steps remember verify the signature verify the call data verify the signature verify the call data so let's do those two steps let's verify the signature sign now my met Mouse pops up says hey uh

you're connected to your Ledger be sure your Ledger is connected oh my God and it keeps freaking disconnecting on me because it hates me um enable this blah blah blah um and I get all the same data that I've seen before so my question is now that my ledger is the wallet can I trust what is in my metamask can I do the same process right because what did we do before okay we verified the two we verified the data we we read all this stuff in here can I do the same thing I'll just oh I'll just

verify all this stuff and if this all looks good on my metamask I'll just confirm it on my ledger can I do that the exact same process that we just did we still have to verify verify what yeah the data we're signing verify but can but I see it right here I see the data right here can I just verify the data here I see see all the data here if it's the same thing on The Ledger what's the issue has to match your Ledger must verify The Ledger

verify what metam Mas doing the L exactly beautiful oh you're all so freaking smart now the source of Truth wallet is my ledger it is no longer my metamask because we always want to verify the data on the device that is actually doing the signing before our metamask was doing the signing so our metamask was the source of Truth our metamask was the data we needed to verify now since metamask is just sending the request to my ledger if my metamask is hacked it could send bad data to my

ledger but show good data on the UI you always want to verify the data on the device that is doing the signing since metamask is no longer doing the signing and The Ledger is doing the signing we have to verify the data on The Ledger you are all wizards you're all going to be able to sign transactions that save you $1.5 billion so I'm going to hit confirm uh and it failed because Ledger like unlock or locks every like two freaking seconds so and this is one of my test ledgers um uh because I have like a 100 of these

and I don't I guess I don't remember my PIN oh my God this is one of the fun parts of uh working with Hardware wallets is when they bug out on you a little bit which is like kind of terrifying but such of life okay cool let's resign yeah okay and now it's going to show up on my ledger device and I'm going to try to get real close to the camera show you what we're seeing so on Ledger can't see it because it's

can't focus on just wants to say focus on me so oh there we go okay well you can't really see it but it says blind signing um should have used one of my other ledgers huh maybe I can use this letter hold on one second was a ledger Nano uh I also have a letter Stacks

which actually might be easier to see I have to do sorry one second here here we go to reconnect yeah my goodness my test metam masks I don't

really care but have to repopulate this I want I I I do want to show you what shows up on the device so I'm switching to a different Ledger sorry about that I had to restart my browser because metamask currently has a bug where if you do what I just did it freaks out and like crashes okay uh let's sign now sorry I got a little bit of the Snuffles here and we'll confirm and it should go to my ledger and it sure freaking does okay so now we're going to

use the Ledger Stacks or The Ledger Flex um oh excuse me wow this one's still blurry too okay well I guess that's good enough it says blind signing ahead um this is basically like Ledger's way of saying hey [Music] um uh I didn't it just disconnected on me cuz it frustra oh my God okay so maybe I'm not

going to show you because if it keeps disconnecting on me and I have to keep redoing this I'm going to lose my mind and just disconnected on me all right hopefully I'll show you the um at least the domain hash and message hash like super quickly okay so um I just I just had to redo

everything sorry about that basic is blind signing ahead details of this transaction message are not fully visible so according to Ledger I don't really love their definitions here but blind signing is just when you sign [Music] um you sign data that isn't decoded I guess um whereas clear signing according to Ledger is when data is decoded I don't know why they created kind of their own terminology for this I don't really love the terminology um but whatever on my ledger device I'm going to say continue anyways and it says reviewed type message and on here what I actually love is it gives you the EIP 712 domain struct uh hopefully you can see this and

hopefully it doesn't disconnect on me so it gives me the chain ID and the verifying contract that is stuff that is used to create the domain hash and the message hash um and those are two pieces of information that um do need to be correct so that you don't do replay attacks on different um chains so this is something that somebody messaged hey like what about replay attacks so this is actually uh to prevent against those type of Replay attacks uh then it allows me to review the struct so like that stuff that we saw on metamask where it said like two value data blah blah all that stuff it allows me to review uh and I'm reviewing that right now one of the things I kind of hate about Hardware wallets is they

go oh yeah here's the the call data um here you go uh does that like right to you and right now if uh like the question is okay like you know I can verify this on my computer but like pulling this off the device to like actually compare is kind of challenging right now there's a couple ways to do it some people what they'll do is they'll take a photo of their Hardware device the photo to their computer and then like AI is usually pretty good at like pulling the text out of the photo so you can verify the call data matches what you expect um what Keystone the Keystone wallet does that I think is really cool

is it actually generates a QR code that you can scan to get all the data I would love it if more wallets did that I think that that's a really good one cuz right now like you know like here's the data and what what do they expect me like spot check the data I mean luckily this is an approve so it's like pretty small but this if this was a bigger transaction like what are you just screwed um anyways I hit next uh gives me like um Operation Safe TX gas Base gas the same stuff we saw in metamask gas token fund receiver uh nuns and then it says accept risk and sign uh type message um and this is a bug with um Ledger at the moment uh it's not showing

me like this is technically enough information that I can feel happy to sign if the data looks correct uh I'm going to reject um it because what it'll then do is it'll pop up again um and say hey blind signing ahead like oh wait what I just rejected what am I signing now and now it'll show you the domain hash and the message hash which these are the values that we can that we calculated using that tool uh either um sorry about that uh oh it's because I well it's because

I deleted everything sorry about that there we go much better um yeah you saw me OBS set up damn uh um we calculate with this hash or with this um uh with with this tool here or um uh when we did the safe hashes tool right safe hashes D Network um Network blah blah blah all that stuff right so this actually will give us the domain hash and the message hash and I wish all wallets did this um I just wish they did this in the same

prompt instead of like me hitting reject and then it like gives me the hash like I I don't know that's like super bizarre what's also frustrating is if I accept this one or the one I just rejected it'll send it either way um I don't know uh I think that's definitely a bug but whatever so now I'm holding it to sign it mes signed I just signed on my ledger and immediately went through back to my metamask um to send it um so now if I go to transactions I have this that I just signed and once again I can now execute it in a separate transaction I don't really care what menam Mas tells me because I'm verifying

on my device anyways um on my device once again I get review transaction and now I can review it like I review like any other transaction right so it'll give me um the from the transaction hash right exactly the same stuff that we'd see in our metamask uh because now we're we're verifying the transaction obviously what we want to verify is like the two the network uh and the call data and um what's frustrating is for The Ledger I actually have to reject this one because I have to go to

the settings and I have to turn on uh debug smart contracts um which will show the call data but for some reason Ledger just calls it debug smart contracts and it it shows it in this like really horrible format um which I don't want to show you guys Ledger please fix actually no I will show you because it is like really bizarre um so and and every hard wallet has their pros and cons um the pro of the ledgers is that they do show The Domain hash and the message hash not a lot of other wall do that which is great um the cons are what I'll show you in a second so to view the call data it

chunks up the call data into uh into bytes 32s it just takes the whole call data chunks it up into byes 32 and it says hey uh here's par here's field one does this look good to you and it shows you in this like weird format sorry I'm like putting Ledger on blast a little bit here and says hey like do you approve field one um I guess they're like assuming all parameters are exactly 32 bytes long which isn't the case uh and you have to like confirm each byes 32 um so for example like we know parameter 3 uh is a byes object um but they're showing kind of the raw call data for parameter 3 which

is um this this uh which is like what the hell um but in any case uh I'm going to hit reject uh because I don't feel like going through 18 fields of that stuff but um yeah verifying call data on your Hardware devices is hard ideally it just shows you like a QR code you can scan it pop it into your cast tool or something like that Etc so I have some uh wish lists for different Hardware devices but good thing that l does they show the message hash and the domain hash for signatures which is very good so um and then I would execute it obviously normally if I uh if

I went ahead and accepted it but I didn't so um does that make sense are there questions with any of that I I missed the chat um are there any questions with any of that uh what is blind signing is that a technical term uh oh sorry uh no blind signing is a term that ledger came up with and it means just signing a transaction without decoding the call data now I actually don't even love that because if I have a transaction that takes btes as an input and then it will encode those bytes to send another transaction like if you decode the

transaction the basically you can have nested transactions right and you could be you can say oh it's it's clear signed um look I decoded my um my first layer of transactions but if like if you have a transaction that takes bytes hopefully that's making sense um you you can have transactions inside of transactions that need to be decoded so blind signing is kind of Ledger term for like signing transactions that aren't where the call data isn't decoded blind signing in the context of Hardware wallets refers to practice of approving transaction without being visually verified details uh so uh this can occur when using

Hardware wallets that like screens or blah blah so actually um the the definition leder gives and the and what the setting actually do are different uh which is again why I hate the term because it is same thing as hot wallets and cold wallets is it's very confusing uh I'm glad you're all asking here um and and and um uh um sorry I have stream mode I can't actually see your name but s uh the woman with who's whose usern name starts with s um uh in the in the chat thank you for posting that uh and that's probably what Ledger's definition is and I think Ledger's definition is wrong uh even for their device because when I turn blind signing on I can still verify

on the device all the data that I need right I can still see it all what it doesn't do is it uh it doesn't decode the call data so uh so for me blind signing is signing a transaction where call data is not decoded and that's known as clear signing so I think once again I think Ledger and the community are being confusing with their definitions and that's actually a huge disservice to everybody I've kind of ranted about this before but uh anyways hopefully that cleared it up if it didn't please ask in the chat I'm I'm reading the chat uh you you all are being fantastic these are great questions um by the way and then we're we're about to get to you know you

actually verifying some stuff I promise um I thought they had something to do with a Colo see the trouble you're having Patrick that the security part um I like Keystone's idea of QR code too yeah the QR code stuff is actually really cool so the the Keystone actually even has like a little camera on it soor you see the test um where it can scan QR codes and actually will show QR codes and it's really really nice um hey are you guys sending this recording to various Hardware manufacturers I've already dm'd uh many of them and many of them have ignored me um how are you going to verify that with the cast tool way too

much conversion work yes exactly uh so right now um it's really frustrating to verify um call data on your Hardware wallets um it's it's like an issue in the industry like I said there's a couple ways to do it um some wallets will decode your call data and that makes it a lot easier to do um others like uh will give you like QR most more should give you a QR code but right now the way a lot of people are doing it is they literally like read all the call data on device um which is awful roting for the cipher and Hardware while by implementing all the missing features uh I the cphon team uh is quite busy with a billion other

things we will not be making a hardware wallet um that's funny I'm e if need help what's E excuse me I'm recovering from some sickness well I didn't know there was such rudimentary issues I can see how North Kina hackers were able to Hoodwink the by bit electrical engineer ah okay yeah exactly um cool any other questions before I have you all do some signing does this does this not make sense who's completely lost who's completely lost who's following um who feels like they are they know what to look for when signing

a multisig transaction now and who feels like they understand the challenges when signing a multisig transaction or who feels like they're just totally lost and yes I feel like I'm I'm like exposing you to like how not ready the hardware wallet industry is for um defi all right Susan understanding challenges need practice and feeling a little lost okay uh Susan what are you lost with what what is um yeah what are you lost with admittedly never did okay great yep admittedly I've never played with a multi great all good what are the items to look out for yes okay um great point so what are the

item to look out for so let me let me uh consolidate this and I should put this into a Blog as well so the first thing whenever you're sending a transaction um I have to repopulate it every time which is super annoying let prove so uh whenever you're you're sending a transaction whenever you're sending a multisig

transaction first thing is uh oh first thing is always sign first never sign and execute if wallets reach a point where they show you what you're signing then you can sign an xq but as of today they do not so you just need to remember you need to verify what you're signing you need to verify what you're executing how do you verify what you're signing let's flip back over to metamask being the default here how do you verify what you're

signing well um you can verify one of two things either the entire safe TX struct or the domain hash and message hash or the safety X hash ideally you know one of those because those are way easier but if they are not given to you you have to verify all of this data you have to verify all of these parameters are correct is the two correct is the value correct is the data correct are all these correct everything you have to verify everything how do you verify the data is correct well you need to decode the call data

oops how do we decode the call data well we're going to run cast call data decode and this is assuming your Foundry is not hacked cast call it cod we're calling approve on an address un 256 this is the call data that was given so this means we're calling approve on this address for this amount that is what I want to do I want to call approve on this address with this amount so I verified the data of my signature looks correct and then all of these look correct as well especially operation if

this is anything other than a zero we should be a little concerned since I'm using my metamask as my source of Truth here I'm now good to hit confirm however if I was using a hardware wallet I would need to confirm all the data on the hardware wallet you want to confirm the data on whatever device that you're signing so these These are the bull points that uh we can put in the blog to summarize this now that I've confirmed all the data here I've confirmed my signature I hit confirm my metamask will sign it now I can view the transaction now in a separate step I will execute this and I'm going to verify a the execute as a

regular transaction right once again I want to verify the call data now instead of the signature for verifying transactions all you do is verify the call data uh metamask goes ahead and decodes the call data form me here you can see pram number 10 is our signature which is now actually filled out with like a real value cuz we signed it first if I don't trust metamask decoding capabilities I can copy the data myself I can go to um paste it in here I can see this is the exact call data that we're calling um and uh I could do cast call data decode uh exec transaction cuz on a

multisig wallet this is where you're calling you know all the parameters I have a shortcut called MSC paste it in and now I can see all the decoded parameters so I'm sending to this address value of zero eth here is the um actual data that I'm sending and I could once again decode this call data and this is what I'm talking about like nested transactions I could do cast once again call data decode this should be the approve transaction with an address and into 256 and I see I'm sending to here with this amount so I'm um I'm approving this uh address for zero so great the call

data looks good all these parameters look good and then this is the signature so that's just me verifying a regular uh transaction and I hit confirm and now it's going to go through so a lot of steps here and I know that's it's a lot of steps it's a lot of verification um but especially you know a lot of time like if I if I'm uh you know if I'm if I'm playing around on sapoia like I don't go through this because like I don't care if if my transaction is wrong but if I'm sending a real transaction with money or if I'm sending a transaction on a security Council for security you damn well sure I'm like checking all this stuff so um yeah good sh we should put this in a

blog all these the little bullet points um does that Susan does that um summarize it pretty well recap yes ah that is beautiful thank you s that recap is phenomenal that was a beautiful recap okay great cool oh now we have to worry that Foundry has also been tampered with uh yeah so when I say The Foundry bit you just always want to know what your security assumptions are since I'm using Foundry to decode my call data if founder gets

hacked you know it could be decoding my call data wrong this is actually why it's good that we have multiple different ways to do it so for example like this site uh is another way to do it um there's different tools out there which is good we want there to be different tools because um we want there to be you know redundant ways to verify our call data need just talk to uh I um yeah maybe we talk to Georgio huh no I'm just kidding can we improve the logs for the C I mean more readable uh yeah we could yeah or if you want to make your own call Dat decoding tool you can do that um okay so with all that being

said here's what we can do now I can have you all do some verification yourself if you have Anvil installed and many of you do Anvil comes packed with a lot of kind of dummy private keys and dummy accounts account n or 10 if you're one indexing like a lunatic is currently one of the signers of this multisig let me send this to you all

here so what you can do is you can go to your metamask go to accounts add Hardware account import account and paste the private key uh this one down here into your metamask and you my friends can do some verification yourself so what I want you to do and before you all do that I'm actually going to um change the number of centers to two and I'm going to hit yes execute which you should never do but I'm on a

test that and I don't really care um so like I would 100% want to verify this but I'm going to test that I don't care this is fake money so like whatever but normally yeah especially for sensitive actions like changing the number of signers you want to verify um what we can do now is if you want to come in and you want to sign one of these you can now if I do a little refresh here it's now a two out of three or it should be a two out of

three and I'm going to create a new transaction in here paste this in oh I'm supposed to be hiding this right that's right um and we're going have you verify uh a signature a transaction that I make so if you log in now to the safe website with this uh oh I don't have it in here let me do that take the private key we'll do add account import account paste it in we go to transactions here oh let me

disconnect or let me change to account two which is our Anvil 10 I can now confirm this and you should be able to pop this into your metamasks as well it's just the the the number nine here the private key that's this address here I can now confirm this I go to this page don't look at any any of the data here and I could decide to sign it I could decide to execute it I can do whatever I want here I would like you to verify that the signature here is

correct what the hell is this that looks wrong um and I'm going to tell you what we're trying to do is we're trying to call approve on the sapoia we contract for Z so please verify that it is correct or incorrect once you're finished verifying it paste in the chat what you think the answer is if it's valid or invalid and why valid or invalid and why and I'll give you some time to do this and if if you have a hard time getting

to this page this page let me know sorry I keep coughing so yeah so take some time can you share the available commands what do you mean what available commands um yino Co I don't know how to say your name sorry it is um the fee is a sapoia

fee ah the cast commands should be cast e e e

I check the data object in the transaction data actually was showing on screen some cheat codes whoops sorry should this have been approval for zero so you are verifying whether or not this is correct so I see some people thinking they they figured it out it's approving one way instead of zero so we have the TX Builder to approve a TX on the we contract and then toode the

call data no so you don't have to use the transaction Builder so the transaction has already been proposed so this is basically like somebody on your team says hey hey buddy propose this transaction in our multisig it's a two3 multisig can you sign this please can you sign and execute this please and you got to go well what are we trying to do and they say Hey I'm trying to approve zero way on the we contract and you go okay cool let me verify that that's actually what that's doing so you don't have to use the transaction Builder where is the file to see the exact transaction parameters what do you mean might as well practice if I can well so say just uh just put in the

um put in one of the answers yeah so we're approving one way instead of zero way and that was how it was done so um I want to give uh some other people some more time to uh try to try to get try to reach this point as well cuz maybe you're wrong maybe they find something else so say's saying hey we should should not sign this and what say just did if he is correct would have protected by bit by

the way from 1 point you know $5 billion loss hey the call data is wrong actually that's not true they um he would have needed to check the safe hash the signature but I digress should put a timer up yeah I guess I should I can't see any call data in my Med mask is it possible I have an older version what do you see you want to send a screenshot of what you see Chris thinks it's not safe to sign why does Chris thinks it's not safe to sign I'm not allowed to send screenshot oh yeah that um makes sense uh can you

copy paste what you see or like type out what you see oh aquous giving people permissions and this is great if you've never worked with a multisig before like this is awesome um getting this experience now aha yeah okay so you don't see anything so you're seeing a transaction request so first off why are you seeing a transaction request is that right so we have to decode

that ah but are you decoding it where are you decoding it are you decoding it from the safe UI oh wait hold up there might be an issue with the safe UI this is why we need competitions this is why we need

competitive tools e oh sorry gang I

uh uh I replaced that transaction with this one sorry I think there was an issue with the last one or wait not this one sorry uh this one apologies all I um you use this one instead I think the safe youi bugged out on the last one sorry about that would you love to say the safe UI huh oh it's super bugging out

actually sorry about this gang works for you so Elmore posted that it's uh requesting a transaction for for them and it's requesting a transaction from me as well which is wrong I I click sign but I keep getting TX request yeah so that's that's what I'm getting now too and that is the website bugging out for sure um that's super bizarre oh my god did they yeah it shouldn't be

uh that's a bug all right well that's annoying okay so maybe you're not going to get to use the safe transaction wallet or the multi wallet uh uh yeah the it looks like it's bugged right now onoo for some reason um but this is still good I mean if you see something bizarre and weird like that that's a Quee to like not sign anything uh anything that looks off or weird you say okay that's wrong I'm not signing I'm not touching that um yeah it shouldn't be asking you to

send a transaction to it should be prompting you to sign this this struct I'm going to see if there's something else weird going on maybe it recognizes that as an anvil key

or something I mean that would be pretty impressive let me just check that wow s sorry about that gang it looks

like it it recognizes that as an anvil key or as like a a fake key that's crazy actually oh I didn't realize that uh sorry about that gang wow that's actually so cool but even with this I decoda and and got the correct hash I think did you show a show a screenshot of what you got all right sorry about that gang it looks like it

uh doesn't let you do that that's actually crazy like knows that that's a Known Unknown address huh so I can't even add Anvil one what if I add Anvil one me tried to do Anvil one

sorry e I'm going to reject that other transaction we'll see if we can do uh

see if Anvil one works fun time here

have to like switch back and forth between all these wallets that I'm demoing okay um so now we're going to try envil one I just added this as Aigner instead um oh LOL I canceled the other transaction oh my God that's so annoying so I have to make another transaction okay well this is some of the the beauty of uh dealing with multisig though get to deal with all this uh this fun stuff it's good though I mean um when you get a bigger team um it is

safer to have like multiple redundancy is to really make sure that you don't screw anything up bad so try this one more time and if this doesn't work um then the safe UI is just smart enough to know that those are all Anvil counts and they shouldn't be trusted so uh but let's let's try this now so I just made another new transaction I took Anvil 2 off I added Anvil one so here's the transaction now and same thing if you go to metamask account import account import account in Anvil we can take private

key paste it in here and now we have Anvil one and I'm going to hit this little thing edit which account is connected Anvil one is going to be connected now now if I go to confirm let's see if I get that weird pop up again oh okay for some reason this one actually works okay so there's there's something bugged with that last one I don't know what was going on something with that last address I don't know but uh in any case uh try this one so this one now when you hit sign metamask should actually pop up with the data for you to like try to decode and

and make sure it's correct so all right sorry about that gang yeah use Anvil uh or EXC me Anvil zero I call it Anvil one but it's really Anvil zero here's the private key and yeah so now we'll take some time go verify that I mean a lot of you pretty much got it um yeah I could swap it out with a random private key but um yeah a lot of you pretty much got it um uh where we approved one way instead of to um or instead of zero but you really do want to make sure that you you

can do it in this right you understand how this works um so that you actually know what you're signing and you verify all these parameters are what you want them to be especially the data so right so somebody asked hey how do you decode the call data um and some of you are doing that right now so we'll get I'll give a you know we're we're done in um 6 minutes anyway anyways so yeah if anyone has any questions about that process um feel free to ask but uh we yeah we can also take the last six minutes here to have you actually verify this transaction yourselves for those of you who have never worked with a multisig wallet like now is a great time to actually like um start to familiarize

yourself by at least verifying this like this will be your first step um on a team with a multi will be somebody will propose a trans action then they'll send it to you and they'll say hey can you sign this and this is where you as the security-minded person can say yes this looks good or no this looks horrible Chris perfect yeah that is what you should see I don't know what was bugged with the last one that is what you should see and that is what you need to verify spot on ah I love that you that you're seeing that that's great e e

yes so for this one I actually did it right which is wrong I should have put one way um for this one it's zero way law cast the code elore that is perfect yeah so you got that in your metamask right and not the safe UI perfect yeah well done excellent good job but did you check all the other parameters you check all these ones I caught you you didn't I mean you lucked out that that's you know the only one I screwed up but

you have to check all the other ones okay so this is good I'm going to make um some examples uh really appreciate you all uh going through this with me going to make some examples where I with some of these other ones and you have to verify it appropriately and we use safe hashes to verify no yeah

so this is where um I was a little bit unclear that's a that's a good question so uh Domin asks uh can we use safe hashes to verify no I'm still trying to reset my bash profile to 4.0 so uh okay so for safe hashes that tool is to verify the domain hash and message hash and saf TX hash if you're using metamask metamask doesn't show you any of that uh metamask actually deres that information from this from this struct that you see here um so if you verify all this data is correct and your trust metamask is going

to do the calculations correct um that also works it would be better if metamask also showed that information but metamask does not uh some wallets will and that is much quicker to verify than having to like verify all this data um so we would prefer to be shown the safet TX hash domain hash and or message hash but as of today most wallets do not which is very frustrating at the end of the day what's the ideal uh criteria of trust assumptions um how much paranoid do we need to be I mean considering the worst

case scenario where even the tools like e and Foundry can be rigged too so it's um making me appreciate the concept hashes even more ex exactly right because of every single time you have to verify all this crap especially if this data I mean we're lucky this data object is really small but imagine you call some crazy large function verifying this is is actually going to be very timec consuming so that's where like if it just shows you oh here's the safe transaction hash or here's the main hash and message hash that's way quicker to check than all of this stuff right and so that's why we would prefer um to be shown the domain hash message hash and save transaction hash because those are

so much quicker there's a real thing called security fatigue where you know um if you have to go through a thousand Hoops to do something and maybe you don't appreciate all the Hoops you can reach a point where you're just like oh come on get on with it already or like skip things or cut Corners because you're so sick of doing them and that's actually a security issue so you really want um verifying this stuff to be as easy as possible and that's where those hashes come into play that makes it way easier to verify this stuff and that's why it's better if more wallets adopt them um because then you don't get that security fatigue right because it's so much easier and quicker to verify what

you're doing so that's a that's a great Point um but to say so your question uh what's what's the ideal criteria of trust assumptions so since we're technical folk we want to have as minimal trust assumptions as possible now in a production multisig uh environment there are probably going to be people who are not technical signing things is this great no but as long as they can do basic verification that's fine like if you you teach them how to use you know the open Zeppelin site the safe yous that's great right that's already good uh enough um well not it's not good enough but it's

good um but at least one person on your team who signs should be hey Chris well done yep exactly well done exactly somebody on your team needs to actually know what the hell is going on under the hood when you're signing things somebody needs to be able to do this stuff uh and for the person who is going to be in charge of that security um uh and these trust assumptions they need to know Well Done Chris spot on um they need to know what the trust assumptions are so ideally the trust assumptions are as minimal as possible but you know what they are so say that that's like the

critical thing you know what the issues are so for example when I see this in my metamask if metamask is My Signing wallet what do I know I know that I'm trusting metamask as my trust assumption hey thanks hred uh we're just getting wrapped up here I know metamask is my trust assumption since I know that I know okay well my metamask is a lot easier to hack than my Hardware wallet I should probably switch over to a hardware wallet right if I take this call data and I decode it with Foundry I then know okay Foundry is another trust assumption or another dependency and this is where it might be good for you to look at your team and

say okay right now we're all decoding this call data with Foundry maybe we should have some people decode with Foundry some people decode with something else some some people decode with something else and that all just comes from knowing your trust assumptions or knowing your dependencies if you think of like your team as like a software package right uh and you write out all the dependencies that your multisig um uh transaction process depends on you can find the things that more people depend on to be kind of uh the weak link and maybe you want to mitigate that maybe you want to replace that tool with something else so the the question of saying hey like what are the

ideal criteria of trust assumptions how paranoid do we need to be what's most important is you understand where the points of failure are what are the trust assumptions and are you okay with those trust assumptions you know like maybe you're okay trusting Foundry right cuz if you download Foundry um it's much e it's much harder for someone to you know break into your computer adjust Foundry whereas it's much easier for somebody to uh hack the safe website right it just is um the trust Assumption of your Foundry on your device versus the safe UI website is um you know who are you going to trust yourself or some random entity right it's much better to trust

yourself and understand those trust parameters so does that make sense I know that's kind of like an abstract answer but hopefully that makes sense reducing the single point of failure dependencies with redundancy is a great idea exactly that new guy spot on Patrick why is metamask a trusted wallet so that's a great point so I'm um so uh this is where um you might want to ask like hey like do I trust uh this wallet um I think metamask is a great software wallet because it's open source it's used by a lot of a lot of people um it has been through many rigorous Security reviews um but for like uh being a main signer I

would say uh no you should you should use a hardware wallet instead um but uh do I think metamask is a great tool yeah I think metamask is absolutely a great tool but um you know maybe you say hey like how do I know the hardware wallet is a good tool like maybe that's busted there have been examples of Hardware wallets getting broken into and tampered with right these are just the things that especially you all as technical folk you want to understand this set of signing exercises can be packed into a CTF security education game if you ever want to create a game I think that's what I'm going to do I think that's what this uh this Workshop showed me that's definitely what we're going to do if you have a hacked PC and you sign a transaction from your Hardware wallet can the hacker get your private key

great question elore this is where your Hardware wallet choice is important so most Hardware wallets will never have the private key leak uh and this is actually why again we want to say I only trust what's on my my Hardware wallet because they're harder they're even harder to hack they're even harder to reach especially if you never connect them to the internet right most uh for most of them the answer is no where they they don't the um the private key is uh used in like a secure element different from like the rest of the computation on the device um so if your computer gets

hacked um your private key on your Hardware device usually is still safe depending on the hardware device most are still safe though yeah they cannot get your private key but they could spoof the call data on your computer and send a malicious transaction to your Hardware wallet yep great question UNR question but is there any competitor alternate of chain link let's keep this to uh to wallet uh wallet related questions and I was supposed to to

create a type form how does Phantom prepare to metamask in terms of security um here's what I don't like about phantom phantom is closed sourced metamask is open sourced I have no idea um I I can't uh that by itself is usually enough for me to want to stay away from a tool so for like another example so Ledger is close Source I don't like that uh treasure is open source I like that Keystone is open source I like that that close close store close Source um they could be uh you know um they could have a back door where someone of their team could you

know get the key um they could be doing some super secret way to transmit data out of the device um I don't like clo close Source especially when it comes to security is terrifying um there's a lot of people will say oh like no it's slow close sourced as a security principle if hackers don't know what the code is then you know that's safer um that's actually a fallacy known as security through obscurity hey let's just make this really obscure and weird and and that's like secure that's not how it works uh hackers have way more time than you think they have um and if they can uh a lot of a lot of them will figure

out how to debug your code um because it's going to be just compiled to assembly and hackers who have enough time will decompile your assembly yeah Mac OS is closed Source not great uh which is why like cphon team we do a lot of our work on Linux which is open source do you consider anything 100% safe nothing is 100% safe that's a great question nothing is 100% safe there is no Silver Bullet to security there's no silver bolt to security what we can do is we can understand our security assumptions we can understand our dependencies and we can understand our

weak links and fortify them it's kind of like asking is there a is there a castle that is unreachable and the answer is no there's no 100% secure you can just make things sufficiently difficult for attackers and you want to make them as difficult as possible even pass so I mean passwords are a good example right if you have a password that has like eight Alpha alphabetic Characters you know a hacker can crack your hash in like a matter of seconds right but add a few more characters and it takes them substantially longer to crack your

password so that's what we want to just keep doing just keep adding more and more uh layers of security can you download metamask from GitHub you sure can you can download metamask from GitHub the whole thing you cannot download Phantom Packers I have no idea what my mother's made in name is I'm Gucci that's funny how can we use AI to improve wall security and signing transactions um i' I've that's something I've actually thought about for a while like it would be great if you had like an AI agent who like reviewed D your transactions and like like was like Hey

like this looks kind of spooky and here's why it might be spooky um it might also be terrifying for like a privacy thing to like give an AI agent your um access to all your transactions obviously uh yeah AI can be tricked as well so it it would not be great if you relied on them um there's actually a teamate them by working on an AI agent power wallet I think that's cool um [Music] however I also know exactly how I would try to trick it and that kind of terrifies me so when you're downloading metamask as a Chrome extension you're trusting Chrome with the download data correct um a little bit uh so your private key in your metamask is stored

essentially in your Chrome or your Brave or whatever um so this is again where it would be better if you using like an open Source browser great question all right so we're 10 minutes over here um I was supposed to create a type form for you all uh to give us feedback on how this went um there are already a whole bunch of improvement points that I want to make uh the next time we do this and yeah like making a little multi say Capture the Flag sounds really exciting

um thank you all for coming um hope you all learn something uh we'll I'll probably post uh a link to a type form or um or uh not a type form uh some type of uh form to give us feedback on what you would like to see next or what you would like to improve on this and um thanks all and have a great rest of your Saturday all right how do I end this event maybe I'll just sit here because I don't know how to end the event end stage for