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.
- PHP 8.0 or higher
- Composer
composer require matronator/c32checkuse Matronator\C32Check\Address;
$version = 22;
$hexString = '0x1e2a7c8a7e0d61c7a7d679c4e0c8f2e7';
$address = new Address($version, $hexString);
echo $address->toBase58Address(); // 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2
echo $address->toC32Address(); // ST1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2Zcomposer testThis project is licensed under the MIT License - see the LICENSE file for details.