# Functions
ArbitraryDataFits checks if an arbtirary data first within a given size limit.
ComputeLegacyFulfillmentUnlockHash computes unlock hashes as they used to be computed, back when fulfillments had an unlock hash function.
CurrentTimestamp returns the current time as a Timestamp.
DefaultBlockchainInfo returns the blockchain information for the default (Rivine) blockchain, using the version which is set as part of the build process.
DefaultCurrencyUnits provides sane defaults for currency units.
DefaultNetworkName returns a sane default network name, based on the build.Release tag (NOTE that in most cases you do really want a user-approved default network name rather than this static value).
DefaultTransactionPoolConstants provides sane defaults for TransactionPool constants.
DevnetChainConstants provide sane defaults for a new devnet chain.
Ed25519PublicKey returns pk as a PublicKey, denoting its algorithm as Ed25519.
IntToTarget converts a big.Int to a Target.
NewAtomicSwapClaimFulfillment creates an unsigned atomic swap fulfillment, as to spend an output as a claim (meaning redeeming the money as the receiver).
NewAtomicSwapHashedSecret creates a new atomic swap hashed secret, using a pre-generated atomic swap secret.
NewAtomicSwapRefundFulfillment creates an unsigned atomic swap fulfillment, as to get a refund (meaning redeeming the money as the sender).
NewAtomicSwapSecret creates a new cryptographically secure atomic swap secret.
No description provided by the author
NewCondition creates an optional unlock condition, using an optionally given MarshalableUnlockCondition.
NewCurrency creates a Currency value from a big.Int.
NewCurrency64 creates a Currency value from a uint64.
NewDifficulty creates a Difficulty value from a big.Int.
NewEd25519PubKeyUnlockHash creates a new unlock hash of type UnlockTypePubKey, using a given public key which is assumed to be used in combination with the Ed25519 algorithm.
NewFulfillment creates an optional unlock fulfillment, using an optionally given MarshalableUnlockFulfillment.
NewMultiSignatureCondition creates a new multisig unlock condition, using the given unlockhashes as a representation of the identities who can unlock the output.
NewMultiSignatureFulfillment creates a new unsigned multisig fulfillment from the given public keys.
NewPubKeyUnlockHash creates a new unlock hash of type UnlockTypePubKey, using a given Sia-standard Public key.
NewSingleSignatureFulfillment creates an unsigned SingleSignatureFulfillment, using the given Public Key, which is to be matched with the private key given as part of the later sign call to the returned instance.
NewTarget makes a new target from a given difficulty with a given root depth.
NewTimeLockCondition creates a new TimeLockCondition.
NewTransactionShortID creates a new Transaction ShortID, combining a blockheight together with a transaction index.
NewUnlockHash creates a new unlock hash.
NewUnlockHashCondition creates a new unlock condition, using a (target) unlock hash as the condtion to be fulfilled.
CurrentTimestamp returns the offset based on the current time as a Timestamp.
RandomTransactionNonce creates a random Transaction nonce.
RatToTarget converts a big.Rat to a Target.
RegisterTransactionVersion registers or unregisters a given transaction version, by attaching a controller to it that helps define the behavior surrounding its state.
RegisterUnlockConditionType is used to register a condition type, by linking it to a constructor which constructs a fresh MarshalableUnlockCondition each time it is called.
RegisterUnlockFulfillmentType is used to register a fulfillment type, by linking it to a constructor which constructs a fresh MarshalableUnlockFulfillment each time it is called.
StandardnetChainConstants provide sane defaults for a new standard network chain.
TestnetChainConstants provide sane defaults for a new testnet chain.
TransactionFitsInABlock checks if the transaction is likely to fit in a block.
TransactionFollowsMinimumValues checks that all outputs adhere to the rules for the minimum allowed values.
ValidateNoDoubleSpendsWithinTransaction validates that no output has been spend twice, within the given transaction.
# Constants
AtomicSwapHashedSecretLen is the required/fixed length of an atomic swap hashed secret, the post-image of a secret.
AtomicSwapSecretLen is the required/fixed length of an atomic swap secret, the pre-image of an hashed secret.
BlockHeaderSize is the size, in bytes, of a block header.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ConditionTypeAtomicSwap defines the (new) atomic swap condition, replacing the legacy UnlockHash-based atomic swap condition.
ConditionTypeMultiSignature defines an unlock condition which can only be unlocked by multiple signatures.
ConditionTypeNil defines the nil condition, meaning it explicitly defines that the output can be used by anyone.
ConditionTypeTimeLock defines an unlock condition which locks another condition with a timestamp.
ConditionTypeUnlockHash defines a condition which is to be unlocked, by a fulfillment which produces the specified unlock hash.
FulfillmentTypeAtomicSwap defines both the legacy as well as the new AtomicSwapFulfillment.
FulfillmentTypeMultiSignature defines the multisig fulfillment, and is defined by a slice of public keys, and a slice of transaction-based signatures generated from the matching private keys.
FulfillmentTypeNil defines the nil fulfillment, and cannot fulfill any condition.
FulfillmentTypeSingleSignature defines the single signature fulfillment, and is defined by a public key, matching a private key which is used to produce the given transaction-based signature.
LockTimeMinTimestampValue defines the minimum value a LockTime can be in order to be interpreted as a (unix epoch seconds) timestamp, otherwise it is interpreted as the block height instead.
SignatureAlgoEd25519 identifies the Ed25519 signature Algorithm, the default (and only) algorithm supported by this chain.
SignatureAlgoNil identifies a nil SignatureAlgoType value.
No description provided by the author
TransactionNonceLength defines the length of a TransactionNonce.
TransactionVersionOne defines the new (default) transaction version, which deprecates and is based upon TransactionVersionZero.
TransactionVersionZero defines the initial (and currently only) version format.
UnlockHashChecksumSize is the size of the checksum used to verify human-readable addresses.
UnlockTypeAtomicSwap provides the unlocking of a more advanced condition, where before the TimeLock expired, the output can only go to the receiver, who has to give the secret in order to do so.
UnlockTypeMultiSig provides a condition in which the receiving party consists of multiple (possibly separate) identities.
UnlockTypeNil defines a nil (empty) Input Lock and is the default.
UnlockTypePubKey provides the standard and most simple unlock type.
# Variables
various errors that can be returned as result of a specific transaction validation.
various errors that can be returned as result of a specific transaction validation.
various errors that can be returned as result of a specific transaction validation.
various errors that can be returned as result of a specific transaction validation.
ErrFulfillmentDoubleSign is returned when a fulfillment that is already signed, is attempted to be signed once again.
ErrInsufficientSignatures is an error returned when a multisig condition is attempted to be fulfilled, but the fulfillment does not (yet) have the required amount of signatures.
ErrInvalidPreImageSha256 is returned as the result of a failed fulfillment, in case the condition-defined hashed secret (pre image) does not match the fulfillment-defined secret (image).
ErrInvalidRedeemer is returned in case the redeemer, one of two parties, is the wrong redeemer due to the timelock rule.
These Specifiers are used internally when calculating a type's ID.
ErrFrivolousSignature = errors.New("transaction contains a frivolous signature")ErrInvalidPubKeyIndex = errors.New("transaction contains a signature that points to a nonexistent public key").
various errors that can be returned as result of a specific transaction validation.
ErrNegativeCurrency is the error that is returned if performing an operation results in a negative currency.
ErrNegativeDifficulty is the error that is returned if performing an operation results in a negative difficulty.
No description provided by the author
ErrNilFulfillmentType is returned by pretty much any method of the NilFullfilment type, as it is not to be used for anything.
various errors that can be returned as result of a specific transaction validation.
ErrPrematureRefund is an error returned when a refund is requested for a contract, while the contract is still active, and thus not yet expired.
various errors that can be returned as result of a specific transaction validation.
These Specifiers are used internally when calculating a type's ID.
various errors that can be returned as result of a specific transaction validation.
ErrUint64Overflow is the error that is returned if converting to a unit64 would cause an overflow.
ErrUnauthorizedPubKey is an error returned when a public key used in a multisig fulfillment is not allowed to unlock the input (as the associated pubkey hash is not listed in the conditions unlockhashes).
ErrUnexpectedExtensionType is an error returned by a transaction controller, in case it expects an extension type it didn't expect.
ErrUnexpectedUnlockCondition is returned when a fulfillment is given an UnlockCondition of an unexpected type.
ErrUnexpectedUnlockFulfillment is returned when an UnlockCondition is given an UnlockFulfillment of an unexpected type.
ErrUnexpectedUnlockType is returned when an unlock hash has the wrong type.
ErrUnknownConditionType is returned to define the non-standardness of an UnknownUnlockCondition.
ErrUnknownFulfillmentType is returned to define the non-standardness of an UnknownUnlockFulfillment.
ErrUnknownSignAlgorithmType is an error returned in case one tries to sign using an unknown signing algorithm type.
ErrUnknownTransactionType is returned when an unknown transaction version/type was encountered.
ErrMissingSignatures = errors.New("transaction has inputs with missing signatures")ErrPrematureSignature = errors.New("timelock on signature has not expired")ErrPublicKeyOveruse = errors.New("public key was used multiple times while signing transaction")ErrSortedUniqueViolation = errors.New("sorted unique violation").
various errors that can be returned as result of a specific transaction validation.
No description provided by the author
These Specifiers enumerate the string versions of the types of signatures that are recognized by this implementation.
These Specifiers enumerate the string versions of the types of signatures that are recognized by this implementation.
These Specifiers are used internally when calculating a type's ID.
These Specifiers are used internally when calculating a type's ID.
These Specifiers are used internally when calculating a type's ID.
These Specifiers are used internally when calculating a type's ID.
These Specifiers are used internally when calculating a type's ID.
These Specifiers are used internally when calculating a type's ID.
No description provided by the author
ZeroCurrency defines a currency of value zero.
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
BlockchainInfo contains information about a blockchain.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ChainConstants is a utility struct which groups together the chain configuration.
No description provided by the author
No description provided by the author
No description provided by the author
CommonTransactionExtensionData collects the common-understood Tx Extension data as a single struct.
No description provided by the author
CurrencyUnits defines the units used for the different kind of currencies.
Standard Transaction Controller implementations.
No description provided by the author
DisabledTransactionController is used for transaction versions that are disabled but still need to be JSON decodable.
The interfaces and input parameter structs that make the unlock conditions tick.
The interfaces and input parameter structs that make the unlock conditions tick.
The interfaces and input parameter structs that make the unlock conditions tick.
The interfaces and input parameter structs that make the unlock conditions tick.
No description provided by the author
No description provided by the author
Standard Transaction Controller implementations.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
StdClock is an implementation of Clock that retrieves the current time using the system time.
No description provided by the author
No description provided by the author
The interfaces and input parameter structs that make the unlock conditions tick.
No description provided by the author
TransactionPoolConstants defines the constants used by the TransactionPool.
No description provided by the author
The interfaces and input parameter structs that make the unlock conditions tick.
The interfaces and input parameter structs that make the unlock conditions tick.
The interfaces and input parameter structs that make the unlock conditions tick.
No description provided by the author
No description provided by the author
No description provided by the author
The interfaces and input parameter structs that make the unlock conditions tick.
# Interfaces
Clock allows clients to retrieve the current time.
The interfaces and input parameter structs that make the unlock conditions tick.
The interfaces and input parameter structs that make the unlock conditions tick.
The interfaces and input parameter structs that make the unlock conditions tick.
optional interfaces which a TransactionController can implement as well, in order to customize a version even more.
No description provided by the author
optional interfaces which a TransactionController can implement as well, in order to customize a version even more.
optional interfaces which a TransactionController can implement as well, in order to customize a version even more.
optional interfaces which a TransactionController can implement as well, in order to customize a version even more.
optional interfaces which a TransactionController can implement as well, in order to customize a version even more.
The interfaces and input parameter structs that make the unlock conditions tick.
The interfaces and input parameter structs that make the unlock conditions tick.
The interfaces and input parameter structs that make the unlock conditions tick.
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The interfaces and input parameter structs that make the unlock conditions tick.
The interfaces and input parameter structs that make the unlock conditions tick.
Constuctors used to construct marshalable unlock conditions and fulfillments.
Constuctors used to construct marshalable unlock conditions and fulfillments.
The interfaces and input parameter structs that make the unlock conditions tick.
No description provided by the author
SignatureAlgoType identifies a signature algorithm as a single byte.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TransactionNonce is a nonce used to ensure the uniqueness of an otherwise potentially non-unique Tx.
TransactionShortID is another way to uniquely identify a transaction, just as the default hash-based (32-byte) ID uniquely identifies a transaction as well.
No description provided by the author
No description provided by the author
No description provided by the author
The interfaces and input parameter structs that make the unlock conditions tick.