I'm trying to generate a Monero Public Key and Private key for a webstore using only PHP.

I see Monero javascript and python code, however, I do not see PHP only code.

This is my attempt with PHP only:


$Cryptonote = new Cryptonote();
$seed = $Cryptonote->gen_new_hex_seed(); //generate new random hex seed
$address = $Cryptonote->gen_private_keys($seed); //generate new random private key

echo "Address : " . $address . PHP_EOL;

I receive these errors:

Notice: Undefined variable: spendkey in /var/www/html/monero/src/cryptonote.php on line 72

Notice: Array to string conversion in /var/www/html/monero/example.php on line 14 Address : Array

This is the library I'm using:


I appreciate any help!

Your Answer

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

Browse other questions tagged or ask your own question.