Aptos Keyless accounts
Your blockchain account = your Google account
Sign in with Google
zkSummit’11 talk 📹 here
Sign in TXNs with Google
Aptos Keyless accounts
Your blockchain account = your Google account
talk 📹 here
Collaborators & acknowledgements
The core Aptos Keyless team:
At the same time, this is a broader effort among many Aptos Labs employees.
Without their help this work would not be possible! 🙏
3
tl;dr: Your blockchain account = Your Google account
4
Pros and cons of OIDC-based blockchain accounts
5
Advantages
Disadvantages
Outline
6
Overview of OpenID Connect (OIDC)
7
OIDC provider
(e.g., Google)
User
(e.g., you!)
Application
(e.g., Notion.so)
Wants to sign in to application using their existing account with OIDC provider
Checks signatures from OIDC provider to authenticate user. No leaky password databases!
Signs messages for application to prove user authenticated successfully.
Prerequisite: OIDC application ("client") registration
8
OIDC provider
User
client_id
Application
Step 1: Application redirects user to sign in via OIDC provider
9
OIDC provider
Application
(client_id)
User
&client_id=client_id
&nonce=any_data
May I sign in?
Step 2: Application receives OIDC signature
10
OIDC provider
SK, PK
Application
(client_id)
User
Step 3: Any 3rd party can verify this OIDC signature
11
OIDC provider
SK, PK
Application
(client_id)
User
3rd party
PK
Outline
12
Web 2: Application receives OIDC signature
13
OIDC provider
SK, PK
Application
(client_id)
User
3rd party
PK
Web 3: Wallet receives OIDC signature
14
OIDC provider
SK, PK
Petra wallet
(client_id)
Aptos user
Aptos blockchain
PK
Web 3: Blockchain verifies OIDC signature
15
OIDC provider
SK, PK
Petra wallet
(client_id)
Aptos user
Aptos blockchain
PK
Problem 1: For each TXN she wants signed, Alice must "Sign in with Google."
Solution: Layer of indirection via ephemeral pubkeys. [HMF+23]
Fix 1: Google signs ephemeral pubkeys (EPKs), not TXNs
16
OIDC provider
&client_id=client_id
&nonce=epk
Petra wallet
(client_id)
Aptos user
esk, epk
Fix 1: Google signs ephemeral pubkeys (EPKs), not TXNs
17
OIDC provider
Petra wallet
(client_id)
Aptos user
esk, epk
Ensures the OIDC signature "expires" after exp_date
, r
&client_id=client_id
&nonce=epk|exp_date
Fix 1: Google signs ephemeral pubkeys (EPKs), not TXNs
18
OIDC provider
Petra wallet
(client_id)
Aptos user
esk, epk
Fix 1: Google signs ephemeral pubkeys (EPKs), not TXNs
19
esk, epk
OIDC provider
SK, PK
Petra wallet
(client_id)
Aptos user
Aptos blockchain
PK
Verifyepk(σeph, txn_hash)
σeph = Signesk(
txn_hash
)
epk
Problem 2: addr, TXN and σOIDC each leak alice@gmail.com and client_id.
Problem 2': Google sees epk.
Solution: Zero-knowledge proofs!
Problem 2: Blockchain & Google get sensitive info
20
Step 1
Step 2
such that:
Petra gives blockchain sensitive
(σOIDC, email, client_id, addr)
Petra gives Google epk.
Petra gives blockchain non-sensitive (epk)
Problem 2: Blockchain & Google get sensitive info
21
Petra gives Google epk.
Petra gives blockchain non-sensitive (epk, addr)
such that:
Petra gives blockchain sensitive
(σOIDC, email, client_id)
Step 0: Make the address non-sensitive
Step 1
Step 2
Problem 2: Blockchain & Google get sensitive info
22
Petra gives Google epk.
Petra gives blockchain non-sensitive (epk, addr)
such that:
Petra gives blockchain sensitive
(σOIDC, email, client_id, pepper)
Step 0: Make the address non-sensitive
Step 1
Step 2
Problem 2: Blockchain & Google get sensitive info
23
Petra gives Google epk.
Petra gives blockchain non-sensitive (epk, addr)
such that:
Petra gives blockchain sensitive
(σOIDC, email, client_id, pepper)
User will rely on a 🌶️ ZK pepper service to recover their pepper.
Step 1
Step 2
Problem 2: Blockchain & Google get sensitive info
24
Petra gives Google H(epk, r).
Petra gives blockchain non-sensitive (epk, addr)
Petra gives blockchain sensitive
(σOIDC, email, client_id, pepper)
such that:
Step 1: Give Google an epk commitment
Step 1
Step 2
Problem 2: Blockchain & Google get sensitive info
25
Petra gives Google H(epk, r).
Petra gives blockchain non-sensitive (epk, addr)
Petra gives blockchain sensitive
(σOIDC, email, client_id, pepper, r)
such that:
Step 1: Give Google an epk commitment
Petra stores randomness r in ephemeral storage.
Step 1
Step 2
Problem 2: Blockchain & Google get sensitive info
26
Petra gives Google H(epk, r).
Step 1
Step 2
Petra gives blockchain non-sensitive (epk, addr)
Petra gives blockchain a ZKPoK of sensitive
(σOIDC, email, client_id, pepper, r)
such that:
i.e., ∃priv s.t. Rkeyless( pub = [PK, epk, addr], priv = [σOIDC, email, client_id, pepper, r] ) = 1
Step 3: Use a ZKP to hide sensitive fields
Problem 2’: OpenID signatures need to “expire” after a while
27
Petra gives Google
H(epk, exp, r).
Step 1
Step 2
Petra gives blockchain non-sen. (epk, exp, addr)
Petra gives blockchain a ZKPoK of sensitive
(σOIDC, email, client_id, pepper, r)
such that:
i.e., ∃priv s.t. Rkeyless( pub = [PK, epk, exp, addr], priv = [σOIDC, email, client_id, pepper, r] ) = 1
Fix 2: ZKPs for Rkeyless and epk commitment
28
OIDC provider
&client_id=client_id
&nonce=H(epk; r)
Petra wallet
(client_id)
Aptos user
esk, epk
, r
Fix 2: ZKPs for Rkeyless and epk commitment
29
OIDC provider
Petra wallet
(client_id)
Aptos user
esk, epk
, r
Compute ZKP π for ∃priv s.t.
Rkeyless(
pub = [PK, epk, addr],
priv = [σOIDC, email, client_id, pepper, r]
) = 1
Fix 2: ZKPs for Rkeyless and epk commitment
30
, r
esk, epk
OIDC provider
SK, PK
Petra wallet
(client_id)
Aptos user
Aptos blockchain
Verifyepk(σeph,
txn_hash
)
π, epk, σeph = Signesk(txn_hash)
Verify ZKP π for Rkeyless(
pub = [PK, epk, addr]
)
σOIDC
Problem 3: Computing ZKPs is slow.
Solution: Outsource to a ZK proving service.
Outline
31
🪄 ZK proving service
32
ZKP π for Rkeyless
Petra wallet
(client_id)
🪄ZK proving service
Advantages
Disadvantages
🌶️ ZK pepper service
33
Petra wallet
(client_id)
🌶️ ZK pepper service
PSK, PPK
Advantages
Disadvantages
Dealing with banned, gone or incompetent wallet or dapp
Problem: e.g., incompetent dapp deletes their client_id registration ⇒ users are locked out.
Solution: Deploy an untrusted recovery service that authenticates users via OIDC. A [ZKPoK of an] OIDC signature from the recovery service can be used to rotate the key of an account associated with a missing application.
34
Rkeyless-specific trusted setup
35
Makes upgrades to Rkeyless operationally- difficult.
Future: Consider switching to universal SNARKs.
Necessity of consensus on OIDC providers' PKs
Problem:
Solution:
36
Other OIDC-related assumptions
37
Challenges around application-specific accounts
38
Training wheels via 🪄 ZK proving service signatures
39
Other ZKP-related challenges
40
Did not get to discuss yet
41
Useful references
[Groth16] On the Size of Pairing-based Non-interactive Arguments; by Jens Groth; 2016; https://eprint.iacr.org/2016/260
[HMF+23] OpenPubkey: Augmenting OpenID Connect with User held Signing Keys; by Ethan Heilman and Lucie Mugnier and Athanasios Filippidis and Sharon Goldberg and Sebastien Lipman and Yuval Marcus and Mike Milano and Sidhartha Premkumar and Chad Unrein; 2023; https://eprint.iacr.org/2023/296
[QQQ+90] How to Explain Zero-Knowledge Protocols to Your Children; by Quisquater, Jean-Jacques and Quisquater, Myriam and Quisquater, Muriel and Quisquater, Michaël and Guillou, Louis and Guillou, Marie Annick and Guillou, Gaïd and Guillou, Anna and Guillou, Gwenolé and Guillou, Soazig; in CRYPTO' 89
[Tome23] What is a zero-knowledge proof system; by Alin Tomescu; 2023; slides
42
Appendix
43
Problem: The bulk of the Keyless relation
44
assert VerifyPK(σOIDC, h) = 1
Step 2
Step 3
Step 1
Alternative recovery paths
For email-based OIDC providers, leverage DKIM email signatures:
For non-email-based OIDC providers, it depends:
Alternatively, all keyless accounts must be 1-out-of-2 with a recovery passkey sub-account
45
Zero-knowledge proofs
∃w, s.t. R(x, w) = 1
46
Public statement:
Both prover and verifier have this.
Private witness:
Only prover has it.
Must remain hidden from verifier.
Polynomial-time computable relation R(⋅,⋅) Known to prover & verifier
A ZKP convinces the verifier that the prover knows a (secret) witness w such that R(x, w) = 1
Example: A ZKP for the Sudoku relation
Sudoku(puzzle, sol) = 1
47
A ZKP convinces the verifier that the prover knows a (secret) sol such that Sudoku(puzzle, sol) = 1
The solution to the puzzle
The Sudoku puzzle
Normal keyless validation path
48
app gives Google H(epk, r).
Step 1
Step 2
app gives blockchain non-sensitive (epk, addr)
app gives blockchain a ZKPoK of sensitive
(σOIDC, email, client_id, pepper, r)
such that:
i.e., ∃priv s.t. Rkeyless( pub = [PK, epk, addr], priv = [σOIDC, email, client_id, pepper, r] ) = 1
Step 3: Use a ZKP to hide sensitive fields
Supporting audless mode
49
such that:
Step 1
Step 2
app gives Google H(epk, r).
app gives blockchain non-sensitive (epk, addr)
app gives blockchain a ZKPoK of sensitive
(σOIDC, email, client_id, pepper, r)
Step 3: Use a ZKP to hide sensitive fields
i.e., ∃priv s.t. Rkeyless( pub = [PK, epk, addr],
priv = [σOIDC, email, client_id, pepper, r, skip_aud_check] ) = 1
Supporting audless mode
50
app gives Google H(epk, r)
Verify signature
Then
app gives blockchain non-sen. (epk, addr)
app gives blockchain a ZKPoK of sensitive
(σOIDC, email, client_id, pepper, r)
such that:
i.e., ∃priv s.t. Rkeyless( pub = [PK, epk, addr],
priv = [σOIDC, email, client_id, pepper, r, skip_aud_check] ) = 1
If skip_aud_check = true:
Else