Skip to content

Do we just need private key to sign a transaction ? #3539

Answered by krakxn
jashjasani asked this question in Q&A
Discussion options

You must be logged in to vote

@jashjasani

When we are creating a wallet object from ethers.wallet we are only passing the private key in it,

This is how we create a Wallet instance (Wallet extends Signer abstract class)--i.e. from the privateKey.

my question is how will the wallet know about the corresponding public key or address ?

First of all, cryptographic algorithms used in this space, primarily SHA256, are collision-resistant--i.e. no different outputs from a given input will be the same. Additionally, in the blockchain space, we use asymmetric cryptography--i.e. to encrypt and decrypt data, there is no single point of failure in a single key; we have a pair of keys, which is known as the public and private …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@jashjasani
Comment options

Comment options

You must be logged in to vote
2 replies
@jashjasani
Comment options

@krakxn
Comment options

Answer selected by jashjasani
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants