Skip to content

dedooxyz/dedoopair

Repository files navigation

Dedoo Pair (dedoopair)

NPM GitHub TypeScript

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

📦 Installation

npm install dedoopair dedoo-coinjs-lib

🔧 Quick Start

import { 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);

🔗 Ecosystem

dedoopair is part of the Dedoo blockchain-agnostic ecosystem:

🔗 Links

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Built with ❤️ by the Dedoo Development Team

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors