reynevan / web3-php
Web3 PHP helpers
v1.1.1
2026-08-17 17:17 UTC
Requires
- php: >=8.1
- ext-gmp: *
- kornrunner/keccak: ^1.1
Requires (Dev)
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2026-08-17 17:33:46 UTC
README
A lightweight PHP library for working with Ethereum (EVM) transactions. It decodes raw EIP-1559 transactions (0x02...) into a readable object and recovers the sender address (from) from the ECDSA signature, without needing to connect to an RPC node.
Features
- Decoding a raw (RLP) EIP-1559 transaction into an
Eip1559Transactionobject - Recovering the sender address from the signature (
ecrecover) using the secp256k1 curve accessListsupport (AccessListEntry)- Input validation (throws
InvalidArgumentExceptionfor invalid transactions)
Requirements
- PHP >= 8.1
gmpextension
Installation
composer require reynevan/web3-php
Usage example
use Reynevan\Web3\Eip1559TransactionDecoder; $decoder = new Eip1559TransactionDecoder(); $transaction = $decoder->decode('0x02f8...'); echo $transaction->from; echo $transaction->to; echo $transaction->value;
Tests
composer install vendor/bin/phpunit
License
MIT