From 8a9f9d11496e20c47a564b4b66d11ae70869ac25 Mon Sep 17 00:00:00 2001 From: Peter Ferguson Date: Sun, 17 Mar 2024 06:00:06 +0000 Subject: [PATCH 1/5] wip spc lib readme --- packages/spc-lib/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 packages/spc-lib/README.md diff --git a/packages/spc-lib/README.md b/packages/spc-lib/README.md new file mode 100644 index 0000000..2097527 --- /dev/null +++ b/packages/spc-lib/README.md @@ -0,0 +1,15 @@ +# Secure Confirmation Payment Library + +This library lets dapps create & operate a passkey wallet from any provider. +What is even better is the user never has to leave the dapps site! + +All transactions are confirmed on the dapps webpage using the wallets passkey credentials. + +The wallet will need to support Secure Payment Confirmation (SPC) & some conventions defined in this repo. + +## Getting started (For dApps) + +The first step is to embed + +## Getting started (For Wallet Providers) + From b57e70e43c95d7888c2e6c46131c57844affe524 Mon Sep 17 00:00:00 2001 From: Peter Ferguson Date: Sun, 17 Mar 2024 06:01:14 +0000 Subject: [PATCH 2/5] add readme for helpers --- packages/helpers/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 packages/helpers/README.md diff --git a/packages/helpers/README.md b/packages/helpers/README.md new file mode 100644 index 0000000..ec0642b --- /dev/null +++ b/packages/helpers/README.md @@ -0,0 +1,3 @@ +# Helpers Packages + +A set of utilities that are shared across the monorepo From 7a2ab6ba8a7e842a3db11edc9bdb5b1dd534aacb Mon Sep 17 00:00:00 2001 From: Peter Ferguson Date: Sun, 17 Mar 2024 06:09:48 +0000 Subject: [PATCH 3/5] Update spc-lib README.md --- packages/spc-lib/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/spc-lib/README.md b/packages/spc-lib/README.md index 2097527..f735f69 100644 --- a/packages/spc-lib/README.md +++ b/packages/spc-lib/README.md @@ -5,6 +5,8 @@ What is even better is the user never has to leave the dapps site! All transactions are confirmed on the dapps webpage using the wallets passkey credentials. +image + The wallet will need to support Secure Payment Confirmation (SPC) & some conventions defined in this repo. ## Getting started (For dApps) From f32b05c5e9a41b7b2a38782fe793a88523de7a1b Mon Sep 17 00:00:00 2001 From: Peter Ferguson Date: Sun, 17 Mar 2024 07:04:06 +0000 Subject: [PATCH 4/5] Create README.md --- README.md | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..3e7ee76 --- /dev/null +++ b/README.md @@ -0,0 +1,62 @@ +# Secure Payment Confirmation (SPC) Wallets As A Service πŸ‘› + +What if you could create a wallet instantly on any dapp, fund it & re-use it anywhere. πŸ‘€ + +SPC wallets are built ontop of [Secure Payment Confirmation](https://w3c.github.io/secure-payment-confirmation/) a web api designed to streamline +web2 payments that leverages passkeys to authenticate the user. + +We leverage the webauthn-side of the SPC protocol to create passkey wallets that are capable of securely signing transactions on any dapp. + +## What is this repo? + +This repo is a simple end-to-end implementation of SPC wallets, complete with [passkey wallet contracts](https://github.com/peterferguson/spc-hack/tree/main/packages/contracts), [a simple dapp frontend](https://github.com/peterferguson/spc-hack/tree/main/apps/dapp), [wallet application](https://github.com/peterferguson/spc-hack/tree/main/apps/wallet) +& [a library](https://github.com/peterferguson/spc-hack/tree/main/packages/spc-lib) that lets you embed these wallets in your dapp. + + +## πŸ–ΌοΈ Demo + +Below is a demo journey of a user that has never used the [wallet provider](https://spc-wallet.vercel.app) or the [dapp frontend](https://spc-dapp.web.app) before. + +![CleanShot 2024-03-17 at 06 08 07](https://github.com/peterferguson/spc-hack/assets/7002211/8c1084b7-94a1-486d-a014-5c3ba9390fbd) + +### User Steps + +1. User clicks to claim but has no account -> dapp shows wallet creation popup +2. User inputs a (globally unique to the wallet provider) username +3. Counterfactual account is created linked to the public key of the passkey +4. User again clicks to claim & is presented with an SPC confirmation modal +5. User signs passkey, confirming that they have agreed to the transaction + +### Corresponding Technical Steps + +1. dapp check for stored credentials, fails to find any & falls back to showing wallet creation popup +2. dapp & wallet provider communicate to ensure the username is available & create a passkey if so +3. wallet provider stores the users credentials so they can be relayed to other dapps upon request +4. dapp has prepared a `UserOp` representing the `Claim Coupon` NFT, creates a [`Payment Request`](https://w3c.github.io/payment-request/#paymentrequest-interface) to be signed by the passkey on confirmation of the SPC modal +5. dapp (or wallet) send the signed `UserOp` to a bundler for inclusion. + +## Project Structure πŸ“‚ + + . + | + β”œβ”€β”€ apps # Examples of implementations for wallets & dapps + β”‚ β”œβ”€β”€ ... + β”‚ β”œβ”€β”€ dapp # The dapp frontend responsible for creation & operation of the passkey operations + β”‚ β”œβ”€β”€ wallet # The wallet provider responsible for registration of passkey credentials + β”‚ └── ... + β”œβ”€β”€ packages + β”‚ β”œβ”€β”€ ... + β”‚ β”œβ”€β”€ contracts # Contracts for the Safe 4337-module (V07 bundler) with passkey signers + β”‚ β”œβ”€β”€ spc-lib # A utility library with functions for communication between the wallet provider and dapp + β”‚ └── ... + └── ... + +--- + +##Β Deployments + +- Dapp Frontend -> deployed at [https://spc-dapp.web.app](https://spc-dapp.web.app) + +- Wallet Frontend -> deployed at [https://spc-wallet.vercel.app](https://spc-wallet.vercel.app) + +- Contracts -> deployed at [contracts#deployments](https://github.com/peterferguson/spc-hack/tree/main/packages/contracts#deployments) From 53e2b049f06636cb11733bbaba3861ee09485172 Mon Sep 17 00:00:00 2001 From: Peter Ferguson Date: Sun, 17 Mar 2024 07:04:47 +0000 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e7ee76..d04cfff 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Below is a demo journey of a user that has never used the [wallet provider](http --- -##Β Deployments +## Deployments - Dapp Frontend -> deployed at [https://spc-dapp.web.app](https://spc-dapp.web.app)