Sending ether is a type of transaction. A transaction is a set of instructions for modifying the state of the blockchain (e.g., transferring ether or calling a non-constant function of a contract -- such as a token-transfer function). If we consider only things like token transfers and ether transfers (for the sake of analogy), a "transaction" is like a bank cheque with all the details filled out -- the recipient, date, amount, account, etc. However, the cheque is useless to the bearer for the purposes of cashing it in unless it is signed. Similarly, all transactions must be signed for them to modify the blockchain.
So, taking a step back, in order to send ether, one generates a transaction that authorizes the transfer of ether from one account to another. Then one signs the transaction. These parts can be done off-line. Then, the last step, is for the transaction is broadcast onto the network and then it's up to the Ethereum network to work its magic and confirm the transaction into a block!
In order to sign something, a mathematical function is used to "sign" a piece of document/data. A digital signature of a document/data is a number generated using a private key. The private key has a corresponding public key. Anyone can sign a document but only (with high probability, according to our current understanding of mathematics and available computing power) the bearer of the private key can sign the document in such a way as to cause the signature to be valid with the matching public key.
One scheme we use works like this (where Hash
creates a "fingerprint" of a particular piece of data):
signature = F(private_key, Hash(data))
verification = F(public_key, signature)
if verification == Hash(data):
data signed by private_key associated with public_key
else:
data not signed by private_key associated with public_key
The assumption is that, without private_key
, one will pretty much be unable to generate signature
such that F(public_key, signature) == Hash(data)
. Our current understanding of mathematics suggest that we know of a few functions we can use for F
that are suitable for this purpose.