Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/digitaldonkey/ecverify
PHP based Ethereum web3 personal recover
https://github.com/digitaldonkey/ecverify
ecrecover ecverify ethereum personal-ecrecover php web3
Last synced: 9 days ago
JSON representation
PHP based Ethereum web3 personal recover
- Host: GitHub
- URL: https://github.com/digitaldonkey/ecverify
- Owner: digitaldonkey
- License: mit
- Created: 2018-05-18T17:50:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-16T09:58:37.000Z (over 2 years ago)
- Last Synced: 2024-11-01T11:34:40.272Z (16 days ago)
- Topics: ecrecover, ecverify, ethereum, personal-ecrecover, php, web3
- Language: PHP
- Homepage: https://github.com/digitaldonkey/ethereum-php
- Size: 10.7 KB
- Stars: 14
- Watchers: 3
- Forks: 13
- Open Issues: 5
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP based EC recovery for Ethereum
This is the PHP equivalent to **web3.personal.ecRecover**.
```javascript
web3.personal.ecRecover (
"I want to create a Account on this website. By I signing this text (using Ethereum personal_sign) I agree to the following conditions.",
"0xbbdcdfb9fbe24d460a683633475c77a44072b527a127b159ffaaa043f5dc944105a1671c8b9df95e377d89ec17a1a0ed13f5caa33e5fa80bdf12391bf2e04e4f1c",
(e,f)=>{console.log(e,f)}
)
```
## Usage```php
use Ethereum\EcRecover;$addrss = '0xbe93f9bacbcffc8ee6663f2647917ed7a20a57bb';
$message = 'hello world';
$signature = '0xce909e8ea6851bc36c007a0072d0524b07a3ff8d4e623aca4c71ca8e57250c4d0a3fc38fa8fbaaa81ead4b9f6bd03356b6f8bf18bccad167d78891636e1d69561b';// Verify known address
$valid = EcRecover::personalVerifyEcRecover($message, $signature, $address);// Recover unknown address
$recoveredAddress = EcRecover::personalEcRecover($message, $signature);
if ($recoveredAddress === $address) {
echo 'Jay! it was a long way here. '
}
```## Testing
```bash
composer install
vendor/bin/phpunit
```