secp256k1 is a setting for ECC (elliptic curve cryptography) and SHA256 is a hashing function.

ECC and SHA are what you should be comparing because both of those are ciphers.

ECC is a type of public key cryptography. the most common type is RSA.

in Bitcoin, transactions are hashed with SHA256 twice and then that hash is encrypted with ECC using a private key. the hash will only decrypt properly with the corresponding public key, meaning that it serves as a signature. using ECC as the encryption method for signing is called ECDSA.

a hashing function takes some input and produces a short unreadable output, so it's a one-way cipher. for the same input it always produces the same output. in digital signatures you always produce a hash of the data that you sign instead of signing the data directly by encrypting all of it, because it's much faster this way.

you really want to read up on public key cryptography and then come back to understand how it's used in Bitcoin.

Reply to this note

Please Login to reply.

Discussion

No replies yet.