7

Can someone explain in layman term, why the transaction needs to be signed and the role of public key, private key in transaction signing process. From what I have read so far:

  1. When user creates a new Account, specifies passphrase. Privatekey is generated and stored in keystore file. (encrypted using passphrase).
  2. When sending transaction, Passphrase is used to decrypt the keystore and retrieve private key.
  3. Private key is used to sign transaction. Signed transaction is published by the node.
  4. Receiving node uses public key (how other nodes get public key?) to verify
    signature. If valid, transaction is processed.

Pls let me know if above understanding is correct and help to understand questions raised in the workflow.

8

This is basically correct. In (4), any node can receive a transaction, check the signature and relay it to other nodes.

The public key can be recovered from the signature, so it doesn't need to be passed around or looked up from anywhere. (This is different from Bitcoin, which wastes bandwidth by passing public keys around in spending transactions; Satoshi doesn't seem to have been that deep into cryptography.)

  • How does this process work for transactions sent by a contract? (e.g. one contract calling a method on another contract) as far as I know creating a contract doesn't involve passphrases/private keys. If tx's sent by contract are undistinguished from tx's sent by an "account" how are they actually signed/verified? – jlpiedrahita Jan 10 '17 at 11:56
  • 1
    @jlpiedrahita See this answer ethereum.stackexchange.com/questions/11252/… – Edmund Edgar Jan 11 '17 at 0:51
  • excellent clarification, I knew I had missed some key part in all of this, thanks a lot. – jlpiedrahita Jan 11 '17 at 11:47
  • this answer does not explain what data is used to sign the transaction. Is extradata involved in signing process for example? – Nulik Dec 6 '17 at 23:46
  • 1
    @Alper for example see the implementation in github.com/ethereum/… – Edmund Edgar Dec 17 '17 at 10:40

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.