what is the difference between public key and private key?
thank you!
In the case of Elliptic Curve Digital Signature Algorithm (as used by Bitcoin):
A private key is a very large randomly generated number that you do not share with anybody. You keep it entirely to yourself (keep it private). It is used to calculate a digital signature that can be shared to prove that a message someone receives is an unmodified copy of the message that you sent.
A public key is an point (X and Y coordinates) on the specified elliptic curve that is associated with your private key in a very specific way. If you have the private key, it is possible for you to compute the public key (and using the correct calculation will ALWAYS result in the exact same public key for a given private key). If you have the public key, it is not possible with any currently known techniques, algorithms, or technology to calculate the private key. Due to the mathematical relationship between the private key and the public key, it is possible to use the public key to verify that a message was signed with the same private key that was used to calculate the public key.
The public key is provided publicly for others to use to verify signatures that you create with your private key.
Although you didn't ask about it, Bitcoin makes use of a third piece of information for transactions. This third piece of information is the "Bitcoin Address". A bitcoin address is not a public key. It is a hash of a public key. If you have a public key, it is possible to calculate the bitcoin address, but if you only have a bitcoin address then it is not possible to calculate the public key. When verifying a bitcoin transaction, first the public key is used to make sure that the signature is valid, and then the bitcoin address is calculated from the public key to make sure that it matches the proper bitcoin address.