A blockchain-agnostic ECPair library for Bitcoin-like cryptocurrencies. Provides secure key management and signing capabilities across multiple blockchain networks.
🚀 Key Features:
- Blockchain Agnostic: Works with any Bitcoin-like cryptocurrency
- Network Required: Enforces network specification for enhanced security
- TypeScript Support: Full type definitions included
- Secure Key Management: Industry-standard cryptographic operations
- WIF Support: Import/export keys in Wallet Import Format
npm install dedoopair dedoo-coinjs-libimport { ECPairFactory } from 'dedoopair';
import { networks } from 'dedoo-coinjs-lib';
import * as ecc from 'bells-secp256k1';
// Initialize ECPair factory
const ECPair = ECPairFactory(ecc);
// Register your blockchain network (REQUIRED)
networks.register('mycoin', {
messagePrefix: '\\x19MyCoin Signed Message:\\n',
bech32: 'mc',
bip32: { public: 0x0488b21e, private: 0x0488ade4 },
pubKeyHash: 0,
scriptHash: 5,
wif: 128
});
const network = networks.get('mycoin');
// Generate a new key pair (network is REQUIRED)
const keyPair = ECPair.makeRandom({ network });
// Import from WIF (network is REQUIRED)
const keyPairFromWIF = ECPair.fromWIF('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy', network);
// Sign and verify
const message = Buffer.from('Hello, blockchain!');
const signature = keyPair.sign(message);
const isValid = keyPair.verify(message, signature);dedoopair is part of the Dedoo blockchain-agnostic ecosystem:
- dedoo-coinjs-lib - Core blockchain library
- dedoohdw - HD wallet functionality
- dedoo-inscriber - Inscription support
- dedoo-wallet-sdk - Provider SDK
- dedoo-ordutils - Ordinals utilities
- NPM Package: https://www.npmjs.com/package/dedoopair
- GitHub Repository: https://github.com/dedooxyz/dedoopair
- Website: https://dedoo.xyz
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ by the Dedoo Development Team