Documentation ¶
Index ¶
- Variables
- type Credential
- type Factory
- type Fx
- func (fx *Fx) Bootstrapped() error
- func (fx *Fx) Bootstrapping() error
- func (fx *Fx) CreateOutput(amount uint64, ownerIntf interface{}) (interface{}, error)
- func (fx *Fx) Initialize(vmIntf interface{}) error
- func (fx *Fx) InitializeVM(vmIntf interface{}) error
- func (fx *Fx) VerifyCredentials(tx Tx, in *Input, cred *Credential, out *OutputOwners) error
- func (fx *Fx) VerifyOperation(txIntf, opIntf, credIntf interface{}, utxosIntf []interface{}) error
- func (fx *Fx) VerifyPermission(txIntf, inIntf, credIntf, ownerIntf interface{}) error
- func (fx *Fx) VerifySpend(tx Tx, in *TransferInput, cred *Credential, utxo *TransferOutput) error
- func (fx *Fx) VerifyTransfer(txIntf, inIntf, credIntf, utxoIntf interface{}) error
- type Input
- type Keychain
- func (kc *Keychain) Add(key *crypto.PrivateKeySECP256K1R)
- func (kc Keychain) Addresses() ids.ShortSet
- func (kc Keychain) Get(id ids.ShortID) (*crypto.PrivateKeySECP256K1R, bool)
- func (kc *Keychain) Match(owners *OutputOwners, time uint64) ([]uint32, []*crypto.PrivateKeySECP256K1R, bool)
- func (kc *Keychain) New() (*crypto.PrivateKeySECP256K1R, error)
- func (kc *Keychain) PrefixedString(prefix string) string
- func (kc *Keychain) Spend(out verify.Verifiable, time uint64) (verify.Verifiable, []*crypto.PrivateKeySECP256K1R, error)
- func (kc *Keychain) String() string
- type MintOperation
- type MintOutput
- type OutputOwners
- type TestTx
- type TestVM
- type TransferInput
- type TransferOutput
- type Tx
- type VM
Constants ¶
This section is empty.
Variables ¶
var (
ID = ids.ID{'s', 'e', 'c', 'p', '2', '5', '6', 'k', '1', 'f', 'x'}
)
ID that this Fx uses when labeled
Functions ¶
This section is empty.
Types ¶
type Credential ¶
type Credential struct {
Sigs [][crypto.SECP256K1RSigLen]byte `serialize:"true" json:"signatures"`
}
Credential ...
func (*Credential) MarshalJSON ¶ added in v0.8.0
func (cr *Credential) MarshalJSON() ([]byte, error)
MarshalJSON marshals [cr] to JSON The string representation of each signature is created using the hex formatter
type Fx ¶
type Fx struct { VM VM SECPFactory crypto.FactorySECP256K1R // contains filtered or unexported fields }
Fx describes the secp256k1 feature extension
func (*Fx) CreateOutput ¶ added in v0.8.0
CreateOutput creates a new output with the provided control group worth the specified amount
func (*Fx) VerifyCredentials ¶
func (fx *Fx) VerifyCredentials(tx Tx, in *Input, cred *Credential, out *OutputOwners) error
VerifyCredentials ensures that the output can be spent by the input with the credential. A nil return values means the output can be spent.
func (*Fx) VerifyOperation ¶
VerifyOperation ...
func (*Fx) VerifyPermission ¶ added in v0.8.0
VerifyPermission returns nil iff [credIntf] proves that [controlGroup] assents to [txIntf]
func (*Fx) VerifySpend ¶
func (fx *Fx) VerifySpend(tx Tx, in *TransferInput, cred *Credential, utxo *TransferOutput) error
VerifySpend ensures that the utxo can be sent to any address
func (*Fx) VerifyTransfer ¶
VerifyTransfer ...
type Input ¶
type Input struct { // This input consumes an output, which has an owner list. // This input will be spent with a list of signatures. // SignatureList[i] is the signature of OwnerList[i] SigIndices []uint32 `serialize:"true" json:"signatureIndices"` }
Input ...
type Keychain ¶
type Keychain struct { // These can be used to iterate over. However, they should not be modified externally. Addrs ids.ShortSet Keys []*crypto.PrivateKeySECP256K1R // contains filtered or unexported fields }
Keychain is a collection of keys that can be used to spend outputs
func (*Keychain) Add ¶
func (kc *Keychain) Add(key *crypto.PrivateKeySECP256K1R)
Add a new key to the key chain
func (*Keychain) Match ¶
func (kc *Keychain) Match(owners *OutputOwners, time uint64) ([]uint32, []*crypto.PrivateKeySECP256K1R, bool)
Match attempts to match a list of addresses up to the provided threshold
func (*Keychain) New ¶
func (kc *Keychain) New() (*crypto.PrivateKeySECP256K1R, error)
New returns a newly generated private key
func (*Keychain) PrefixedString ¶
PrefixedString returns the key chain as a string representation with [prefix] added before every line.
func (*Keychain) Spend ¶
func (kc *Keychain) Spend(out verify.Verifiable, time uint64) (verify.Verifiable, []*crypto.PrivateKeySECP256K1R, error)
Spend attempts to create an input
type MintOperation ¶
type MintOperation struct { MintInput Input `serialize:"true" json:"mintInput"` MintOutput MintOutput `serialize:"true" json:"mintOutput"` TransferOutput TransferOutput `serialize:"true" json:"transferOutput"` }
MintOperation ...
type MintOutput ¶
type MintOutput struct {
OutputOwners `serialize:"true"`
}
MintOutput ...
func (*MintOutput) VerifyState ¶ added in v0.8.0
func (out *MintOutput) VerifyState() error
VerifyState ...
type OutputOwners ¶
type OutputOwners struct { Locktime uint64 `serialize:"true" json:"locktime"` Threshold uint32 `serialize:"true" json:"threshold"` Addrs []ids.ShortID `serialize:"true" json:"addresses"` }
OutputOwners ...
func (*OutputOwners) Addresses ¶
func (out *OutputOwners) Addresses() [][]byte
Addresses returns the addresses that manage this output
func (*OutputOwners) AddressesSet ¶ added in v0.8.0
func (out *OutputOwners) AddressesSet() ids.ShortSet
AddressesSet returns addresses as a set
func (*OutputOwners) Equals ¶
func (out *OutputOwners) Equals(other *OutputOwners) bool
Equals returns true if the provided owners create the same condition
func (*OutputOwners) VerifyState ¶ added in v0.8.0
func (out *OutputOwners) VerifyState() error
VerifyState ...
type TestVM ¶
TestVM is a minimal implementation of a VM
func (*TestVM) CodecRegistry ¶ added in v1.0.6
type TransferInput ¶
TransferInput ...
func (*TransferInput) Amount ¶
func (in *TransferInput) Amount() uint64
Amount returns the quantity of the asset this input produces
func (*TransferInput) Verify ¶
func (in *TransferInput) Verify() error
Verify this input is syntactically valid
type TransferOutput ¶
type TransferOutput struct { Amt uint64 `serialize:"true" json:"amount"` OutputOwners `serialize:"true"` }
TransferOutput ...
func (*TransferOutput) Amount ¶
func (out *TransferOutput) Amount() uint64
Amount returns the quantity of the asset this output consumes
func (*TransferOutput) Owners ¶ added in v0.8.0
func (out *TransferOutput) Owners() interface{}
Owners ...
func (*TransferOutput) VerifyState ¶ added in v0.8.0
func (out *TransferOutput) VerifyState() error
VerifyState ...