https://github.com/matronator/c32check
PHP library for encoding and decoding C32 addresses which are used on the Stacks blockchain.
https://github.com/matronator/c32check
bitcoin blockchain btc decoder encoder stacks stacks-address stacks-blockchain stacks-wallet stx
Last synced: 7 months ago
JSON representation
PHP library for encoding and decoding C32 addresses which are used on the Stacks blockchain.
- Host: GitHub
- URL: https://github.com/matronator/c32check
- Owner: matronator
- License: mit
- Created: 2024-06-01T23:03:38.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-09-18T07:50:44.000Z (11 months ago)
- Last Synced: 2025-09-29T13:39:49.395Z (10 months ago)
- Topics: bitcoin, blockchain, btc, decoder, encoder, stacks, stacks-address, stacks-blockchain, stacks-wallet, stx
- Language: PHP
- Homepage: https://packagist.org/packages/matronator/c32check
- Size: 853 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# C32Check
PHP library for encoding and decoding C32 addresses which are used on the Stacks blockchain. It provides functionality to convert between base-58 encoded strings and their underlying byte representations, including checksum verification.
## Requirements
- PHP 8.0 or higher
- Composer
## Installation
```bash
composer require matronator/c32check
```
## Usage
```php
use Matronator\C32Check\Address;
$version = 22;
$hexString = '0x1e2a7c8a7e0d61c7a7d679c4e0c8f2e7';
$address = new Address($version, $hexString);
echo $address->toBase58Address(); // 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2
echo $address->toC32Address(); // ST1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2Z
```
## Testing
```bash
composer test
```
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Acknowledgements
- [Bitcoin Wiki](https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses)
- [Base58](https://github.com/tuupola/base58)
- [Stacks](https://stacks.co/)
- [c32check in TypeScript](https://github.com/stacks-network/c32check)