@fairdatasociety/fds-id
v0.1.1
Published
FDS Identity - Decentralized identity management for Ethereum
Readme
FDS ID TypeScript
TypeScript implementation of FDS Identity Specification.
Features
- Wallet: secp256k1 key management with EIP-55 checksummed addresses
- Keystore: Web3 Secret Storage v3 format (MetaMask compatible)
- HD Wallet: BIP-39/32/44 hierarchical deterministic wallets
- Signing: EIP-191 personal_sign and EIP-712 typed data
- SIWE: Sign-In with Ethereum (EIP-4361)
- BYOENS: Bring Your Own ENS support
- Swarm Backup: Encrypted backup storage on Swarm
Installation
npm install @fairdatasociety/fds-idQuick Start
import { Wallet, HDWallet, Keystore, createSIWEMessage, verifySIWE } from '@fairdatasociety/fds-id'
// Create a new wallet
const wallet = Wallet.create()
console.log(wallet.address) // 0x...
// Create HD wallet from mnemonic
const hdWallet = HDWallet.create({ wordCount: 24 })
console.log(hdWallet.mnemonic) // 24 words
// Derive accounts
const account0 = hdWallet.deriveAccount(0)
const account1 = hdWallet.deriveAccount(1)
// Encrypt to keystore
const keystore = await Keystore.encrypt(wallet, 'password')
// Decrypt from keystore
const decryptedWallet = await Keystore.decrypt(keystore, 'password')
// Sign a message
const signature = wallet.signMessage('Hello, Ethereum!')
// SIWE authentication
const siweMessage = createSIWEMessage(
{ domain: 'example.com', uri: 'https://example.com' },
wallet.address
)
const siweSignature = wallet.signMessage(formatSIWEMessage(siweMessage))
const result = verifySIWE(formatSIWEMessage(siweMessage), siweSignature)Supported Standards
| Standard | Description | Status | |----------|-------------|--------| | EIP-55 | Mixed-case checksum addresses | ✅ | | EIP-191 | Personal message signing | ✅ | | EIP-712 | Typed structured data signing | ✅ | | EIP-1193 | Ethereum Provider API | ✅ Types | | EIP-1271 | Contract signature validation | 🔄 Planned | | EIP-4361 | Sign-In with Ethereum (SIWE) | ✅ | | EIP-6963 | Multi Injected Provider Discovery | ✅ Types | | BIP-39 | Mnemonic code | ✅ | | BIP-32 | HD Wallets | ✅ | | BIP-44 | Multi-Account Hierarchy | ✅ | | Web3 v3 | Secret Storage Definition | ✅ |
Security
- Uses audited cryptographic libraries (@noble/, @scure/)
- Constant-time MAC comparison
- scrypt with N=131072 (Ethereum standard)
- AES-256-GCM for Swarm backups
Related Projects
- fds-id-spec - Specification
- fds-id-go - Go implementation
License
Apache-2.0
