SHA-256 hash signer type is used for Hash(x) alternate signature type. Here is how it works:
- You pick a secret
x
- there are no restrictions on the value of x
but for security reasons it should be a random 256 bit value.
- You calculate the SHA-256 hash of
x
and add it (the hash of x
) as a signer to the account using set_options
operation.
Let's say that master key weight is equal 1
, SHA-256 hash signer weight is also 1
but thresholds on the account are set to 2
. Normally (with a single ed25519 signer) you only need to attach a signature generated using the private key of the account. But with SHA-256 signer you also need to know the preimage of the hash (so basically you need to know x
that when hashed: SHA-256(x)
gives a signer on that account).
This allows you to implement interesting concepts on Stellar, including lighting network.