 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
This section is empty.
Variables ¶
      View Source
      
  var ( // ErrInvalidScriptVersion represents an error case where an asset input // commits to an invalid script version. ErrInvalidScriptVersion = tapscript.ErrInvalidScriptVersion // ErrInputMismatch represents an error case where an asset's set of // inputs mismatch the set provided to the virtual machine. ErrInputMismatch = tapscript.ErrInputMismatch // ErrNoInputs represents an error case where an asset undergoing a // state transition does not have any or a specific input required. ErrNoInputs = tapscript.ErrNoInputs )
Wrap select errors related to virtual TX handling to provide more context to callers.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
	// contains filtered or unexported fields
}
    Engine is a virtual machine capable of executing and verifying Taproot asset state transitions.
func New ¶
func New(newAsset *asset.Asset, splitAssets []*commitment.SplitAsset, prevAssets commitment.InputSet) (*Engine, error)
New returns a new virtual machine capable of executing and verifying Taproot Asset state transitions.
type Error ¶
Error represents an error returned by the Taproot Asset VM.
func (Error) Error ¶
Error returns a human readable version of the error. This implements the main error interface.
type ErrorKind ¶
type ErrorKind uint8
ErrorKind uniquely identifies the kind of Error returned by the Taproot Asset VM.
const ( // ErrNoSplitCommitment represents an error case where a split // commitment root is not present when required. ErrNoSplitCommitment ErrorKind = iota // ErrIDMismatch represents an error case where an asset, or asset // split, do not match the asset genesis of their inputs. ErrIDMismatch // ErrTypeMismatch represents an error case where an asset, or asset // split, do not match the asset type of their inputs. ErrTypeMismatch // ErrScriptKeyMismatch represents an error case where an the script key // of an asset input does not match the one of the input provided to the // virtual machine. ErrScriptKeyMismatch // ErrAmountMismatch represents an error case where an asset, along with // its splits, do not match the total asset amount of their inputs. ErrAmountMismatch // ErrInvalidSigHashFlag represents an error case where an asset witness // contains signatures created with any sighash flag other than // SIGHASH_DEFAULT. ErrInvalidSigHashFlag // ErrInvalidGenesisStateTransition represents an error case where an // asset has a valid genesis witness but the virtual machine was // provided asset inputs. ErrInvalidGenesisStateTransition // ErrInvalidTransferWitness represents an error case where an asset // input has a malformed or invalid transfer witness as deemed by the // virtual machine. ErrInvalidTransferWitness // ErrInvalidSplitAssetType represents an error case where an asset // split type does not match the root asset. ErrInvalidSplitAssetType // ErrInvalidSplitCommitmentWitness represents an error case where an // asset input has a malformed split commitment witness. ErrInvalidSplitCommitmentWitness // ErrInvalidSplitCommitmentProof represents an error case where an // asset split has an invalid split commitment proof. ErrInvalidSplitCommitmentProof // ErrInvalidRootAsset represents an error case where the root asset // of an asset split has zero value but a spendable script key. ErrInvalidRootAsset )
type ErrorTestCase ¶ added in v0.3.0
type ErrorTestCase struct {
	Asset    *asset.TestAsset        `json:"asset"`
	SplitSet commitment.TestSplitSet `json:"split_set"`
	InputSet commitment.TestInputSet `json:"input_set"`
	Error    string                  `json:"error"`
	Comment  string                  `json:"comment"`
}
    type TestVectors ¶ added in v0.3.0
type TestVectors struct {
	ValidTestCases []*ValidTestCase `json:"valid_test_cases"`
	ErrorTestCases []*ErrorTestCase `json:"error_test_cases"`
}
    type ValidTestCase ¶ added in v0.3.0
type ValidTestCase struct {
	Asset    *asset.TestAsset        `json:"asset"`
	SplitSet commitment.TestSplitSet `json:"split_set"`
	InputSet commitment.TestInputSet `json:"input_set"`
	Comment  string                  `json:"comment"`
}
     Click to show internal directories. 
   Click to hide internal directories.