CryptoWalletValidator 1.0.0
dotnet add package CryptoWalletValidator --version 1.0.0
NuGet\Install-Package CryptoWalletValidator -Version 1.0.0
<PackageReference Include="CryptoWalletValidator" Version="1.0.0" />
<PackageVersion Include="CryptoWalletValidator" Version="1.0.0" />
<PackageReference Include="CryptoWalletValidator" />
paket add CryptoWalletValidator --version 1.0.0
#r "nuget: CryptoWalletValidator, 1.0.0"
#:package CryptoWalletValidator@1.0.0
#addin nuget:?package=CryptoWalletValidator&version=1.0.0
#tool nuget:?package=CryptoWalletValidator&version=1.0.0
Crypto Wallet Validator Library
CryptoWalletValidator is a lightweight C# library designed to validate and identify the type of cryptocurrency wallet address based on a given string. It currently supports popular cryptocurrencies like Bitcoin, Ethereum, Ripple, Monero, Dash, and ZCash.
Features
- Identify wallet address types (e.g., Bitcoin, Ethereum, etc.).
- Validate wallet address format and checksum.
- Extensible to support additional cryptocurrencies.
Getting Started
Prerequisites
- .NET Framework or .NET Core SDK
Org.BouncyCastleNuGet package (for Ethereum and Monero checksum calculations)
Installation
- Create a new project or open your existing one.
- Add the library (
CryptoWalletValidator.dll) as a reference to your project. - Install the required dependency using NuGet:
dotnet add package BouncyCastle
Usage
To use the CryptoWalletValidator, import the namespace and call the GuessAndValidateWalletType method with a wallet address string.
using CryptoWalletValidator;
class Program
{
static void Main(string[] args)
{
string walletAddress = "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"; // Example Bitcoin address
string walletType = Validator.GuessAndValidateWalletType(walletAddress);
Console.WriteLine($"Wallet Type: {walletType}");
}
}
Example Output
For the input wallet address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa:
Wallet Type: Bitcoin
Supported Cryptocurrencies
- Bitcoin (BTC)
- Validates Base58 format and checksum.
- Ethereum (ETH)
- Validates hexadecimal format and EIP-55 checksum.
- Ripple (XRP)
- Validates Base58 format and checksum.
- Monero (XMR)
- Validates Base58 format and checksum using Keccak.
- Dash (DASH)
- Validates Base58 format and checksum.
- ZCash (ZEC)
- Validates Base58 format and checksum.
Function Overview
GuessAndValidateWalletType(string address)
Identifies and validates the type of wallet address.
- Input: A string representing the wallet address.
- Output: A string representing the type of wallet (e.g., "Bitcoin", "Ethereum") or "Unknown or Invalid Address".
Internal Utility Functions
IsValidAddress: Checks if the address matches a specific regex pattern.VerifyChecksum: Decodes the address and validates its checksum.Base58Decode: Decodes Base58-encoded strings.CalculateDoubleSHA256Checksum: Computes a double SHA-256 checksum.CalculateKeccakChecksum: Computes a Keccak-256 checksum (used by Monero).VerifyEthereumChecksum: Validates Ethereum EIP-55 checksum.
Building the Library
- Open the project in Visual Studio or another IDE.
- Build the project as a Class Library.
- The output
.dllfile will be located in thebindirectory of your project.
Contributing
Feel free to fork the repository and add support for additional cryptocurrencies or improve existing functionality. Submit a pull request with your changes.
License
This library is released under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- BouncyCastle.Cryptography (>= 2.5.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 179 | 1/23/2025 |