web3p / web3.php

A php interface for interacting with the Ethereum blockchain and ecosystem. Native ABI parsing and smart contract interactions.
MIT License
1.16k stars 543 forks source link

Generate wallet public and private key using web3 PHP #151

Open kamran-jabbar opened 5 years ago

kamran-jabbar commented 5 years ago

I am using this to get public key: https://github.com/sc0Vu/web3.php#assign-value-to-outside-scopefrom-callback-scope-to-outside-scope I am in need of to get the public and private key using PHP web3 like this: https://web3js.readthedocs.io/en/1.0/web3-eth-accounts.html#create

How can I do that?

phpemobxdev commented 5 years ago

@kamran-jabbar are you able to create account in php using $web3->personal ?

kamran-jabbar commented 5 years ago

@phpemobxdev No, I did it using NodeJS API endpoint and just send cURL request from PHP to NodeJS endpoint to get the public key and private key.

phpemobxdev commented 5 years ago

@kamran-jabbar can you please share your code ?

kamran-jabbar commented 5 years ago

@phpemobxdev var api_response = web3js.eth.accounts.create(password);

beardhero commented 5 years ago

Hi, I'm trying to figure this out myself. How do I either generate a locally kept keypair or use a keypair I have stored locally (not on the provider node)?

kamran-jabbar commented 5 years ago

@beardhero I have no idea about that, I have used infura.io as provider.

tuandat77 commented 4 years ago

@kamran-jabbar I hope will help you. https://github.com/kornrunner/php-ethereum-address

kamran-jabbar commented 4 years ago

@tuandat77 yeah may be in future but for now I am not working on that part, anyhow thank you so much :)