welcome back everyone to the d5 course i'm andrew and in this lecture we are going to be talking about decentralized identities and their role in d5 decentralized identity is a fairly broad and expansive topic and in this lecture we're going to focus on three main aspects of decentralized identity to start with we're going to talk about a fairly practical role that decentralized identity will play in defy applications which is the need to link in external accounts like twitter accounts or email addresses and incorporate them into the function of some smart contractor defy application i'm going
to talk about the attestation model which is a high level framework for understanding the roles and processes that are involved we'll talk a bit about decentralized identifiers and what it means to pick a good string name to identify a person or an account and we'll talk about a technical method that's based on zero knowledge proofs or zk snarks and um that's really important for providing security guarantees like privacy uh in this context and those are called anonymous credentials uh the second facet is we'll talk about real names and authoritative identities like state government ids uh
what you think of as ordinary real name identities that you use in the normal traditional world we'll talk a bit about the regulations that defy companies or service providers uh might need to use authoritative identities to comply with and we'll talk about a research project called candid which is a technique based on technology like cryptography and zero knowledge proofs that provides a way to bootstrap an anonymous credential from one of these old legacy systems that provides authoritative identities um finally we'll talk about some alternatives that i think of are important for the future of defy
which are alternative forms of identity that don't rely as much on authorities like centralized insurers or state governments to issue ids but instead provide some alternative ways to carry out some of the desired functionality that id is playing and we'll look at two ideas in particular one is called webs of trust and another is called proofs of personhood we'll talk about those alternatives later on to start with we're going to talk about the problem of linking external accounts into a defy or smart contract application the simplest example that i can think of where this would
occur and i'm sure you've seen examples of this before in the cryptocurrency world is the idea of making an air drop of some newly created tokens and the goal is that anyone with a twitter account is able to go and claim some allocation of this new token that's been created so here we have alice her twitter account is alice2go and what she wants to be able to do is to say to this smart contract or decentralized application i have the twitter account my twitter account's alice to go so go ahead and give me my my
air dropped portion of tokens now the question is how do we go about implementing this and maybe you can think of some ways that you might do it there's a couple of fairly straightforward ones that come to mind i bet that you can guess or come up with what a solution would be i think the simplest one is to have alice generate a secret key an ethereum account in this case if she doesn't already have one and what she would do is log into twitter and change her profile so that her profile says what her
ethereum address is so she's logged into the twitter account she's set her profile to indicate that her address is what she's logged into and set it to she has the private key to that account and then when she asks this service to go and send her um to send her her allocation of the airdrop token well uh the backer the developers of the token if they're going to assign the tokens this way they could be the relying party they would access alice's twitter account see alice's profile see the address that she's indicating there and that
tells them what address they should allocate the portion of the new tokens to you might spot the potential also to use an oracle here instead if we didn't want to have the developers you know a centralized party in the middle go and access alice's twitter account to see which address she's claiming an oracle could be used instead an oracle would sit in between the smart contract that's issuing the token and the oracle would fetch twitter profiles to see which ethereum addresses are in there and if so allocate a portion to that address besides this airdrop
example there's several others um besides airdrop something fairly closely related is the idea of tipping this is where you want to send a cryptocurrency payment to the owner of a twitter account or an instagram account any website and there the challenge is that they have this account that's who you want to send it to but they don't already have a cryptocurrency address linked to their account if you could you would just use that but the idea of tipping is that you should be able to send them and make available this portion of money that as
soon as they can prove that they've created an address and associated with that account they'll be able to claim that money that was set aside to them this requires linking the external account into the smart contract context in some way another fundamental reason why you would want to link an external account is in order to make use of reputation as a source of extra collateral so we have seen so far that um defy derivatives instruments typically require over collateralization and that can be expensive you have to often put in a security deposit that's larger than
whatever token trade you want to deal with if you're able to link in some other account that already has a reputation then maybe you could use that reputation as a kind of collateral the idea is that if you promise to do something and you don't do it then that can follow you back and um your followers on instagram would be angry with you that you didn't do what you promised to do in a smart contract setting so it's using reputation as an extra source of collateral another reason might be to provide a simpler single sign-on
service you could sign on to a system a defy system or a smart contract just using your blockchain address directly but maybe more convenient for users to be able to use their existing accounts and for some features like a dashboard or a read-only service something where you're not supposed to be accessing your hot wallet private keys at the time might be reasonable to log in with an external account instead another reason is if you simply want to avoid farmers or botnets or spammers from signing up with thousands of accounts and basically using up all of
your airdrop by signing up with with so many different accounts lots of social media systems like twitter and instagram already do their best to make sure that spammers can't sign up with an infinite number of accounts and so by using some existing external account you have the potential to make use of whatever anti-spam measures that external account provides in a final rationale for linking external accounts into the smart contract settings to provide some alternate way of recovering lost keys key management is difficult users lose keys all the time most issuers of accounts provide some kind
of backup method whether it is calling you on the phone whether there's an office that you can show up to in person or whether you just have a recovery account and they'll send the recovery account you might have to call up their tech support line and really convince them that that you're the rightful owner of the account but if they provide alternate ways of getting into your account even if you've lost all of your keys lost your devices while having some way that you can access a smart contract resource based on your control of an
external account that could provide some useful alternate way to recover that account the final uh reason why you would want to link in external accounts uh that i'll mention here is the idea of one person one vote as a kind of fairness principle uh in d5 we're often interested in decision making in groups and uh decision making for the to determine what a dow or some uh mechanism is going to do based on collecting votes of the users who are using the system or the stakeholders who have put down deposits into that system the natural
way to do that is to say one dollar one vote the more tokens you've put into the system the more influence you have but it's typically considered more fair to have one person one vote this gives you know equal contribution or equal influence in the decision making even to users who uh haven't put in as many tokens and if you wanted to achieve this then it's not enough just to count the number of ethereum accounts because anyone can create as many ethereum accounts as they want but on the other hand if you can use an
account on some other system that does make an effort to ensure that people can only sign up one account per person then by linking in those accounts that can be a way that you can ensure this one person one vote so we'll go over these uh application ideas in more detail throughout the rest of the lecture so before getting too much further into the interesting technical and security questions here i want to introduce just some common terminology that we'll use throughout this lecture so these are the roles that are involved in an attestation model the
idea of the attestation model is that there's a subject that's typically a user there's an issuer who is the identity provider or the account provider there's some kind of authority for the sake of this use case and by an attestation what it means is they're going to say something about the subject the issuer is going to say something about the subject the relying party is someone who is going to listen to the issue or receive this attestation and learn something about the subject before interacting with them so to go back to the simple example of
an airdrop but just to assign it these terms in this example alice is the subject and the relying party is going to be the new token application the smart contract or the developers behind it depending on how that would work and the issuer in this case is going to be twitter they're the ones who provide the twitter account and the relying party the dap issuer the dap smart contract this new token that's that's conducting the airdrop they're going to rely on the claim of the issuer that says this is the uh account alice to go
this is alice's real name is what's written in this case and this is the ethereum address that's pasted in the profile now the way that this um setting worked i'll draw your attention to one aspect and then ask the question are there any problems that you can think of with this or ways to to do better and what i'll draw your attention to as in hint for answering this question is notice that there are two places of communication with the creators of this token or the smart contract itself they interact with alice alice says please
sign me up this is my twitter account i'm ready to receive my airdrop but they also receive communication directly from the issuer twitter in this case so with that as the preface can you think of any problems with this well the main problem that i can think of is one of privacy putting your ethereum address in your twitter profile to sign up for an airdrop of this kind is great but this would reveal your intent to participate in this airdrop to twitter and it would reveal your ethereum address um associated with your twitter account it
would reveal this publicly because everyone can see your public twitter profile so this would be really bad for privacy so let's look at another example that you're probably familiar with this is using an ordinary state government-issued id card with your age on it as a way of entering a bar so a bar in the u.s anyway is required not to allow anyone to enter who's not of a certain age and the way that this works in practice of course is that you get an identity card that is produced by the issuer some authority in your
area they issue you a document called a credential that has your identifying information on it like your photo your year of birth it has a bunch of tamper-proof features it's supposed to be difficult to make a fake id card that passes inspection and what you can do is show your id card to this bar upon entering it all they do is check that you're of an adequate age and then let you leave now what's nice about this is that unlike in the twitter airdrop scenario there's no communication between the issuer and the bar the issuer
never learns you know the department of motor vehicles never learns which bars you go to because they're not involved in the transaction of you presenting your credential your identity document to the bar similarly they can't even prevent you from going to the bar if they wanted to they can't like shut off their service and prevent you from showing your id to the bar so in some ways this is um a lot better in terms of privacy the act of showing it to the bar reveals your identity to the bar and we'll look at how to
do better than that later on but it doesn't reveal which locations you went to to the issuer so this model is even better for privacy in some regards than the twitter airdrop and we're going to look at a couple of more high-tech alternatives in a moment but first let's recap and just uh discuss some questions that we can ask about any attestation model protocol so first of all we would look at privacy what does the issuer learn about the interactions between the subject and the relying party we also care about availability is the issuer needed
to sign off on this interaction between the subject and the relying party we'll also be interested in looking at issues like revocation does the issue have the ability to cancel the id card does the subject even have the ability to cancel it if they want to um and finally we'll look at the you know meaning of the attestation does it carry more information like the subject's address their real name their prior names their transaction history and principle it could be anything and um is the issuer guaranteeing anything about this like that it's an accurate description
of your address these are all issues by which some of the schemes we'll look at will differ