# Functions
AnyoneCanSpend returns a policy that has no requirements.
CurrentTimestamp returns the current time, rounded to the nearest second.
DecodePtr decodes a pointer to an object that implements DecoderFrom.
DecodePtrCast decodes a pointer to an object by casting it to V.
DecodeSlice decodes a length-prefixed slice of type T, containing values read from the decoder.
DecodeSliceCast decodes a length-prefixed slice of type T, casting through type V.
DecodeSliceFn decodes a length-prefixed slice of type T, calling an explicit function to decode each element.
EncodePtr encodes a pointer to an object that implements EncoderTo.
EncodePtrCast encodes a pointer to an object by casting it to V.
EncodeSlice encodes a slice of objects that implement EncoderTo.
EncodeSliceCast encodes a slice of objects by casting them to V.
EncodeSliceFn encodes a slice of objects by calling an explicit function to encode each element.
GeneratePrivateKey creates a new private key from a secure entropy source.
HashBytes computes the hash of b using Sia's hash function.
NewBufDecoder returns a Decoder for the provided byte slice.
NewCurrency returns the Currency value (lo,hi).
NewCurrency64 converts c to a Currency value.
NewDecoder returns a Decoder that wraps the provided stream.
NewEncoder returns an Encoder that wraps the provided stream.
NewHasher returns a new Hasher instance.
NewPrivateKeyFromSeed calculates a private key from a seed.
NewSpecifier returns a specifier containing the provided name.
ParseAddress parses an address from a prefixed hex encoded string.
ParseChainIndex parses a chain index from a string.
ParseCurrency parses s as a Currency value.
ParseSpendPolicy parses a spend policy from a string.
PolicyAbove returns a policy that requires the input to be spent above a given block height.
PolicyAfter returns a policy that requires the input to be spent after a given timestamp.
PolicyHash returns a policy that requires the input to reveal a SHA256 hash preimage.
PolicyOpaque returns a policy with the same address as p, but without its semantics.
PolicyPublicKey returns a policy that requires the input to be signed by a given key.
PolicyThreshold returns a policy that requires at least N sub-policies to be satisfied.
Siacoins returns a Currency value representing n siacoins.
StandardAddress returns the standard v2 Address derived from pk.
StandardUnlockConditions returns the standard unlock conditions for pk.
StandardUnlockHash returns the standard UnlockHash derived from pk.
# Constants
HostContractIndex defines the index of the host's output and public key in a FileContract.
MaxRevisionNumber is used to finalize a FileContract.
RenterContractIndex defines the index of the renter's output and public key in a FileContract.
UnassignedLeafIndex is a sentinel value used as the LeafIndex of StateElements that have not been added to the accumulator yet.
# Variables
10^24.
MaxCurrency represents the largest possible value for the Currency type.
Various specifiers.
Various specifiers.
Various specifiers.
Various specifiers.
Various specifiers.
Various specifiers.
Various specifiers.
VoidAddress is an address whose signing key does not exist.
ZeroCurrency represents zero base units.
# Structs
An Attestation associates a key-value pair with an identity.
An AttestationElement is a record of an Attestation within the state accumulator.
A Block is a timestamped set of transactions, immutably linked to a previous block, secured by proof-of-work.
A BlockHeader is the preimage of a Block's ID.
A ChainIndex pairs a block's height with its ID.
A ChainIndexElement is a record of a ChainIndex within the state accumulator.
CoveredFields indicates which fields of a transaction are covered by a signature.
Currency represents a quantity of hastings as an unsigned 128-bit number.
A Decoder reads values from an underlying stream.
An Encoder writes Sia objects to an underlying stream.
A FileContract is a storage agreement between a renter and a host.
A FileContractElement is a record of a FileContract within the state accumulator.
A FileContractRevision updates the state of an existing file contract.
A FoundationAddressUpdate updates the primary and failsafe Foundation subsidy addresses.
A Hasher streams objects into an instance of Sia's hash function.
PolicyTypeThreshold requires at least N sub-policies to be satisfied.
A SatisfiedPolicy pairs a policy with the signatures and preimages that satisfy it.
A SiacoinElement is a record of a SiacoinOutput within the state accumulator.
A SiacoinInput spends an unspent SiacoinOutput in the UTXO set by revealing and satisfying its unlock conditions.
A SiacoinOutput is the recipient of some of the siacoins spent in a transaction.
A SiafundElement is a record of a SiafundOutput within the state accumulator.
A SiafundInput spends an unspent SiafundOutput in the UTXO set by revealing and satisfying its unlock conditions.
A SiafundOutput is the recipient of some of the siafunds spent in a transaction.
A SpendPolicy describes the conditions under which an input may be spent.
A StateElement is a generic element within the state accumulator.
A StorageProof asserts the presence of a randomly-selected leaf within the Merkle tree of a FileContract's data.
A Transaction effects a change of blockchain state.
A TransactionSignature signs transaction data.
UnlockConditions specify the conditions for spending an output or revising a file contract.
An UnlockKey can provide one of the signatures required by a set of UnlockConditions.
V2BlockData contains additional fields not present in v1 blocks.
A V2FileContract is a storage agreement between a renter and a host.
A V2FileContractElement is a record of a V2FileContract within the state accumulator.
A V2FileContractExpiration resolves an expired contract.
A V2FileContractRenewal renews a file contract.
A V2FileContractResolution closes a v2 file contract's payment channel.
A V2FileContractRevision updates the state of an existing file contract.
A V2SiacoinInput spends an unspent SiacoinElement in the state accumulator by revealing its public key and signing the transaction.
A V2SiafundInput spends an unspent SiafundElement in the state accumulator by revealing its public key and signing the transaction.
A V2StorageProof asserts the presence of a randomly-selected leaf within the Merkle tree of a V2FileContract's data.
A V2Transaction effects a change of blockchain state.
# Interfaces
A DecoderFrom can decode itself from a stream via a Decoder.
An EncoderTo can encode itself to a stream via an Encoder.
V2FileContractResolutionType enumerates the types of file contract resolution.
# Type aliases
An Address is the hash of a set of UnlockConditions.
An AttestationID uniquely identifies an attestation.
A BlockID uniquely identifies a block.
DecoderFunc implements types.DecoderTo with a function.
An ElementID identifies a generic element within the state accumulator.
EncoderFunc implements types.EncoderTo with a function.
A FileContractID uniquely identifies a file contract.
A Hash256 is a generic 256-bit cryptographic hash.
PolicyTypeAbove requires the input to be spent above a given block height.
PolicyTypeAfter requires the input to be spent after a given timestamp.
PolicyTypeHash requires the input to reveal a SHA256 hash preimage.
PolicyTypeOpaque is the opaque hash of a policy.
PolicyTypePublicKey requires the input to be signed by a given key.
PolicyTypeUnlockConditions reproduces the requirements imposed by Sia's original "UnlockConditions" type.
A PrivateKey is an Ed25519 private key.
A PublicKey is an Ed25519 public key.
A SiacoinOutputID uniquely identifies a siacoin output.
A SiafundOutputID uniquely identifies a siafund output.
A Signature is an Ed25519 signature.
A Specifier is a fixed-size, 0-padded identifier.
A TransactionID uniquely identifies a transaction.
V1Block provides v1 encoding for Block.
V1Currency provides v1 encoding for Currency.
V1SiacoinOutput provides v1 encoding for SiacoinOutput.
V1SiafundOutput provides v1 encoding for SiafundOutput.
V2Block provides v2 encoding for Block.
V2Currency provides v2 encoding for Currency.
V2SiacoinOutput provides v2 encoding for SiacoinOutput.
V2SiafundOutput provides v2 encoding for SiafundOutput.
V2TransactionSemantics is a helper type that provides a "semantic encoding" of a v2 transaction, for use in computing IDs and signature hashes.
V2TransactionsMultiproof is a slice of V2Transactions whose Merkle proofs are encoded as a single multiproof.