-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Is possible to generate new account offline #35
Comments
Technically Ethereum addresses are independent from any network. They just derived from a "private key" which is just some random string. Visible on chain are only the transactions from/to an account address. You may use a wallet like Metamask to create them. I don't know of any PHP wallet currently, but it would be great to add this function in this library (And by experience, I'm sure soon after you'll find some content here too ;) ) Summing up as opposed to contract addresses (which are deployed on chain) account addresses are technically network independent, so you don't need a network to connect to. The param stuff I actually don't understand, I guess it's not necessary. I'm to answer more questions on that. |
Hey @digitaldonkey, I managed to create address "offline". The code is based on that post that I sent to you, and also based on the implementation of ethereum/web3.js. I used two dependencies to reach my goal. kornrunner/php-keccak, and mdanter/ecc.
|
I agree that Ethereum addresses should and they are independent of any network, but basically, all PHP libraries when you try to create a new account, the library create a request But what made me wonder was, if you see on the implementation of ethereum/web3.js to create accounts. He actually creates all hashes from scratch, as you mentioned is only a random string derived from a "private key". Check the code web3.eth.accounts.create, he uses an eth-lib to call the Account.create method eth-lib(account). So that is why I asked you If was possible to generate those address "offline" in PHP. With that implementation that I did is possible and it works. |
I would appreciate a pull request. Sorry for delay. I'm at DrupalEruope conference. |
Owww, I'll try my best to add this into a PR |
As Ethereum-PHP aims to be client independent (including services like infura.io which restrict the personal API, I like the "offline approach" as it would be most useful. Let me know if I can help you I'd be really happy about such feature. |
We should use PHP-7 |
Not Working This Code. Private key and address incompatible. Sample Output: array (size=3) True: |
Hi guys, how's going?
I very new on the blockchain, ethereum, all that stuff, and I have some sort of an "issue".
I saw a lot of libraries to work with ethereum in PHP and basically, all of them needs a connection with some ethereum network to work. But I noticed a lot of that networks as a service they don't allow us to create address/wallet/account due to security issues.
So there any way that I can generate those address offline? I saw this post and it seems possible to create offline.
I was thinking to add that feature. As an optional param to generate offline. We still will be needing a network to connect into, but that address part will be optional, with the default value as 'false'. If the network allows you to create, that one already works. If not allows, just change to 'true'.
What do you guys think?
Sorry if I said something wrong. Still learning.
Kind regards.
Amandio.
The text was updated successfully, but these errors were encountered: