PHP code example of cpuchain-php / cpuchain-ecdsa

1. Go to this page and download the library: Download cpuchain-php/cpuchain-ecdsa library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cpuchain-php / cpuchain-ecdsa example snippets


use CPUchainPHP\CPUchainECDSA\CPUchainECDSA;

$cpuchainECDSA->setPrivateKey($k);

$cpuchainECDSA->generateRandomPrivateKey($nonce);

$cpuchainECDSA->getPrivateKey();

$cpuchainECDSA->getWif();

$cpuchainECDSA->getPubKey();

$cpuchainECDSA->getUncompressedPubKey();

$cpuchainECDSA->getPubKeyPoints();

$cpuchainECDSA->getAddress();

$cpuchainECDSA->getUncompressedAddress();

$cpuchainECDSA->validateAddress($address);

$cpuchainECDSA->validateWifKey($wif);

$cpuchainECDSA->signMessage('message');

$cpuchainECDSA->checkSignatureForRawMessage($signedMessage);

$cpuchainECDSA->signHash($hash);

$cpuchainECDSA->checkDerSignature($pubKey, $signature, $hash)

composer 

"cpuchain-php/cpuchain-ecdsa" : ">=1.3"