Methods
setPreimage(preimage)
Provide a preimage.
The preimage is the only input to a SHA256 hashlock condition.
Note that the preimage should contain enough (pseudo-random) data in order to be difficult to guess. A sufficiently large secret seed and a cryptographically secure pseudo-random number generator (CSPRNG) can be used to avoid having to store each individual preimage.
Parameters:
Name | Type | Description |
---|---|---|
preimage |
Buffer | Secret data that will be hashed to form the condition. |
- Source:
validate(Message) → {Boolean}
Validate this fulfillment.
For a SHA256 hashlock fulfillment, successful parsing implies that the fulfillment is valid, so this method is a no-op.
Parameters:
Name | Type | Description |
---|---|---|
Message |
Buffer | (ignored in this condition type) |
- Source:
Returns:
Validation result
- Type
- Boolean