EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 463 forks source link

Signing of transactions #185

Closed anil215 closed 6 years ago

anil215 commented 6 years ago

I am using eosjs for my application which involves performing some txs. I did setup my local node and broadcasting txs through it which are working correctly. My question here is whether the signing and serialisation of txs being done locally and then the signed tx is broadcasted though the node whose httpEndpoint i provided ? The private key is not exposed to the network right. I am pretty sure the second thing is not happening but would be pretty helpful if you could provide some links to the source code to prove it.

Thanks a lot .

chris-allnutt commented 6 years ago

@anil215 it is signed locally and then transmitted the key never leaves your browser.

jcalfee commented 6 years ago

Here is the one and only place of serialization and signing ..
https://github.com/EOSIO/eosjs/blob/v14.1.1/src/write-api.js#L406-L419

The signing is implementation is plug-able. Here is the default. Keep in mind the sign function comes from eosjs-ecc: const {sign} = ecc..

https://github.com/EOSIO/eosjs/blob/v14.1.1/src/index.js#L201

Let me know if you have any more questions..

wannabit-jayb commented 6 years ago

@jcalfee Do you know any java version of eosjs-ecc? I am trying to implement signing transaction and sending the signed transaction to one of the BP nodes in java.

chris-allnutt commented 6 years ago

@wannabit-jayb there is no java version we know of.

jcalfee commented 6 years ago

Java can run many language like javascript, not sure if it maps everything though like the crypto apis..