Documentation ¶
Overview ¶
Package hashlock implements token locking.
> A Hashlock is a type of encumbrance that restricts the spending of an output > until a specified piece of data is publicly revealed. Hashlocks have the useful > property that once any hashlock is opened publicly, any other hashlock secured > using the same key can also be opened. This makes it possible to create > multiple outputs that are all encumbered by the same hashlock and which all > become spendable at the same time. Hashlocks have been used independently (see > below) but are most commonly described as part of a system such as Hashed > Timelock Contracts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PreimageCondition ¶
PreimageCondition calculates a sha256 hash and then
Types ¶
type Authenticate ¶
type Authenticate struct{}
Authenticate implements x.Authenticator and provides authentication based on public-key signatures.
func (Authenticate) GetConditions ¶
func (a Authenticate) GetConditions(ctx weave.Context) []weave.Condition
GetConditions returns which preimages have authorized the current Context. May be nil
func (Authenticate) HasAddress ¶
HasAddress returns true if the given address had the preimage permission in the current Context.
type Decorator ¶
type Decorator struct{}
Decorator adds permissions to context based on preimages