Study notesWeek 6: Identity And Keys
Week 6

Identity And Keys

Outcomes

What You Can Do By The End

The problem

Accounts Today

Core idea

Key Pairs

Core idea

Digital Signatures

018365472323264Private keyPublic keySignature
message  --sign(private key)-->  signature
message + signature + public key  -->  valid or invalid
Code

Sign And Verify In Python

from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
from cryptography.exceptions import InvalidSignature

key = Ed25519PrivateKey.generate()
pub = key.public_key()
msg = b'I agree to the proposal'
sig = key.sign(msg)
try:
    pub.verify(sig, msg)
    print(True)
except InvalidSignature:
    print(False)
Identity

A Public Key As A Name

Proving control

Challenge And Response

site   -> user: nonce 8c1f...
user   -> site: sign(nonce + 'example.org')
site checks signature with stored public key
Limits

Why A Bare Key Is Not Enough

W3C standard

Decentralized Identifiers

{
  "id": "did:example:123abc",
  "authentication": [{
    "id": "did:example:123abc#key-1",
    "type": "Ed25519VerificationKey2020",
    "controller": "did:example:123abc"
  }]
}
Verifiable credentials

Issuer, Holder, Verifier

Issuer --credential--> Holder --presentation--> Verifier
                                   Verifier checks Issuer's key
Selective disclosure

Showing Less

Keys for everyone

Passkeys

MethodSecret on server?Phishable?
PasswordHashYes
Key pairNoHarder
PasskeyNoBound to site
Trade-offs

The Hard Parts Of Self-Sovereign Identity

Open problem

Sybils And Proof Of Personhood

Summary

Recap

Week 7

Next Week

Your turn

Questions And Exercise