PHP code example of agustind / ethsignature

1. Go to this page and download the library: Download agustind/ethsignature 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/ */

    

agustind / ethsignature example snippets




use Agustind\Ethsignature;
$signature = new Ethsignature();

// from the frontend (via Ethers.js or Web3.js)
// the wallet 0x123456789 signs the message 'hello world'
// and generates the signature string 'xxxxyyyyzzzz'

$is_valid = $signature->verify('hello world', 'xxxxyyyyzzzz', '0x123456789');
// true