ZK Hack Lisbon: zkConnect: The cryptonative SSO? - Sismo

20 Apr 2023 · 46:39

A presentation from ZK Hack Lisbon, the Zero Knowledge Podcast's first in-person zero-knowledge hackathon, introducing Sismo's zkConnect, a proposed cryptonative approach to single sign-on. The talk covers how zk tools and domain-specific languages were used across the hackathon to build products that show what zero-knowledge proofs can do in practice.

Topics

Transcript

foreign [Music] verifier so I will print all of that today we are doing a bridge between personal data and applications so what does it mean exactly as a user

you have some data a lot of different type of data yeah and as an application you need this data to do stuff about it so the user personal data you have can be like your bank account your very private addresses with three accounts where you have all your e-serm where you have a nft whatever you have also your more Public ENS accounts where you have for instance you follow system that lands on lens or you have your ens name and you have also other public information like for here I have my Twitter account and what what you want to do with all of

that is just reveal some some specific data to Applications for instance here a ZK drop application could be okay I want to add up some nft to only sismo Twitter followers so the problem is currently as a user you have all this data it's all like merge and you just want to reveal this specific data um another example could be like you want to get a mailing list only to some nft holders so you want only to know if the user has this nft to let it go through your Gates so I propose to start with a demo of

these two examples the ZK sub which is a mailing list and the ZK drop with it which is a ZK airdrop uh yes so here um the zika drop I don't know if you heard about the merger pass so the merger pass is a Soul Bond token which is so non-transferable in Ft received by contributor to the merge so it was a project lead by Tim Baker and the idea is that you could claim this nft only if you are part of the developers that contributed to the the merge so basically there is a list

of around the 100 accounts so we can see that there is some GitHub accounts some Twitter accounts are directly addresses and this list was created directly by Tim Baker that created this this list so then I I want to claim this nft so I had a destination account where I want to claim my nft and I I need to prove that I am eligible to claim this nft so I use ZK connect uh I'm going I'm redirected back to the world's sismo where I have all my different data for instance here in my world

and so it's a demo world so I'm impersonating a vitalik like icon so I can see that I have my Public ENS my GitHub account my Twitter account is some other private web free accounts and when I am on this system world I I have a request from the get verbs that want to see that I am effectively a merge contributor and that he will use a user ID generated specifically from this uh Vault to use inside the ZK drop application I will talk to this about this later so you say Okay I want to connect I want to generate my ZK proof I'm generating music approve on this system

Data Vault and then I am redirected back to the zig adverb and I can claim my nft so the process is pretty simple it's like SSO and there I am so now I have another example where we want to have the lists we want to have the email addresses of all merger contributors for instance to uh to to send free tickets for HCC or Defcon and stuff like that so it's it's not Unchained but it's more of chain verification where I will directly send this in an even bright email to the user so same process I do the ZK connects I'm asked to prove that I am a merge

contributor okay and then I can just add my address and it's submitted so when you submit this your address you submit it back with the ZK connect proof and it's verified on the backend part of this ZK sub staff and it's sent directly the email to the user so we do example and demo of gated application thanks to ZK connect okay so how it works uh more in detail sorry you have your user database

which is an an sismo data world in the front end directly so all happens in the browser directly you have all your icons it's like a one password manager where you can import all your icons in it and you decrypt it directly in your browser and you generate this proof on the browser directly and you send it back to the different application so in my data world I can import different accounts so I can import my Twitter account my Public ENS and they are I have all these data that are like added inside this is smooth database when I send back the ZK proof the the application will directly verify the CK

proof through a smart contract functions or on the back end so smart contact will be the other application drop and the back end will be the sdk7 so the idea of the CK connect is to have the best single sign-on possible defects and usability for instance what is a really Game Changer here is that as you can import all your different type of icons into your system and it's self-solvent software and identity because you want the only one to be able to decrypt it you can import a very very private information in it like your very private wallet with all your transactions your your bank accounts basically and also

more public information and you have all all of this inside the same um in the same Vault and you can granularly reveal some specific data inside to application so for instance if we take sign in with this theorem you can't do that because we sign in with the term you just have the accounts and that that you are going to sign in with with all the data Associated so the application or exactly all the data you have and sometimes you don't want to share this data um so with this ZK connect you have mainly three features the authentication part as an application you can request from your sismo Data Vault uh if you own a

specific account so with your account or web 2 account for now we have GitHub and Twitter accounts so uh here we can see it a little bit like the Vex Improvement around uh like uh like open ID connect because in your application you just have to integrate GK connect to request a notification of a GitHub account or Twitter account and it will be you you you won't have to implement all the stuff with GitHub or Twitter it will be just with this model and your users will only have to import these accounts once into the system data world you can also do what we call data claims

so there's this user inside inside this world have for instance a type of nft a bank for instance or birthday particular or whatever and you have aggregation at score because in your system data world you could have like okay a bank and an address about April club and another but it will look up and each different addresses and find the ones that are that have the the nft ownership you requested as your application and finally the the third one is the message nature you can ask the user to send something like sign a link in information or you agree yes no

or whatever so you can do all of this together in only one proof so the uh what we call the notification request a claim request and uh and the message signature so in the future like you know when months we will have aggregation and multiple like multiple data in the same proof functions you could ask okay I want to have the guitar back on Twitter account of the user and I want to have a top 10 nft ownership for instance or uh and you you will have all this information in same the same redirection

flow for now it's only like one identification and or when a claim and or when message so for the flow um more technically we have what we call the ZK connect requests so as an application in the front end you generate this ZK connect request then the user is redirected back to his user Data Vault he generates the ZK proof in the browser directly so it's privacy preserving and it sends back this proof in SDK connect response that is verified directly in the app so this model that is playing already

but you import all your different accounts and the automatically lead fine all the data you have and add them inside this system so how it works technically it's a group membership so you need to to the more type of groups you have the more granular data you have because the ZK proof is just proving that you are part of some different type of groups for instance a group can be the list the list of all the bank owner and you also have the possibility to have value like the balance you could imagine you have a three pack you could have a group with a all the accounts and the the exact balance they have and when you do your requests you can ask okay I want to know

if you have at least one Punk but you can do also okay my ZK connect request is I want to know if you have at least two tanks and inside the zero Android circuit so we are using Circle we are we are verifying if we have the well request so we are between 0 and the maximum uh you can also emboss for GitHub accounts one of the usage is like you can do okay contributed to this repository I contributed to I don't know top D5 project are there and uh and you will be able to prove that as a claim request so if we take the different layer here of this model tables you have the authentication but

um if we don't if you don't have any data sources imported so GitHub Twitter or ethereum address you as when you create your system data watch you have a secret inside and you get you can authenticate as a nanon with this secret so it's what we call authentication type and on when you have imported different data sources you can also authenticate yourself with this data sources directly so when you imported this different data sources uh yeah sorry so this is what we call a continuership then thanks to these different data sources imported into your system database we can find if they are part of

some groups so it's the data gems part or or claim data path basically how it how it works is like in the front end we download all the Merkel 3 we are we we are looking we are doing a lookup inside all this Merkel tree these groups to find if you have the addresses inside and we can know uh if you are a tank owner if you are a heavy delegator or whatever and finally the message signature you can just sign a message inside your proof so basically it's an input which is which hash this message and then when you generate your uh authentic authentication layer or your data

request you can bring with it some message so you can say yes or no or whatever the proof you verify it and here it's an example of a web 2 SSO like experience then you can have a request of ECM address so it's more like you're sending with this serum then you can do claims like okay I contributed to seismo core I have an ens I follow system lens and this is his group membership verification basically you do okay I want to

ZK connect request so the Red Data gem we called it like that Atomic data is like I have a crypto plank okay it's sandbags proof with the verification of this uh data request and finally message nature when you do your request you send your message I have a TDS for this governance and it's ready it's uh you can verify it thanks to the CK proof so now I I want to show you a little bit how it works the devx and how you can integrate this EK connect directly into your app so the first step here is to create your application into the factory.smo.io

so here for fun I created the ZK hack Workshop uh application and why why this the the purpose here is to authorize some domains to request data from your system data world so then yeah sorry then thanks to this application ID you will have an application ID that you will use inside your app to request the data from your user for the devx part you will have only a

ZK connect button which is a react button you also have a typescript library to help you if you don't if you are not on on react but you will so do your config here so the config contains the app ID you will generate your claim request and out request so you can only do at regress if you want to authenticate just with SDK connect but without claim you could do bus so here I will say okay I'm part of this group ID and I'm I have a notification type of addon thanks to the sismo data world and then with the ZK connect response you can verify it directly into your smart contract for instance here we have the ZK connect

response in bytes that you can verify uh and at the end you can create your token ID for a 721 contract using the verified out dot user ID which is a unknown user ID you have thanks to this fault I'm going to show you more directly here so let's start base of 10 so what is interesting here is the ZK connect button you have the config the requests the authentic question request message signature request if you want

thank you so yeah here it's the report so all this repository are open sources on the link at the end of the presentation so here I will show you a local when I click on the ZK connect request I'm requesting the zk71 so it's the app ID ZK sub here but I show you that I have created the ZK hack1 so just updating like that and going back here when I do my ZK connect request I can see that I have the ZK hack and

zika hack Workshop connection request so it was in the factory here I have the app ID here and that's it same for the group ID when you do your Chrome requests so for the the demo I show you we ask that you are a merge contributor but now the same we can thanks to the factory we have the possibility to create data groups so basically when you create that type group you you will Define how you are going to create this different type of data you can do it directly through the factory with UI so you can for instance

create the list here by hand but it's not very interesting because it will be totally static and you can create the group through data providers so you are the World list of data provider here that was created by user community so everyone can contribute to this repository to add different type of data providers I know for instance we have the GitHub one where you could find other list of all the contributors or the stargazers of a repository instance here you will need to do yes so we can add and so we can add

different type of data group you can merge the existing one so let's say I want the the merge the merge contributor also okay I can create a new groups that will combine these groups I can also choose a frequency let's say daily and my group will automatically automatically be exec so the way to con to build this group will automatically run each day and the root so it will be a Markle tree at the end and the root will be sent Unchained so it's like a macro 3 as a service infrastructure when you do this Factory UI no code it automatically generates a pull request on the sismo Hub repository

so everyone can go here and contribute so change update create new data providers and stuff like that and uh so you have the group generators and you can find here the different type of groups for instance we have uh I don't know we have a proof of humanity uh Humanity pH Maybe I didn't say oh yeah sorry this one and you can see here how we are building the group so it's a weekly updated group and uh the generate function is in

typescript will be executed so at a weekly frequency it will request a subgraph get all the data so we can see the query here bug this data in the poh data group you have this description and specification here it's all the data you that you can see directly here in the factory so when you are exploring the different data groups there we were with proof of humanity proof of humanity here also you can yeah search for your group ID you can see the number of eligible users inside so you can see here there is around like 16 000

users you can see the last generation the Next Generation so basically the Explorer of the groups and you can go to the code where we were here directly with the factory okay yeah sorry can you so when it's done you can no no you can you can create a pull request to update it later so for instance if we take let's say so we are going to take the merge

contributor oh yeah sorry so here the the list was made by Tim Baker and he updated it multiple times to add new addresses inside when it makes sense so we can see like there is some pull requests and we can see like a new eligible accounts or stuff like that so it's updatable so yeah so yeah so I I did a workshop at zkrk like uh six months ago and we created on the go

um a group so people were sending their addresses in a in a chat to us fun and so we created the group so I will as we are modifying it I will just show you this group so let's go back to the factory search for the ZK hack Workshop it was there in December and you can see uh the group generator here it's a static list also because it was sent by the in the chat and you can see the eligible user there so you you know you have ethereum account GitHub account so it can be hybrid groups okay so let's change it by zkrk System

Workshop let's go back to my application so I'm in localhost do the ZK connects workshop and requested data is now ZK hack three system Workshop so you can see it's exactly the one I'll show you there so it's very very easy to change the request you want to do from the words and uh to get back this information okay so then we can verify directly into the smart contract so I will show you also

so this is a ZK drop uh 721 it was used for the merge contributor example I show you so basically you have a library there you import this library and your contract extends the ZK connects F and then you will have like helpers inside your smart contract in your Constructor you set the app ID so it's exactly like the app ID that I showed you before it it needs to be the same as in your front end you have also your group ID and when you want to claim nft using ZK connect you need to bring this ZK connect response so the ZK proof

basically with the address where you want to Mint it okay you will just verify the result so here you will verify this ZK connect response you will add the authentication requests and claim requests you are you wanted so the group ID and here we have we are of odd type Anon because we want to so our type panel is like basically I'm connecting with my sismo Data Vault so I will have a user ID which is a unique user identifier computed inside zero knowledge proof that hash my secret with the app ID so I will have a user ID which is only

specific of my system Data Vault to this application if I have if there is different contracts they use different app ID and they are forced to thanks to the authorized domain each user ID will be different so and channel will be totally Anonymous and there is no link between My Data Vault it's the same on web 2. imagine that the web to use a application use a ZK connect they are hacked I don't know why but the user ID of the world will be different for each application so it's totally safe you are totally isolated for the claiming request so we need to put the group ID we already want because

SDK proof in itself does not mean anything you can have secret proof for different type of group so you need to verify that this ZK connect response corresponds to what you ask what you requested first that's why you need to put again the group ID you originally wanted and finally you will add also a message signature with an uncode of the destination address so why are we doing this it's to avoid front running because the GK proof could be from Trend but if inside the ZK proof you have also this message natural of the air control you you put as a destination account as a two account uh it can't be front friend so and there and there you go you have

your token ID you can Define it as the user ID of the verified authentication as a none and mint it to the uh to address here so what is interesting now is like you can do you can block the transfer the transfer function so here it's reverted and you can transfer it a lower transfer only with a new ZK connect proof the functions you want to to move it it's so it's like a cell band token you can't transfer it but you can move it so it's like bound to the system data world you can move it to another

destination if you lose the the first destination for instance so you do okay transfer with the key connect same interface here we verify again the ZK proof so the connect response we get back the token ID which will be exactly the same because you authenticate with your system data worlds and you can directly do the transfer form to so it's very very easy to to implement uh yeah so you have the repository here we also have some tutorials so you can go to our Docs um

so you have all the CK connect tutorial here the con get your contract with ZK connect is explained there you have all what we talked about so you need to create your application first and the button in your in the raw in the front end parts and then you're more uh contract part so now we can also do this in a more web to application with the backend so it's it's our mailing list ZK sub application ID mode before and so let me show you so I it's a node.js example I have an

API with a slash subscribe endpoint and I will verify here the GK connect response so it's a it's exactly like in smart contract but it's in typescripts and the verifier the zero knowledge verifier is just in stepscript and you import it exactly like uh with some npm packages so it's really very very similar to the smart contracts one so again you put your auth request your crane request and you can get back to your user ID like that so then we can save in the database okay the user ID has an email and and yeah and say like if you already

subscribed you can't subscribe anymore because uh then it's CB resistant stuff the same you have the repository here you can go to the documentation and uh request data privately with ZK connects and the the tutorial explain how to uh so to do the button and the verification path is uh here ZK connect.verify in typescript okay um so what we are trying to do at sismo is to build all what we are doing in a modular

way so the idea I present choose the ZK connect step it's like very layerized from the proving scheme so I said you we are using circum now but in the idea you can could add a little a lot of different type of proving scheme in the future I don't know Noah zero knowledge verifier approver or other other ideas and the secret connect layer is like layerized from this proving scheme it's not directly tight so basically you have earned this layer the authentication request the claim request and the message sign editor we have our dock here our build.sismo.io just

okay um so yeah we put our bounties for for the zika Lisbon and a lot of resources that are like an overview and a lot of different ideas sort of application you can do using ZK connect so yeah I'll let you go there and you can ask us questions we also have our builders.sismo.io telegram group where you can join and ask questions and yeah do not hesitate to go to our GitHub repository so all of what we are

doing is open source you can see our uh proving skim circuits you can see our contract the SDK connect engine verifier how it works so we are using fundry uh so yeah okay thank you uh yeah so maybe you yeah [Applause] and just yeah we are hiring so you can go to jobs.io and see what we we are proposing I don't know if you have questions Maybe uh yeah my question is I don't know if

my understanding is correct but it looks like if I have a date about and I want to prove this that the data belonging to this data world it's like a very typical zero knowledge membership proof I don't know your Technique behind this if this is the membership or you use other way to realize it okay so what I understood for your question is what is exactly the proof membership we are doing inside this system data table so I will get back just this slide so in this slide you can see more precisely all these features of the

sismo data worlds so basically this is my datability is just like a password manager it's encrypted stash of secrets that you decrypt only on your browser on your client side and then you download all the different groups that exist in sismo and we look up inside the front-end part each accounts where if they are part of some groups and if they are part of some groups you can prove it with zero knowledge proof so it's basically doing a Merkel 3 inclusion proof verification inside the circuit and then with zzk proof we will compare it to a a root of this macro 3 which is Unchained

and verify if the if it's coherent with the group ID you are you are looking for so this is only when you want to prove that you have some data or you are part of a group so a claim data request for now is only I'm claiming that I am part of a group but if we generalize it being part of a group is like so when you are in a privacy stuff and when you want to show information about yourself it's always like group Centric uh I don't know I have a 29 so there is a group of old people that are 29 and I have some ecrom there is a group

of old people that have some ethereum and exactly so it's very like claim group Centric and you have an anonymity set of this claim if you have only five people in this type of groups that means that you are part of this only five people so you need to be careful if the group is like 1 million users it's like we can't guess anything about you yeah yeah you can only be like you're narrowing

them yeah yeah true so when you do your request to the world I will come back here so for now it's very succinct but in the future we will say for instance if you claim like you are part of this group and this group and this group and your anonymity set is like two two people at the end you will have a one a warning there that say okay so your anonymity set is too low and stuff like that so for now you can regress only one authentication and one claim but in the future you you will be able to do operation between so you could say Okay I want that the user is part of the git coin passport group and all proof of humanity or worldcoin

or whatever and we can do all of this instead of the same proof versus that can be in a group so so yeah there is in theory there is one so our medical three have a maximum one million accounts one million leave it's a 20 level of the market but so how it works now is like you have the group Michael tree and we have what we call the registry tree it's a another tree with all the root of the different trees

and you can split it in multiple trees so for now the most important groups we have created is like eight Millions users and then it's just in forecast so like we need to parallelize the building of the tree we are using a hash Poseidon which is not as fast as kichak and yet and freckles to rebuild all the tree each time but yeah we can go like eight million 10 million it's pretty nice already following the previous question uh who will have the right to update the route of the tray on chain

yeah so for now this is interested it's all happen here on the sismol the idea is it's publicly verifiable all the data are publicly verifiable the API is open um you you can see when the I don't know when when the generation group are happens what happened exactly when the root is updated why and but yeah it's publicly verifiable but trusted in the future we will we can do like ZK proof of generation of the Merkel tree for instance I know if you know error.2 steam or action but basically you can do in one proof with

recursion and stuff like that but in one DK proof you can verify the list of all the crypto pen Corner generate the Merkel tree inside the same proof so a system specific marker tree like uh Posada and having the new route that is so you will have the old wood the new root and push this uh on chain and we'll be sure that the zika proof is is working because like it was generated in size inside a huge Music proof so yeah it can be like decentralized like that in the future regarding a dynamic groups let's say you

proving the national version as you know that is moving constantly it's pretty transfer can I check if it's the other funds are transfer to is already existed yeah so very good question for now the group generator can run at a lower at the maximum frequency of a daily update um for each groups you have a timestamp I will show you there so it was I think there no sorry for instance in your cream request you

can say Okay I want only the latest good generated or I want uh specify a specific timestamp here okay I don't have like but uh yeah the idea that in your application you will say okay for instance I will generate a group of people that have a crypto Bank during more like one month and I will ask it to refresh it like every one month so you can say Okay I accept this trade-off but yeah the group is generated every daily update for now and it's up to you as an application to do if it's okay for you or not or if you want to refresh the connect proof in the future we will update it quicker

yeah but uh not for now who's running the operator right now baby yeah for now it's a system from using the The sismo Hub here it's open source you can contribute it we already have a contributor that contributed to to it you can also oh yeah we have issue there where you can functions you can create new type of data providers and these data providers will appear automatically when it's merged inside the factory to be able to generate these groups in Nokia UI so for instance all these data

providers was created by the community and it was just quoted coded in the system and it's available thereafter but ruin it it's like for it for now it's trusted it's us ually yeah you have a group generator each time it

generates a new groups and you have a latest group the latest generated ones but you can still prove membership of old groups if you want to suggest that the timestamp will be will correspond to the old ones but if if I repeatedly go to some site and I approve that I owned a crypto Punk at that time yeah and I go to that site in April I go to that site in May um and I go to that site in July and maybe I'm not in it in July or maybe I'm not in it in March yeah but with your claim request we will say that you will add a crypto Bank in July because the group contains the timestamp with it yeah but then as me makes that's me claiming

membership of three kind of different related but different groups yeah crypto Bank in April crypto funky March crypto funk in July so then I'm reducing my anonymity set because yeah membership is public so the question is is there any I don't know is there any kind of like gray areas only compromises that can be made so the groups are not fully public so you can't just correlate membership the groups over time yeah so for for us like the anonymity sets if we take foreign they say like if you wait 24 hours it is safe and 24 hours you have like 20 30 transaction only so when you have 30

transaction if you have another empty set of 30 or 50 with the world anonymity set of all the others that deposited inside you are only like safe it's very difficult to try to find all this correlation because when you say so uh you are assuming with your question that you have your crypto pen in the same account but maybe you move it to another one and we don't know from which account it came we don't even know if it's from the same account or not so it's like a combinatory uh it's yeah it's combinatory possibilities so it's very complicated to yeah yeah but but yeah so for now we don't do analytics around that but the

idea is that with your system data World each time you share an information we will save it inside that you have shared this information a little bit like uh connect with Google where we see all the application you connected with and the data you share so in the future we will be able to say Okay I I share this claim at this time to this application I sent this one on chain and what what what I am doing so I am decreasing a lot my anonymity sets yes or no and stuff like that but it will be like in the future okay I think it's the end of the questions because we have another presentation in 10 minutes so thank you Leo very much [Applause]