1

I found that on the web of quiknode it says quiknode do not support eth sign and maybe infura does not also What should I do ? I want to use ethereum.php so I need to create eth sign and send transaction by php if the api do not support eth sign. Whether this means I need to use some other way to do it such as nodejs

| improve this question | | | | |
  • Comments are not for extended discussion; this conversation has been moved to chat. – eth Apr 27 at 5:14
2

According to https://infura.io/docs Infura does not support eth_sign either — probably for the same reason QuikNode doesn’t (security).

The solution is to sign the transaction using your private key and then use eth_sendRawTransaction.

These may shed additional info:

https://medium.com/blockchain-musings/how-to-create-raw-transactions-in-ethereum-part-1-1df91abdba7c

https://twitter.com/QuikNode/status/1035517337187835905

| improve this answer | | | | |
1

Ive used ethereum-tx a few times to do this.

Get ethereum-tx for php

composer require web3p/ethereum-tx

Example tx

use Web3p\EthereumTx\Transaction;

// without chainId
$transaction = new Transaction([
    'nonce' => '0x01',
    'from' => '0xb60e8dd61c5d32be8058bb8eb970870f07233155',
    'to' => '0xd46e8dd67c5d32be8058bb8eb970870f07244567',
    'gas' => '0x76c0',
    'gasPrice' => '0x9184e72a000',
    'value' => '0x9184e72a',
    'data' => '0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675'
]);

// with chainId
$transaction = new Transaction([
    'nonce' => '0x01',
    'from' => '0xb60e8dd61c5d32be8058bb8eb970870f07233155',
    'to' => '0xd46e8dd67c5d32be8058bb8eb970870f07244567',
    'gas' => '0x76c0',
    'gasPrice' => '0x9184e72a000',
    'value' => '0x9184e72a',
    'chainId' => 1,
    'data' => '0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675'
]);

// hex encoded transaction
$transaction = new Transaction('0xf86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83');

Example Sign

use Web3p\EthereumTx\Transaction;

$signedTransaction = $transaction->sign('your private key');

https://github.com/web3p/ethereum-tx

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.