PHPackages                             deftnerd/cryptoaddressvalidator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. deftnerd/cryptoaddressvalidator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

deftnerd/cryptoaddressvalidator
===============================

Laravel validator for various cryptocurrency address formats

v1.0.7(9y ago)32533MITPHPPHP ~5.6|~7.0

Since Apr 21Pushed 9y ago1 watchersCompare

[ Source](https://github.com/DeftNerd/CryptoAddressValidator)[ Packagist](https://packagist.org/packages/deftnerd/cryptoaddressvalidator)[ Docs](https://github.com/DeftNerd/CryptoAddressValidator)[ RSS](/packages/deftnerd-cryptoaddressvalidator/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (4)Versions (9)Used By (0)

CryptoAddressValidator
======================

[](#cryptoaddressvalidator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/711bd8f8ec632d99ac885cd92369112bacb0dfe17053398ff773ebba1c11b6f8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f446566744e6572642f43727970746f4164647265737356616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/DeftNerd/CryptoAddressValidator)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/2beea9d1aa6aadacba349e2f9eaf21fc44b64b3cba4b61b2bc5797d2a734726f/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f446566744e6572642f43727970746f4164647265737356616c696461746f722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/DeftNerd/CryptoAddressValidator)[![Coverage Status](https://camo.githubusercontent.com/bc9bbfa723a6060966a2060a8990c706c538b207c1786efa9dbe8f35f0d4aae8/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f446566744e6572642f43727970746f4164647265737356616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/DeftNerd/CryptoAddressValidator/code-structure)[![Quality Score](https://camo.githubusercontent.com/a5abd782ff9efe7fe9badd3179d06727797295ad1e232f0cc482feba69c75fed/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f446566744e6572642f43727970746f4164647265737356616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/DeftNerd/CryptoAddressValidator)[![Total Downloads](https://camo.githubusercontent.com/15d3e4e18f6cb8751fd4e0543f9bca58271cde7e3c48ff7af85f5173579f9866/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f446566744e6572642f43727970746f4164647265737356616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/DeftNerd/CryptoAddressValidator)

Adds a Laravel validator for various cryptocurrency address formats.

Currently adds a `onion` and `bitcoin` validator. Planning to add the following soon:

- Dash addresses
- Dogecoin addresses
- Ethereum addresses (only very basic)
- Litecoin addresses
- Monero addresses

Also planning to create the following validators under another project

- GPG pubkey
- GPG signed data
- Generic Base38 Validator
- Generic Base32 Validator
- Generic Hex validator
- vinkla/laravel-hashids validator
- CC validator (Luhn digit check algorithm)

Install
-------

[](#install)

Via Composer

```
$ composer require DeftNerd/CryptoAddressValidator
```

Add the following to the providers array in your config/app.php file

```
DeftNerd\CryptoAddressValidator\CryptoAddressServiceProvider::class
```

Usage
-----

[](#usage)

### Test any onion address to see if it follows the format

[](#test-any-onion-address-to-see-if-it-follows-the-format)

Base32, 16 characters, ends in '.onion'

Validator::make(\['test' =&gt; 'facebookcorewwwi.onion'\], \['test' =&gt; 'onion'\])-&gt;passes(); //true

Validator::make(\['test' =&gt; 'notarealonionaddress.onion'\], \['test' =&gt; 'onion'\])-&gt;passes(); //false

Validator::make(\['test' =&gt; 'facebook.com'\], \['test' =&gt; 'onion'\])-&gt;passes(); //false

### Test a Bitcoin address to see if it's valid.

[](#test-a-bitcoin-address-to-see-if-its-valid)

Checks for proper Base58 encoding, tests the checksum, verifies the network prefix byte is one of (mainnet regular, mainnet p2sh, testnet regular, testnet p2sh)

Validator::make(\['test' =&gt; '1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v'\], \['test' =&gt; 'bitcoin'\])-&gt;passes(); // true *(Bitcoin address)*

Validator::make(\['test' =&gt; 'n2eMqTT929pb1RDNuqEnxdaLau1rxy3efi'\], \['test' =&gt; 'bitcoin'\])-&gt;passes(); // true *(Bitcoin Testnet address)*

Validator::make(\['test' =&gt; 'jsd8j8jksdjf9sj98'\], \['test' =&gt; 'bitcoin'\])-&gt;passes(); // false *(random characters)*

Validator::make(\['test' =&gt; 'LQ3B36Yv2rBTxdgAdYpU2UcEZsaNwXeATk'\], \['test' =&gt; 'bitcoin'\])-&gt;passes(); // false *(Litecoin address)*

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Adam Brown](https://github.com/DeftNerd)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

8

Last Release

3358d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3002275?v=4)[Adam Brown](/maintainers/deftnerd)[@DeftNerd](https://github.com/DeftNerd)

---

Top Contributors

[![DeftNerd](https://avatars.githubusercontent.com/u/3002275?v=4)](https://github.com/DeftNerd "DeftNerd (10 commits)")

---

Tags

DeftNerdCryptoAddressValidator

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/deftnerd-cryptoaddressvalidator/health.svg)

```
[![Health](https://phpackages.com/badges/deftnerd-cryptoaddressvalidator/health.svg)](https://phpackages.com/packages/deftnerd-cryptoaddressvalidator)
```

###  Alternatives

[illuminate/validation

The Illuminate Validation package.

18838.2M1.7k](/packages/illuminate-validation)[craftcms/cms

Craft CMS

3.6k3.6M3.0k](/packages/craftcms-cms)[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.8M73](/packages/spatie-laravel-honeypot)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M341](/packages/psalm-plugin-laravel)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel

3893.6M1](/packages/axlon-laravel-postal-code-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
