From: Ardis Lu Date: Thu, 11 Jan 2024 03:03:48 +0000 (-0800) Subject: Update copy for accuracy X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=c660c618fa2df6888e5c0a5abc9d6856c8a746f3;p=alu.bz Update copy for accuracy --- diff --git a/index.html b/index.html index 49ab72a..6d9a9b4 100644 --- a/index.html +++ b/index.html @@ -81,9 +81,11 @@

Using Ethereum for authorization strikes a good balance between minimizing complexity and maintaining security.

This website is an example minimum viable product that uses Ethereum for access control.

How does it work?

-

Many web3 projects use a frontend framework like ethers.js or web3.js to integrate with Ethereum.

-

To demonstrate the minimum required code, this project's frontend is implemented entirely in vanilla HTML, CSS, and JavaScript with no framework. The only integration is with MetaMask to get user signatures for authorization.

-

The backend is a serverless Cloudflare Worker, also written in vanilla JavaScript. The code to verify signatures on the backend was extracted from ethers.js.

+

Many web3 projects use a frontend framework like ethers.js or web3.js to integrate with Ethereum.

+

To demonstrate the minimum required code, this project's frontend is implemented entirely in vanilla HTML, CSS, and JavaScript with no framework. + The only integration is with the standard Ethereum Provider JavaScript API (EIP-1193) used by all common wallets + (e.g., MetaMask and Coinbase Wallet) to get user signatures for authorization.

+

The backend is a serverless Cloudflare Worker, also written in vanilla JavaScript. The code to verify signatures on the backend uses Paul Miller's noble-crypto project.

Source code

Click here to view this project's source code on GitHub.

The code for both the frontend and the backend is available in the GitHub repository.

@@ -94,7 +96,7 @@
-

MetaMask must be installed to Connect Wallet.

+

No wallet detected. Install a wallet to connect.

diff --git a/script.js b/script.js index a307d23..a1d9a79 100644 --- a/script.js +++ b/script.js @@ -112,7 +112,7 @@ async function handleSubmit(event) { } if (window.ethereum !== undefined) { - // User switches account manually in MetaMask + // User switches account manually in wallet ethereum.addListener('accountsChanged', setAccount); }