What's the difference between these elements? and what is the importance of each, and the relation between them? What is generated from which? and how are these elements generated / created?
What's the difference between these elements? and what is the importance of each, and the relation between them? What is generated from which? and how are these elements generated / created?
The difference depends on the context.
Seed:
The seed is simply a long set of evenly random bytes used to create the keys. It can be shown in text format, such as the mnemonic phrase , but this is neither required nor a requirement.
If you have a seeed, any derivation of this seed, with the same value, will be fixed. Crypto-coin wallets generate new keys whenever they use a previous address, the reasons for this are out of the question .
In this way we need a fixed way of generating infinite keys, so the seed is used, because we can do F (seed, 1), F (seed, 2), F (seed, n). The results will always be the same for n
and seed
, but having only the result of them does not tell you what seed
and n
used.
Hierarchical Deterministic Wallets is more complex than this, due to the existence of the Public Master Key, including making you vulnerable . But, ignoring these requirements, a seed can be used as HASH(seed + n)
or HMAC(seed, n)
, including this is part of the construction of HD .
Keys:
Cryptotomes use DSA, in the case of Bitcoin (and most of the others) ECDSA is used with the curve Secp256k1. If you are able to sign the transaction with a key that matches the address, then you can move the funds.
So you need to create one (or more) private key. Creation may or may not use seed derivation. Each transaction you make will have to use the private key to sign it.
Address:
The address is simply a way to send the funds to someone who in the future will prove to be the owner of the address. But you do not need to use it in two ways.
This is more complex because each cryptoman has its own shape. I will use Bitcoin as an example, in specific.
In it you have P2SH and P2PKH. The first one says you want to pay for a ScriptHash, every Bitcoin transaction has Script
, where you use OPCodes
.
So, you pay for the Script hash. It can be a multi-sig, that is, multiple people must sign it for the transaction to be valid. Therefore, when you send to an address of this type, the owner of the wallet will send the Script and send the signatures. The check is made by checking whether the script matches the signatures (and other Script definitions) and whether the hashing of the script matches the address in question.
In general, you will use P2PKH, which is simply an address with the public key hash. In this case the owner of the wallet can prove ownership by informing you by signing and sending the public key, if everything matches you have ownership.
The format of the address varies, in case Bitcoin uses Base58, but this is not general and is not the case. The addresses also have a checksum, to avoid typos, in case Bitcoin is some bytes of the SHA256.
You can send funds directly through the public key (not the address), which is then a P2PK (not P2PKH), and you can also burn your coins using OP_RETURN
, where you do not send it to anyone. These are the two ways I know, not to use it.