{"id":15645520,"url":"https://github.com/linusu/php-bitcoin-address-validator","last_synced_at":"2026-03-01T19:32:10.726Z","repository":{"id":57015313,"uuid":"18765492","full_name":"LinusU/php-bitcoin-address-validator","owner":"LinusU","description":"💰 A simple, easy to use PHP Bitcoin address validator","archived":false,"fork":false,"pushed_at":"2020-06-03T00:52:47.000Z","size":193,"stargazers_count":53,"open_issues_count":5,"forks_count":29,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-01-02T00:32:36.707Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LinusU.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-14T15:18:52.000Z","updated_at":"2024-07-07T19:44:48.000Z","dependencies_parsed_at":"2022-08-22T09:31:26.459Z","dependency_job_id":null,"html_url":"https://github.com/LinusU/php-bitcoin-address-validator","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fphp-bitcoin-address-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fphp-bitcoin-address-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fphp-bitcoin-address-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fphp-bitcoin-address-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LinusU","download_url":"https://codeload.github.com/LinusU/php-bitcoin-address-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232494159,"owners_count":18532147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T12:08:27.213Z","updated_at":"2026-03-01T19:32:10.688Z","avatar_url":"https://github.com/LinusU.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-bitcoin-address-validator\n\nA simple, easy to use PHP Bitcoin address validator\n\n## Usage\n\nQuick start:\n\n```php\nuse \\LinusU\\Bitcoin\\AddressValidator;\n\n// This will return false, indicating invalid address.\nAddressValidator::isValid('blah');\n\n// This is a valid address and will thus return true.\nAddressValidator::isValid('1AGNa15ZQXAZUgFiqJ2i7Z2DPU2J6hW62i');\n\n// This is a Testnet address, it's valid and the function will return true.\nAddressValidator::isValid('mo9ncXisMeAoXwqcV5EWuyncbmCcQN4rVs', AddressValidator::TESTNET);\n```\n\n## API\n\n### `isValid($addr, $version)`\n\n- `$addr`: A bitcoin address\n- `$version`: The version to test against, defaults to `MAINNET`\n\nReturns a boolean indicating if the address is valid or not.\n\n### `typeOf($addr)`\n\n- `$addr`: A bitcoin address\n\nReturns the type of the address.\n\n## Constants\n\nThe library exposes the following constants.\n\n- `MAINNET`: Indicates any mainnet address type\n- `TESTNET`: Indicates any testnet address type\n- `MAINNET_PUBKEY`: Indicates a mainnet pay to pubkey hash address\n- `MAINNET_SCRIPT`: Indicates a mainnet pay to script hash address\n- `TESTNET_PUBKEY`: Indicates a testnet pay to pubkey hash address\n- `TESTNET_SCRIPT`: Indicates a testnet pay to script hash address\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinusu%2Fphp-bitcoin-address-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinusu%2Fphp-bitcoin-address-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinusu%2Fphp-bitcoin-address-validator/lists"}