amashukov/eth-php

Standalone Ethereum / EVM SDK for PHP — Keccak-256, secp256k1 + ECDSA (RFC 6979), RLP, EIP-1559 offline signing, ABI calldata encoder, and an ethers.js-style JSON-RPC client. Umbrella package pulling the full pure-PHP EVM stack.

Maintainers

Package info

github.com/AndreyMashukov/eth-php

pkg:composer/amashukov/eth-php

Statistics

Installs: 75

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-05-24 06:26 UTC

This package is auto-updated.

Last update: 2026-05-24 12:47:35 UTC


README

Pure-PHP Ethereum / EVM SDK — Keccak-256, secp256k1 ECDSA, RLP, EIP-1559 offline signing, ABI encoder, and an ethers.js-style JSON-RPC client in one composer require.

CI PHPStan L9 Latest Version Downloads PHP License Stars

amashukov/eth-php is a standalone Ethereum / EVM SDK for PHP — a single umbrella package that pulls every EVM-side primitive you need: Keccak-256 / SHA-3 hashing, secp256k1 EC arithmetic with RFC-6979 low-S ECDSA, RLP encoding, EIP-1559 (Type-2) offline transaction signing, a Solidity ABI calldata encoder, and an ethers.js v6-style JSON-RPC client. Pure PHP, zero blockchain-library dependencies, no Symfony. It is the first maintained ethers.js-style PHP SDK with full EIP-1559 support.

Features

  • Keccak-256 / SHA-3 — the hashing primitive every EVM selector and address derives from.
  • secp256k1 + ECDSA — EC point arithmetic plus RFC-6979 deterministic, low-S signatures.
  • RLP — recursive-length-prefix encoder / decoder for transactions and structures.
  • EIP-1559 offline signing — assemble and sign Type-2 raw transactions without a node.
  • ABI calldata encoder — Solidity ABI encoding that matches ethers.js byte-for-byte.
  • ethers.js-style RPC client — JSON-RPC v6-style client with typed value objects over any PSR-18 transport.
  • One install — the full EVM stack ships through a single composer require.

Why amashukov/eth-php

web3p/web3.php is the historical PHP EVM client (~600★), but it is effectively abandoned and has no EIP-1559 (Type-2) support — it can only build legacy transactions, which most modern chains and tooling have moved past. amashukov/eth-php is the first maintained ethers.js-style PHP SDK with EIP-1559: deterministic low-S signing, an ABI encoder that matches ethers.js byte-for-byte, and a v6-style typed RPC client — each layer separately versioned, the whole stack behind one composer require.

Installation

composer require amashukov/eth-php

Usage

Each layer keeps its own namespace; import what you need:

use Amashukov\Keccak\Keccak;
use Amashukov\AbiEncoder\AbiEncoder;
use Amashukov\Eip1559TxSigner\Eip1559Signer;
use Amashukov\EthRpc\EthRpcClient;
use Amashukov\EthRpc\JsonRpcProvider;

// Hash, encode calldata, sign a Type-2 tx, and broadcast it — see each
// sub-package README for the full API.

The layers compose: the RPC client's getErc20Balance() builds its calldata through the ABI encoder, which derives selectors through Keccak — one consistent stack, no duplicated crypto.

Requirements

Related packages

Package Layer
amashukov/keccak-php Keccak-256 / SHA-3
amashukov/secp256k1-php secp256k1 EC arithmetic + ECDSA (RFC 6979, low-S)
amashukov/rlp-php RLP encoder / decoder
amashukov/eip1559-tx-signer-php EIP-1559 (Type-2) offline raw-tx assembly + signing
amashukov/abi-encoder-php Solidity ABI calldata encoder (ethers.js-exact)
amashukov/eth-rpc-client-php ethers.js v6-style JSON-RPC client + typed VOs over PSR-18
amashukov/http-client-php PSR-18 cURL HTTP client
amashukov/ton-php Sister umbrella SDK for TON (The Open Network)
amashukov/blockchain-context-bundle Symfony 7 bundle wiring the TON + EVM stacks

Quality

  • PHPStan level 9 across the whole stack.
  • php-cs-fixer with the @PER-CS ruleset.
  • GitHub Actions CI on every push.
  • Parity tests pin the ABI encoder and signed transactions byte-for-byte against ethers.js.

License

MIT — see LICENSE. Each bundled package is MIT-licensed in its own repository.