Download the PHP package flesh404/laravel-kaspa-address without Composer
On this page you can find all versions of the php package flesh404/laravel-kaspa-address. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download flesh404/laravel-kaspa-address
More information about flesh404/laravel-kaspa-address
Files in flesh404/laravel-kaspa-address
Package laravel-kaspa-address
Short Description Laravel package for validating and analyzing Kaspa addresses
License MIT
Informations about the package laravel-kaspa-address
laravel-kaspa-address
Laravel package for validating, analyzing and generating Kaspa addresses.
Disclaimer:
This project is not officially affiliated with, endorsed by, or connected to Kaspa or the Kaspa Foundation.
Features
- Validate Kaspa addresses (mainnet / testnet / devnet / simnet)
- Extract prefix and network information
- Kaspa-specific Bech32 checksum verification
- Generate valid Kaspa addresses (testing & tooling)
- Artisan commands for validation and generation
- Based on the official Kaspa Go / Rust reference implementations
- Zero dependencies
Installation
Laravel will auto-discover the service provider.
Usage
Validate an address
Returns true or false.
Parse and inspect an address
Throws InvalidKaspaAddress if invalid.
Analyzer (recommended for APIs & checker websites)
The KaspaAddressAnalyzer never throws and always returns a structured result.
Result format
For invalid addresses:
Address Generator
The KaspaAddressGenerator provides a convenient way to generate valid random Kaspa addresses for testing and development purposes.
You can also generate addresses for other networks:
Note: The generator is intended for testing, fixtures, and tooling. It does not derive keys or represent real wallet ownership.
Artisan Commands
The package ships with a CLI command for validating & generating Kaspa addresses.
Validate an Address
Example Output:
For invalid addresses:
Exit codes:
- 0 → valid
- 1 → invalid
Generate an address
Generate a random valid Kaspa address for a given network:
Defaults to mainnet (kaspa).
Generate for a specific network:
Output:
Exit codes:
- 0 → valid
- 1 → invalid
Laravel Validation Rule
The package provides a Laravel validation rule for Kaspa addresses.
It validates that a value is:
- a valid Kaspa address
- optionally restricted to specific Kaspa networks
Basic usage (allow all networks):
Restrict to a specific network:
Allow multiple networks:
Validation error messages are currently hardcoded and do not require Laravel translation files.
Supported Networks & Prefixes
| Network | Prefix |
|---|---|
| Mainnet | kaspa |
| Testnet | kaspatest |
| Devnet | kaspadev |
| Simnet | kaspasim |
Testing
Includes:
- Bech32 encoding & decoding tests
- Address parsing tests
- Generator tests
- Analyzer tests
- Artisan command tests
References
- Kaspa Go implementation (kaspad)
https://github.com/kaspanet/kaspad - Rusty-Kaspa (Rust reference implementation)
https://github.com/kaspanet/rusty-kaspa