Versions in this module Expand all Collapse all v0 v0.5.0 Mar 23, 2021 Changes in this version + func BaseDepositEquation(dataSize32 uint32, numEpochs32 uint32) (*uint256.Uint256, error) + func MakeUTXOID(txHash []byte, idx uint32) []byte + func NumEpochsEquation(dataSize32 uint32, depositOrig *uint256.Uint256) (uint32, error) + func RewardDepositEquation(depositOrig *uint256.Uint256, dataSize32 uint32, epochInitial uint32, ...) (*uint256.Uint256, error) + type ASPreImage struct + ChainID uint32 + Exp uint32 + IssuedAt uint32 + Owner *AtomicSwapOwner + TXOutIdx uint32 + Value *uint256.Uint256 + func (b *ASPreImage) IsExpired(currentHeight uint32) (bool, error) + func (b *ASPreImage) MarshalBinary() ([]byte, error) + func (b *ASPreImage) MarshalCapn(seg *capnp.Segment) (mdefs.ASPreImage, error) + func (b *ASPreImage) PreHash() ([]byte, error) + func (b *ASPreImage) SignAsAlternate(msg []byte, signer *crypto.Secp256k1Signer, hashKey []byte) (*AtomicSwapSignature, error) + func (b *ASPreImage) SignAsPrimary(msg []byte, signer *crypto.Secp256k1Signer, hashKey []byte) (*AtomicSwapSignature, error) + func (b *ASPreImage) UnmarshalBinary(data []byte) error + func (b *ASPreImage) UnmarshalCapn(bc mdefs.ASPreImage) error + func (b *ASPreImage) ValidateSignature(currentHeight uint32, msg []byte, sig *AtomicSwapSignature) error + type AtomicSwap struct + ASPreImage *ASPreImage + TxHash []byte + func (b *AtomicSwap) ChainID() (uint32, error) + func (b *AtomicSwap) Exp() (uint32, error) + func (b *AtomicSwap) GenericOwner() (*Owner, error) + func (b *AtomicSwap) IsExpired(currentHeight uint32) (bool, error) + func (b *AtomicSwap) IssuedAt() (uint32, error) + func (b *AtomicSwap) MakeTxIn() (*TXIn, error) + func (b *AtomicSwap) MarshalBinary() ([]byte, error) + func (b *AtomicSwap) MarshalCapn(seg *capnp.Segment) (mdefs.AtomicSwap, error) + func (b *AtomicSwap) Owner() (*AtomicSwapOwner, error) + func (b *AtomicSwap) PreHash() ([]byte, error) + func (b *AtomicSwap) SetTXOutIdx(idx uint32) error + func (b *AtomicSwap) SetTxHash(txHash []byte) error + func (b *AtomicSwap) SignAsAlternate(txIn *TXIn, signer *crypto.Secp256k1Signer, hashKey []byte) error + func (b *AtomicSwap) SignAsPrimary(txIn *TXIn, signer *crypto.Secp256k1Signer, hashKey []byte) error + func (b *AtomicSwap) TXOutIdx() (uint32, error) + func (b *AtomicSwap) UTXOID() ([]byte, error) + func (b *AtomicSwap) UnmarshalBinary(data []byte) error + func (b *AtomicSwap) UnmarshalCapn(bc mdefs.AtomicSwap) error + func (b *AtomicSwap) ValidateSignature(currentHeight uint32, txIn *TXIn) error + func (b *AtomicSwap) Value() (*uint256.Uint256, error) + type AtomicSwapOwner struct + AlternateOwner *AtomicSwapSubOwner + HashLock []byte + PrimaryOwner *AtomicSwapSubOwner + SVA SVA + func (aso *AtomicSwapOwner) AlternateAccount() ([]byte, error) + func (aso *AtomicSwapOwner) MarshalBinary() ([]byte, error) + func (aso *AtomicSwapOwner) New(priOwnerAcct []byte, altOwnerAcct []byte, hashKey []byte) error + func (aso *AtomicSwapOwner) NewFromOwner(priOwner *Owner, altOwner *Owner, hashKey []byte) error + func (aso *AtomicSwapOwner) PrimaryAccount() ([]byte, error) + func (aso *AtomicSwapOwner) SignAsAlternate(msg []byte, signer *crypto.Secp256k1Signer, hashKey []byte) (*AtomicSwapSignature, error) + func (aso *AtomicSwapOwner) SignAsPrimary(msg []byte, signer *crypto.Secp256k1Signer, hashKey []byte) (*AtomicSwapSignature, error) + func (aso *AtomicSwapOwner) UnmarshalBinary(o []byte) error + func (aso *AtomicSwapOwner) Validate() error + func (aso *AtomicSwapOwner) ValidateSignature(msg []byte, sig *AtomicSwapSignature, isExpired bool) error + type AtomicSwapSignature struct + CurveSpec constants.CurveSpec + HashKey []byte + SVA SVA + Signature []byte + SignerRole SignerRole + func (onr *AtomicSwapSignature) MarshalBinary() ([]byte, error) + func (onr *AtomicSwapSignature) UnmarshalBinary(signature []byte) error + func (onr *AtomicSwapSignature) Validate() error + type AtomicSwapSubOwner struct + Account []byte + CurveSpec constants.CurveSpec + func (asso *AtomicSwapSubOwner) MarshalBinary() ([]byte, error) + func (asso *AtomicSwapSubOwner) NewFromOwner(o *Owner) error + func (asso *AtomicSwapSubOwner) UnmarshalBinary(o []byte) ([]byte, error) + func (asso *AtomicSwapSubOwner) Validate() error + func (asso *AtomicSwapSubOwner) ValidateSignature(msg []byte, sig *AtomicSwapSignature) error + type DSLinker struct + DSPreImage *DSPreImage + TxHash []byte + func (b *DSLinker) ChainID() (uint32, error) + func (b *DSLinker) EpochOfExpiration() (uint32, error) + func (b *DSLinker) Index() ([]byte, error) + func (b *DSLinker) IssuedAt() (uint32, error) + func (b *DSLinker) MarshalBinary() ([]byte, error) + func (b *DSLinker) MarshalCapn(seg *capnp.Segment) (mdefs.DSLinker, error) + func (b *DSLinker) Owner() (*DataStoreOwner, error) + func (b *DSLinker) PreHash() ([]byte, error) + func (b *DSLinker) RawData() ([]byte, error) + func (b *DSLinker) RemainingValue(currentHeight uint32) (*uint256.Uint256, error) + func (b *DSLinker) SetTXOutIdx(idx uint32) error + func (b *DSLinker) TXOutIdx() (uint32, error) + func (b *DSLinker) UTXOID() ([]byte, error) + func (b *DSLinker) UnmarshalBinary(data []byte) error + func (b *DSLinker) UnmarshalCapn(bc mdefs.DSLinker) error + func (b *DSLinker) ValidatePreSignature(msg []byte, sig *DataStoreSignature) error + func (b *DSLinker) ValidateSignature(currentHeight uint32, msg []byte, sig *DataStoreSignature) error + func (b *DSLinker) Value() (*uint256.Uint256, error) + type DSPreImage struct + ChainID uint32 + Deposit *uint256.Uint256 + Index []byte + IssuedAt uint32 + Owner *DataStoreOwner + RawData []byte + TXOutIdx uint32 + func (b *DSPreImage) EpochOfExpiration() (uint32, error) + func (b *DSPreImage) IsExpired(currentHeight uint32) (bool, error) + func (b *DSPreImage) MarshalBinary() ([]byte, error) + func (b *DSPreImage) MarshalCapn(seg *capnp.Segment) (mdefs.DSPreImage, error) + func (b *DSPreImage) PreHash() ([]byte, error) + func (b *DSPreImage) RemainingValue(currentHeight uint32) (*uint256.Uint256, error) + func (b *DSPreImage) UnmarshalBinary(data []byte) error + func (b *DSPreImage) UnmarshalCapn(bc mdefs.DSPreImage) error + func (b *DSPreImage) ValidateDeposit() error + func (b *DSPreImage) ValidatePreSignature(msg []byte, sig *DataStoreSignature) error + func (b *DSPreImage) ValidateSignature(currentHeight uint32, msg []byte, sig *DataStoreSignature) error + func (b *DSPreImage) Value() (*uint256.Uint256, error) + type DataStore struct + DSLinker *DSLinker + Signature *DataStoreSignature + func (b *DataStore) ChainID() (uint32, error) + func (b *DataStore) EpochOfExpiration() (uint32, error) + func (b *DataStore) GenericOwner() (*Owner, error) + func (b *DataStore) Index() ([]byte, error) + func (b *DataStore) IssuedAt() (uint32, error) + func (b *DataStore) MakeTxIn() (*TXIn, error) + func (b *DataStore) MarshalBinary() ([]byte, error) + func (b *DataStore) MarshalCapn(seg *capnp.Segment) (mdefs.DataStore, error) + func (b *DataStore) Owner() (*DataStoreOwner, error) + func (b *DataStore) PreHash() ([]byte, error) + func (b *DataStore) PreSign(s Signer) error + func (b *DataStore) RawData() ([]byte, error) + func (b *DataStore) RemainingValue(currentHeight uint32) (*uint256.Uint256, error) + func (b *DataStore) SetTXOutIdx(idx uint32) error + func (b *DataStore) SetTxHash(txHash []byte) error + func (b *DataStore) Sign(txIn *TXIn, s Signer) error + func (b *DataStore) TXOutIdx() (uint32, error) + func (b *DataStore) TxHash() ([]byte, error) + func (b *DataStore) UTXOID() ([]byte, error) + func (b *DataStore) UnmarshalBinary(data []byte) error + func (b *DataStore) UnmarshalCapn(bc mdefs.DataStore) error + func (b *DataStore) ValidatePreSignature() error + func (b *DataStore) ValidateSignature(currentHeight uint32, txIn *TXIn) error + func (b *DataStore) Value() (*uint256.Uint256, error) + type DataStoreOwner struct + Account []byte + CurveSpec constants.CurveSpec + SVA SVA + func (dso *DataStoreOwner) MarshalBinary() ([]byte, error) + func (dso *DataStoreOwner) New(acct []byte, curveSpec constants.CurveSpec) + func (dso *DataStoreOwner) NewFromOwner(o *Owner) error + func (dso *DataStoreOwner) Sign(msg []byte, s Signer) (*DataStoreSignature, error) + func (dso *DataStoreOwner) UnmarshalBinary(o []byte) error + func (dso *DataStoreOwner) Validate() error + func (dso *DataStoreOwner) ValidateSignature(msg []byte, sig *DataStoreSignature, isExpired bool) error + type DataStoreSignature struct + CurveSpec constants.CurveSpec + SVA SVA + Signature []byte + func (dss *DataStoreSignature) MarshalBinary() ([]byte, error) + func (dss *DataStoreSignature) UnmarshalBinary(signature []byte) error + func (dss *DataStoreSignature) Validate() error + type Owner struct + Account []byte + CurveSpec constants.CurveSpec + func (onr *Owner) MarshalBinary() ([]byte, error) + func (onr *Owner) New(acct []byte, curveSpec constants.CurveSpec) error + func (onr *Owner) NewFromAtomicSwapOwner(aso *AtomicSwapOwner) error + func (onr *Owner) NewFromAtomicSwapSubOwner(asso *AtomicSwapSubOwner) error + func (onr *Owner) NewFromDataStoreOwner(dso *DataStoreOwner) error + func (onr *Owner) NewFromValueStoreOwner(vso *ValueStoreOwner) error + func (onr *Owner) UnmarshalBinary(o []byte) error + func (onr *Owner) Validate() error + type PaginationResponse struct + Index []byte + UTXOID []byte + type SVA uint8 + const DataStoreSVA + const HashedTimelockSVA + const ValueStoreSVA + type Signer interface + Pubkey func() ([]byte, error) + Sign func(msg []byte) (sig []byte, err error) + type SignerRole uint8 + const AlternateSignerRole + const PrimarySignerRole + type TXIn struct + Signature []byte + TXInLinker *TXInLinker + func (b *TXIn) ChainID() (uint32, error) + func (b *TXIn) ConsumedTxHash() ([]byte, error) + func (b *TXIn) ConsumedTxIdx() (uint32, error) + func (b *TXIn) IsDeposit() bool + func (b *TXIn) MarshalBinary() ([]byte, error) + func (b *TXIn) MarshalCapn(seg *capnp.Segment) (mdefs.TXIn, error) + func (b *TXIn) PreHash() ([]byte, error) + func (b *TXIn) SetTxHash(txHash []byte) error + func (b *TXIn) TxHash() ([]byte, error) + func (b *TXIn) UTXOID() ([]byte, error) + func (b *TXIn) UnmarshalBinary(data []byte) error + func (b *TXIn) UnmarshalCapn(bc mdefs.TXIn) error + type TXInLinker struct + TXInPreImage *TXInPreImage + TxHash []byte + func (b *TXInLinker) ChainID() (uint32, error) + func (b *TXInLinker) ConsumedTxHash() ([]byte, error) + func (b *TXInLinker) ConsumedTxIdx() (uint32, error) + func (b *TXInLinker) IsDeposit() bool + func (b *TXInLinker) MarshalBinary() ([]byte, error) + func (b *TXInLinker) MarshalCapn(seg *capnp.Segment) (mdefs.TXInLinker, error) + func (b *TXInLinker) PreHash() ([]byte, error) + func (b *TXInLinker) SetTxHash(txHash []byte) error + func (b *TXInLinker) UTXOID() ([]byte, error) + func (b *TXInLinker) UnmarshalBinary(data []byte) error + func (b *TXInLinker) UnmarshalCapn(bc mdefs.TXInLinker) error + type TXInPreImage struct + ChainID uint32 + ConsumedTxHash []byte + ConsumedTxIdx uint32 + func (b *TXInPreImage) IsDeposit() bool + func (b *TXInPreImage) MarshalBinary() ([]byte, error) + func (b *TXInPreImage) MarshalCapn(seg *capnp.Segment) (mdefs.TXInPreImage, error) + func (b *TXInPreImage) PreHash() ([]byte, error) + func (b *TXInPreImage) UTXOID() ([]byte, error) + func (b *TXInPreImage) UnmarshalBinary(data []byte) error + func (b *TXInPreImage) UnmarshalCapn(bc mdefs.TXInPreImage) error + type TXOut struct + func (b *TXOut) Account() ([]byte, error) + func (b *TXOut) AtomicSwap() (*AtomicSwap, error) + func (b *TXOut) CannotBeMinedBeforeHeight() (uint32, error) + func (b *TXOut) ChainID() (uint32, error) + func (b *TXOut) CreateValueStore(chainID uint32, value *uint256.Uint256, acct []byte, ...) error + func (b *TXOut) CreateValueStoreFromDeposit(chainID uint32, value *uint256.Uint256, acct []byte, nonce []byte) error + func (b *TXOut) DataStore() (*DataStore, error) + func (b *TXOut) GenericOwner() (*Owner, error) + func (b *TXOut) HasAtomicSwap() bool + func (b *TXOut) HasDataStore() bool + func (b *TXOut) HasValueStore() bool + func (b *TXOut) IsDeposit() bool + func (b *TXOut) MakeTxIn() (*TXIn, error) + func (b *TXOut) MarshalBinary() ([]byte, error) + func (b *TXOut) MarshalCapn(seg *capnp.Segment) (mdefs.TXOut, error) + func (b *TXOut) MustBeMinedBeforeHeight() (uint32, error) + func (b *TXOut) NewAtomicSwap(v *AtomicSwap) error + func (b *TXOut) NewDataStore(v *DataStore) error + func (b *TXOut) NewValueStore(v *ValueStore) error + func (b *TXOut) PreHash() ([]byte, error) + func (b *TXOut) RemainingValue(currentHeight uint32) (*uint256.Uint256, error) + func (b *TXOut) SetTXOutIdx(idx uint32) error + func (b *TXOut) SetTxHash(txHash []byte) error + func (b *TXOut) TXOutIdx() (uint32, error) + func (b *TXOut) TxHash() ([]byte, error) + func (b *TXOut) UTXOID() ([]byte, error) + func (b *TXOut) UnmarshalBinary(data []byte) error + func (b *TXOut) UnmarshalCapn(bc mdefs.TXOut) error + func (b *TXOut) ValidatePreSignature() error + func (b *TXOut) ValidateSignature(currentHeight uint32, txIn *TXIn) error + func (b *TXOut) Value() (*uint256.Uint256, error) + func (b *TXOut) ValueStore() (*ValueStore, error) + type Tx struct + Vin Vin + Vout Vout + func (b *Tx) CannotBeMinedUntil() (uint32, error) + func (b *Tx) ConsumedIsDeposit() []bool + func (b *Tx) ConsumedPreHash() ([][]byte, error) + func (b *Tx) ConsumedUTXOID() ([][]byte, error) + func (b *Tx) EpochOfExpirationForMining() (uint32, error) + func (b *Tx) GeneratedPreHash() ([][]byte, error) + func (b *Tx) GeneratedUTXOID() ([][]byte, error) + func (b *Tx) MarshalBinary() ([]byte, error) + func (b *Tx) MarshalCapn(seg *capnp.Segment) (mdefs.Tx, error) + func (b *Tx) PostValidatePending(currentHeight uint32, consumedUTXOs Vout) error + func (b *Tx) PreValidatePending(chainID uint32) error + func (b *Tx) SetTxHash() error + func (b *Tx) TxHash() ([]byte, error) + func (b *Tx) UnmarshalBinary(data []byte) error + func (b *Tx) UnmarshalCapn(bc mdefs.Tx) error + func (b *Tx) Validate(set map[string]bool, currentHeight uint32, consumedUTXOs Vout) (map[string]bool, error) + func (b *Tx) ValidateChainID(chainID uint32) error + func (b *Tx) ValidateDataStoreIndexes(opset map[string]bool) (map[string]bool, error) + func (b *Tx) ValidateEqualVinVout(refUTXOs Vout, currentHeight uint32) error + func (b *Tx) ValidateIssuedAtForMining(currentHeight uint32) error + func (b *Tx) ValidatePreSignature() error + func (b *Tx) ValidateSignature(currentHeight uint32, refUTXOs Vout) error + func (b *Tx) ValidateTxHash() error + func (b *Tx) ValidateUnique(opset map[string]bool) (map[string]bool, error) + func (b *Tx) XXXIsTx() + type TxVec []*Tx + func (txv TxVec) ConsumedIsDeposit() []bool + func (txv TxVec) ConsumedPreHash() ([][]byte, error) + func (txv TxVec) ConsumedPreHashOnlyDeposits() ([][]byte, error) + func (txv TxVec) ConsumedTxIns() (Vin, error) + func (txv TxVec) ConsumedUTXOID() ([][]byte, error) + func (txv TxVec) ConsumedUTXOIDNoDeposits() ([][]byte, error) + func (txv TxVec) ConsumedUTXOIDOnlyDeposits() ([][]byte, error) + func (txv TxVec) GeneratedPreHash() ([][]byte, error) + func (txv TxVec) GeneratedUTXOID() ([][]byte, error) + func (txv TxVec) GeneratedUTXOs() (Vout, error) + func (txv TxVec) MarshalBinary() ([][]byte, error) + func (txv TxVec) PostValidatePending(currentHeight uint32, consumedUTXOs Vout) error + func (txv TxVec) PreValidateApplyState(chainID uint32) error + func (txv TxVec) PreValidatePending(chainID uint32) error + func (txv TxVec) TxHash() ([][]byte, error) + func (txv TxVec) Validate(currentHeight uint32, consumedUTXOs Vout) error + func (txv TxVec) ValidateChainID(chainID uint32) error + func (txv TxVec) ValidateDataStoreIndexes(exclSet map[string]bool) (map[string]bool, error) + func (txv TxVec) ValidateUnique(exclSet map[string]bool) (map[string]bool, error) + type VSPreImage struct + ChainID uint32 + Owner *ValueStoreOwner + TXOutIdx uint32 + Value *uint256.Uint256 + func (b *VSPreImage) MarshalBinary() ([]byte, error) + func (b *VSPreImage) MarshalCapn(seg *capnp.Segment) (mdefs.VSPreImage, error) + func (b *VSPreImage) PreHash() ([]byte, error) + func (b *VSPreImage) UnmarshalBinary(data []byte) error + func (b *VSPreImage) UnmarshalCapn(bc mdefs.VSPreImage) error + func (b *VSPreImage) ValidateSignature(msg []byte, sig *ValueStoreSignature) error + type ValueStore struct + TxHash []byte + VSPreImage *VSPreImage + func (b *ValueStore) ChainID() (uint32, error) + func (b *ValueStore) GenericOwner() (*Owner, error) + func (b *ValueStore) IsDeposit() bool + func (b *ValueStore) MakeTxIn() (*TXIn, error) + func (b *ValueStore) MarshalBinary() ([]byte, error) + func (b *ValueStore) MarshalCapn(seg *capnp.Segment) (mdefs.ValueStore, error) + func (b *ValueStore) New(chainID uint32, value *uint256.Uint256, acct []byte, ...) error + func (b *ValueStore) NewFromDeposit(chainID uint32, value *uint256.Uint256, acct []byte, nonce []byte) error + func (b *ValueStore) Owner() (*ValueStoreOwner, error) + func (b *ValueStore) PreHash() ([]byte, error) + func (b *ValueStore) SetTXOutIdx(idx uint32) error + func (b *ValueStore) SetTxHash(txHash []byte) error + func (b *ValueStore) Sign(txIn *TXIn, s Signer) error + func (b *ValueStore) TXOutIdx() (uint32, error) + func (b *ValueStore) UTXOID() ([]byte, error) + func (b *ValueStore) UnmarshalBinary(data []byte) error + func (b *ValueStore) UnmarshalCapn(bc mdefs.ValueStore) error + func (b *ValueStore) ValidateSignature(txIn *TXIn) error + func (b *ValueStore) Value() (*uint256.Uint256, error) + type ValueStoreOwner struct + Account []byte + CurveSpec constants.CurveSpec + SVA SVA + func (vso *ValueStoreOwner) MarshalBinary() ([]byte, error) + func (vso *ValueStoreOwner) New(acct []byte, curveSpec constants.CurveSpec) + func (vso *ValueStoreOwner) NewFromOwner(o *Owner) error + func (vso *ValueStoreOwner) Sign(msg []byte, s Signer) (*ValueStoreSignature, error) + func (vso *ValueStoreOwner) UnmarshalBinary(o []byte) error + func (vso *ValueStoreOwner) Validate() error + func (vso *ValueStoreOwner) ValidateSignature(msg []byte, sig *ValueStoreSignature) error + type ValueStoreSignature struct + CurveSpec constants.CurveSpec + SVA SVA + Signature []byte + func (vss *ValueStoreSignature) MarshalBinary() ([]byte, error) + func (vss *ValueStoreSignature) UnmarshalBinary(signature []byte) error + func (vss *ValueStoreSignature) Validate() error + type Vin []*TXIn + func (vin Vin) IsDeposit() []bool + func (vin Vin) PreHash() ([][]byte, error) + func (vin Vin) UTXOID() ([][]byte, error) + type Vout []*TXOut + func (vout Vout) MakeTxIn() (Vin, error) + func (vout Vout) PreHash() ([][]byte, error) + func (vout Vout) RemainingValue(currentHeight uint32) (*uint256.Uint256, error) + func (vout Vout) SetTxOutIdx() error + func (vout Vout) UTXOID() ([][]byte, error) + func (vout Vout) ValidatePreSignature() error + func (vout Vout) ValidateSignature(currentHeight uint32, txIn []*TXIn) error + func (vout Vout) ValidateTxOutIdx() error + func (vout Vout) Value() (*uint256.Uint256, error)