Giter Site home page Giter Site logo

mrtnetwork / blockchain_utils Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 5.0 4.03 MB

Comprehensive Crypto & Blockchain Toolkit: Pure Dart, Cross-Platform, Encoding, Cryptography, Addresses, Mnemonics, & More

License: BSD 3-Clause "New" or "Revised" License

Dart 99.57% Kotlin 0.01% Swift 0.02% Objective-C 0.01% CMake 0.17% C++ 0.21% C 0.01% HTML 0.02%
addresses bip32 bip39 bip49 bip84 bip86 blockchain cardano cbor cryptocurrency

blockchain_utils's Introduction

blockchain_utils

Discover a versatile and powerful cryptographic toolkit, carefully crafted in pure Dart to serve developers, businesses, and blockchain enthusiasts across multiple platforms. This package offers a wide array of essential features, including encoding/decoding for various data formats, support for numerous blockchain addresses, robust cryptographic algorithms, mnemonic management, and more โ€“ all without relying on external dependencies. Whether you're securing private keys, interacting with blockchain networks, or ensuring data integrity, this cross-platform solution simplifies your crypto journey. Experience a comprehensive set of tools designed to meet your diverse encoding, cryptography, and blockchain needs on iOS, Android, the web, Linux, and beyond.

This comprehensive package has been shaped by the influence of several key sources, culminating in its development for Dart.

Features

Encoding and Decoding:

  1. Base32 Encoding/Decoding: Represent binary data with custom character sets for various encoding needs.

  2. SS58 Encoding/Decoding: Encode Substrate-based blockchain addresses and public keys in a compact and human-readable format.

  3. Base58 and Base58 XMR Encoding/Decoding: Efficiently encode binary data, with Base58 XMR tailored for Monero addresses.

  4. Base58Check Encoding/Decoding: Supports checksum creation and verification in blockchain-related data.

  5. Bech32 Encoding/Decoding: Including Bech32 for Bitcoin Cash (BCH) and Bech32 SegWit addresses, offering improved error detection and readability for blockchain addresses.

  6. Hex Encoding/Decoding: Encode binary data as hexadecimal and decode it back.

  7. Web3 Secret Storage Definition: Securely store and manage private keys using the Web3 Secret Storage format.

  8. UUIDv4 Generation: Generate random UUIDs (Universally Unique Identifiers) following the UUIDv4 standard.

Blockchain Address Encoding/Decoding:

  • Zilliqa (ZIL)
  • Tezos (XTZ)
  • Ripple (XRP)
  • Monero (XMR)
  • Substrate address
  • Solana (SOL)
  • P2WPKH
  • P2TR
  • P2SH
  • Bitcoin Cash P2PKH
  • Harmony (ONE)
  • OKEx
  • Neo
  • NEAR
  • Nano
  • Injective
  • ICON
  • Filecoin
  • Ethereum
  • Ergo
  • EOS
  • Elrond
  • AVAX
  • Atom
  • Aptos
  • Algorand
  • Ada Shelley
  • Ada Byron
  • Ton

Binary Data:

  1. CBOR Encoding/Decoding: Compact representation of structured data with cross-language compatibility.

Cryptographic Algorithms:

  1. Cryptographic Algorithms and Operations:
    • AES (Advanced Encryption Standard)
    • ChaCha
    • ChaCha20Poly1305
    • CRC32 (Cyclic Redundancy Check)
    • CTR mode (Counter mode)
    • ECB mode (Electronic Codebook mode)
    • GCM (Galois/Counter Mode)
    • HMAC (Hash-based Message Authentication Code)
    • PBKDF2 (Password-Based Key Derivation Function 2)
    • Poly1305
    • scrypt (Password-based Key Derivation Function)
    • XModem CRC
    • Blake2b
    • Keccak
    • MD4 (Message Digest 4)
    • MD5 (Message Digest 5)
    • Rijndael (AES)
    • SHA (Secure Hash Algorithm)
    • SHA224
    • SHA256
    • SHA384
    • SHA512
    • XXhash

These algorithms provide a wide range of cryptographic functions, including encryption, decryption, message authentication, hashing, and more, to enhance security and data integrity in applications.

Protocols:

  1. Strobe Protocol: A framework for cryptographic protocols, providing simplicity and compatibility for a variety of devices.

Zero-Knowledge Proofs:

  1. Merlin Transcript: A STROBE-based transcript construction for zero-knowledge proofs.

Schnorrkel-based Cryptography:

  1. Schnorrkel-based Cryptographic Operations: Includes Schnorrkel for signing, verification, key management, and more.

Blockchain Support:

  1. BIP39 Mnemonic Generation and Management: Generate BIP39-compliant mnemonic phrases and manage cryptographic keys derived from them.

  2. Substrate Key, Address, and Coin Management: Efficiently manage keys and addresses in Substrate-based blockchains.

  3. Monero Key, Address, and Coin Management: Handle Monero cryptocurrency with support for key management, address derivation, and Monero mnemonics.

  4. BIP32 Multi-Curve Key Derivation and Address Management: Derive keys across multiple cryptographic curves with BIP32 compliance.

  5. SLIP10 Key Derivation and Management: Advanced key derivation capabilities.

  6. BIP38 Secure Paper Wallets: Encrypt private keys to safeguard cryptocurrency assets.

  7. BIP44 Key, Address, and Coin Management: Manage keys, derive addresses, and handle various coins in compliance with the BIP44 standard.

  8. BIP49 Key, Address, and Coin Management: Similar to BIP44, with compliance to the BIP49 standard.

  9. BIP84 Key, Address, and Coin Management: Manage keys, derive addresses, and handle various coins, complying with the BIP84 standard.

  10. BIP86 Key, Address, and Coin Management: Manage keys, derive addresses, and handle various coins, complying with the BIP84 standard.

  11. Electrum Mnemonic V1 and V2 with Key and Address Management: Support for both Electrum Mnemonic V1 and V2, including SegWit and Standard transactions.

  12. TonMnemonic: Support for Ton mnemonics has been added, enabling creation, validation, and seed generation.

These features make your package a comprehensive solution for encoding, cryptography, blockchain management, BIP39 mnemonic support, and diverse blockchain address encoding and decoding needs.

  1. Sign and Verification: Implements classes for signing and verifying transaction digests.
  • Bitcoin (ECDSA, Schnorr)
  • BitcoinCash (EDDSA)
  • Dogecoin (EDDSA)
  • Litecoin (EDDSA)
  • Dash (EDDSA)
  • BSV (EDDSA)
  • Ethereum (EDDSA)
  • Tron (EDDSA)
  • Solana (EDDSA)
  • XRP (EDDSA, ECDSA)
  • Solana (EDDSA, EDDSA Khalow)

Example: Explore Our Toolkit

Discover the capabilities of our comprehensive crypto and blockchain toolkit through interactive tests. Visit our test page to access thousands of examples, showcasing pure Dart's cross-platform functionality. Learn encoding, cryptography, address management, mnemonics, and more.

Contributing

Contributions are welcome! Please follow these guidelines:

  • Fork the repository and create a new branch.
  • Make your changes and ensure tests pass.
  • Submit a pull request with a detailed description of your changes.

Feature requests and bugs

Please file feature requests and bugs in the issue tracker.

blockchain_utils's People

Contributors

mrtnetwork avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

blockchain_utils's Issues

Lower SDK bound

Thanks for the great library!

I was wondering whether we could have a lower SDK bound here. Maybe 2.x?

Credits Issue

It's awesome to see all important blockchain related functionalities at one place.

But it would also be awesome, if you could just give credits to the main repo's where you have copied/pulled the codes from.
They do the hard work to code, migrate, test and port from different languages and make it available in dart.

It's just about showing appreciation in open source community.
I hope you take it as a friendly advice.

Thanks.

How to generate Solana Public and Private Keys from 12 words Mnemonic

  1. Generated mnemonic using Bip39MnemonicGenerator().fromWordsNumber(Bip39WordsNum.wordsNum12);
  2. Generated seed using final seed = Bip39SeedGenerator(mnemonic).generate();

Solana Address generated correctly using solana package
Ed25519HDKeyPair.fromSeedWithHdPath(seed: seed, hdPath: "m/44'/501'/0'/0'").then((value) { print(' correct address: ${value.address}'); });

How can we get public and private key using this package?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.