Extension which lets you add your Web3 address to your profile.
Web3 is the ecosystem moniker we use for everything under the umbrella of Web3 Foundation's tech stack. It's the foundation for a decentralized Amazon/Google/Facebook resistant internet in which users own their data, their accounts, and their actions, and keep their anonymity as intact as they want to. For more info on Web3, this 15 minute FOSDEM talk might shed some light.
This extension adds a new field to Users, web3address
and if you have the PolkadotJS Extension installed you can cryptographically prove you own the address and add it to your profile.
This extension is a precursor to:
- Log in with Web3
- Send cryptocurrency inside Flarum
- Participate in on-chain governance directly through Flarum
The extension's creation has been documented in a detailed guide (to be published soon) that first covers creating new extensions for Flarum (non-blockchain related), while part two covers the Web3 aspect.
composer require swader/web3address
⚠ Note: due to the unavailability of cryptographic functions in PHP, a JS script is used to do server-side verification. This means the production server installing this extension must have node
globally available if server-side validation of Web3 addresses is going to work.
Prerequisites
- have Polkadot JS extension installed and at least one account created. Note that admins can freely change people's web3 addresses. This is useful when a user doesn't have the extension installed, or is using a hardware wallet, but they still want to attach their address to their profile.
node
globally available on the server
Usage
- Click on
Set Web3 Account
- Approve Flarum's access to your browser extension:
- Select account
- Sign by providing your Web3 password. This unlocks the private key in the browser extension, using it to sign a message. A signed message is then authenticated server-side cryptographically.
- If you want to change your account, repeat the process (you will have to re-allow access to the extension after every browser restart / cache clearing).
Links