1

I have a question about Ethereum client-side, maybe someone could give a hint...

It's about building a DApp, we need a web client capable of creating offline a private key and a public key, and also send signed transactions to an Ethereum node.

After investigating for a while we came to the conclusion this is possible through the web3.js library (and others like ethereumjs), but it implies using nodejs and browserfy, right? The question is:

Is there any other simpler solution, such as using a simple js file?

Thx in advance!

1

You are making a wrong assumption. Using Web3.js does not require Browserify or Node.JS. You can drop in web3.js dependency in HTML code like any other JavaScript library. Only building Web3.js distribution requires this build toolchain.

Here is a simple "index.html" application using web3.js.

| improve this answer | |
  • Is web3.js enough to create private and public keys? And enough to sign transactions? Or should I use ethereumjs too? – Juan Ignacio Pérez Sacristán Dec 19 '16 at 23:09
  • 1
    If you don't need deterministic keys a private key is just any securely random number. web3.js can derive a public key / address from a private key. – Mikko Ohtamaa Dec 20 '16 at 21:41
  • Can I use web3.js as a standalone to sign transaction? – Rani Aug 27 '17 at 16:50
2

Try the consensys lightwallet

the txutils functions can be used to construct transactions when offline, for use in e.g. air-gapped coldwallet implementations.

https://github.com/ConsenSys/eth-lightwallet

| improve this answer | |
  • Thx! When trying offline eth-lightwallet-master/example/webwallet.html I got these errors on javascript console: Uncaught ReferenceError: async is not defined at getBalances (webwallet.html:52) at HTMLButtonElement.onclick (webwallet.html:154) Is that normal? – Juan Ignacio Pérez Sacristán Dec 19 '16 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.