![]() Now you’ve got two different hash functions to crack as well. However, if we give out a hashed version of our public key instead, attackers would have to crack both the RIPEMD160 and SHA256 hash functions, as well as deal with the elliptic curve problem. It’s impossibly difficult to work backwards from elliptic curve multiplication to get the private key, but you can try. CodeĪn alternative theory is that using the Hash160 provides an extra layer of security.įor example, if we immediately give away our public key when we want to receive bitcoins, the “only” thing protecting you from attackers trying to get to your private key is the elliptic curve. This is why this type of locking system is referred to as P2PKH. So instead of just checking a signature against a public key (as in a P2PK lock), there is one extra step that checks the hash of the public key beforehand. If that checks out, they will then validate the signature against the public key as usual.Check that the public key provided hashes correctly to the public key hash.So when a node comes to validate this transaction, it will: ![]() Then, when you want to unlock these bitcoins (to send them to someone in a new transaction), you just put your original public key along with a digital signature in to the input’s unlocking code. They will then put this in to the locking code of a transaction output. When you want to receive bitcoins, you give someone your public key hash. ![]() How is the public key hash used in Bitcoin? ![]() The reason that we use it in conjunction with SHA256 is because RIPEMD160 is not the strongest hash function on its own. This means that the eventual address we create from it will contain fewer characters than a full public key, making easier to pass around. Because RIPEMD160 produces a 160 bit ( 20 byte) digest, which is smaller than the original public key ( 65 bytes uncompressed, 33 bytes compressed). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |