PHPackages                             domraider/php-eth-raw-tx - 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. [API Development](/categories/api)
4. /
5. domraider/php-eth-raw-tx

ActiveLibrary[API Development](/categories/api)

domraider/php-eth-raw-tx
========================

PHP tool for creating Ethereum raw transactions

0.0.3(7y ago)372.5k14[2 issues](https://github.com/Domraider/php-eth-raw-tx/issues)[3 PRs](https://github.com/Domraider/php-eth-raw-tx/pulls)MITPHP

Since Jan 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Domraider/php-eth-raw-tx)[ Packagist](https://packagist.org/packages/domraider/php-eth-raw-tx)[ RSS](/packages/domraider-php-eth-raw-tx/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (6)Versions (6)Used By (0)

php-eth-raw-tx
==============

[](#php-eth-raw-tx)

PHP tool to create Ethereum raw transaction

Pre-requisite
-------------

[](#pre-requisite)

### secp256k1-php

[](#secp256k1-php)

You need [secp256k1-php](https://github.com/Bit-Wasp/secp256k1-php). Which itself needs [secp256k1](https://github.com/bitcoin-core/secp256k1) to be installed on your system.

Last tests were run using the following versions :

- secp256k1-lastest
- secp256k1-php-0.1.2

*You will need `gcc`, `libtool`, `make`, `automake` , which is standard package you can grab from apt, yum, brew...*

First install secp256k1

```
$> curl -L0k https://github.com/bitcoin-core/secp256k1/archive/master.zip > secp256k1-latest.zip
$> unzip secp256k1-latest.zip
$> cd secp256k1-master
$> ./autogen.sh
$> ./configure --enable-experimental --enable-module-{ecdh,recovery}
$> make
$> sudo make install
$>
```

Then secp256k1-php v0.1.2.

Updating this section with fix for issue [\#35](https://github.com/Domraider/php-eth-raw-tx/issues/35). I have added SED to make extension compatible with latest secp256k1 library

```
$> curl -L0k https://github.com/Bit-Wasp/secp256k1-php/archive/v0.1.2.zip > secp256k1-php-0.1.2.zip
$> unzip secp256k1-php-0.1.2.zip
$> cd secp256k1-php-0.1.2/secp256k1
$> sed -i 's/secp256k1_ecdh(ctx, resultChars, pubkey, privKey->val);/secp256k1_ecdh(ctx, resultChars, pubkey, privKey->val, NULL, NULL);/' secp256k1.c
$> phpize
$> ./configure --with-secp256k1
$> make
$> sudo make install
$>
```

Finally add extension to you *php.ini* file

```
extension=secp256k1.so
```

Examples
--------

[](#examples)

You may run examples in `examples` folder.

### Creating a raw transaction

[](#creating-a-raw-transaction)

```
$tx = new \EthereumRawTx\Transaction(
    \BitWasp\Buffertools\Buffer::hex('d44d259015b61a5fe5027221239d840d92583adb'),
    \BitWasp\Buffertools\Buffer::int(5 * 10**18),
);

$raw = $tx->getRaw(\BitWasp\Buffertools\Buffer::hex(MY_PRIVATE_KEY));
```

Demo :

Explore `examples` folder for demos. Some are meant to generate a whole signed tx to write the blockchain. They can be broadcasted using `eth_sendRawTransaction` using JSON-RPC. Some others aim to read the blockchain and generated data should simply be send using `eth_call` using JSON-RPC. Some are simply utility reading tools. Unfortunately some features may not be demonstrated yet. Do not hesitate to contribute.

- `call_smart_contract` : Generate a raw data to read a Smart Contract.
- `check_signature` : Tool to recover the signer address of a transaction.
- `decode_smart_contract_event_reponse` : Tool to decode events from a `eth_getTransactionByHash` call.
- `decode_smart_contract_reponse` : Tool to read an `eth_call` response.
- `decode_tx_params` : Tool to decode a `data` field from a transaction.
- `deploy_smart_contract` : Generate a signed raw transaction for deploying a new Smart Contract.
- `event_smart_contract` : Tool to get an event hash.
- `send_ether` : Generate a signed raw transaction for sending ETH .
- `send_smart_contract` : Generate a signed raw transaction for writing on a Smart Contract function.

Tests
-----

[](#tests)

You can run specs with

```
vendor/bin/peridot tests/
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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 ~237 days

Total

3

Last Release

2599d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2012682?v=4)[etienne roudeix](/maintainers/etienneroudeix)[@etienneroudeix](https://github.com/etienneroudeix)

---

Top Contributors

[![etienneroudeix](https://avatars.githubusercontent.com/u/2012682?v=4)](https://github.com/etienneroudeix "etienneroudeix (30 commits)")[![NeverEnding8](https://avatars.githubusercontent.com/u/5019672?v=4)](https://github.com/NeverEnding8 "NeverEnding8 (9 commits)")[![kornrunner](https://avatars.githubusercontent.com/u/725986?v=4)](https://github.com/kornrunner "kornrunner (2 commits)")[![dellasorte](https://avatars.githubusercontent.com/u/5054485?v=4)](https://github.com/dellasorte "dellasorte (1 commits)")

### Embed Badge

![Health badge](/badges/domraider-php-eth-raw-tx/health.svg)

```
[![Health](https://phpackages.com/badges/domraider-php-eth-raw-tx/health.svg)](https://phpackages.com/packages/domraider-php-eth-raw-tx)
```

###  Alternatives

[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k77.4k88](/packages/pocketmine-pocketmine-mp)[web3p/web3.php

Ethereum web3 interface.

1.2k348.3k41](/packages/web3p-web3php)[phptg/bot-api

PHP library for working with Telegram API

12612.9k7](/packages/phptg-bot-api)[biplane/yandex-direct

PHP library for Yandex.Direct API

54182.3k2](/packages/biplane-yandex-direct)[furqansiddiqui/erc20-php

Interact with any ERC20 standard/backward-compatible Ethereum token

16767.4k4](/packages/furqansiddiqui-erc20-php)[fenguoz/tron-php

Support TRON's TRX and TRC20, which include functions such as address creation, balance query, transaction transfer, query the latest blockchain, query information based on the blockchain, and query information based on the transaction hash

21438.1k1](/packages/fenguoz-tron-php)

PHPackages © 2026

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