Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class Show c => SpendCondition c where
- class HasSigner newSigData rdmScr => TransformSigData newSigData oldSigData rdmScr | newSigData oldSigData -> rdmScr where
- class SpendCondition r => HasSigner newSigData r where
- signTx :: forall t r newSigData oldSd signKey. (TransformSigData newSigData oldSd r, HasSigningKey signKey r) => BtcTx t r oldSd -> SignM signKey (Either BtcError (BtcTx t r newSigData))
- signChangeTx :: forall txLike t r newSd oldSd signKey coi. (SignatureScript r newSd t, TransformSigData newSd oldSd r, HasSigningKey signKey r, DeriveChangeOut (txLike t r oldSd) coi signKey r, IsTxLike txLike t r oldSd) => txLike t r oldSd -> coi -> SignM signKey (Either BtcError (BtcTx t r newSd))
- verifyTx :: (SpendFulfillment ss r, SpendCondition r) => BtcTx t r ss -> Either VerifyError ()
- data ChangeOut
- runSimple :: PrvKeyC -> SignSimpleM a -> a
- runExtDet :: RootPrv -> SignDerivM a -> a
- runDummy :: SignDummyM a -> a
- data SignM key a
- type SignSimpleM = SignM PrvKeyC
- type SignDerivM = SignM RootPrv
- type SignDummyM = SignM ()
- class HasSigningKey key rdmScr
- class HasSigningKey signKey rdmScr => DeriveChangeOut tx coi signKey rdmScr | tx -> rdmScr where
- data BtcSig
- type PubKeyC = PubKeyI Compressed
- data BtcError
- data VerifyError
Interfaces to fill out
class Show c => SpendCondition c where Source #
Script that defines a condition to spend
conditionScript :: c -> Script Source #
The script will, depending on transaction type, be placed either in output, input or witness of transaction
class HasSigner newSigData rdmScr => TransformSigData newSigData oldSigData rdmScr | newSigData oldSigData -> rdmScr where Source #
Defines how to transform old signature data type into a new one (by adding signatures)
class SpendCondition r => HasSigner newSigData r where Source #
Identifies a signer whose signature produces newSigData
signerPubKey :: r -> Tagged newSigData PubKeyC Source #
Provided functions: sign tx, verify tx
signTx :: forall t r newSigData oldSd signKey. (TransformSigData newSigData oldSd r, HasSigningKey signKey r) => BtcTx t r oldSd -> SignM signKey (Either BtcError (BtcTx t r newSigData)) Source #
signChangeTx :: forall txLike t r newSd oldSd signKey coi. (SignatureScript r newSd t, TransformSigData newSd oldSd r, HasSigningKey signKey r, DeriveChangeOut (txLike t r oldSd) coi signKey r, IsTxLike txLike t r oldSd) => txLike t r oldSd -> coi -> SignM signKey (Either BtcError (BtcTx t r newSd)) Source #
Create SigSingle tx with added change output
verifyTx :: (SpendFulfillment ss r, SpendCondition r) => BtcTx t r ss -> Either VerifyError () Source #
Eq ChangeOut Source # | |
Show ChangeOut Source # | |
Generic ChangeOut Source # | |
ToJSON ChangeOut Source # | |
FromJSON ChangeOut Source # | |
Serialize ChangeOut Source # | |
NFData ChangeOut Source # | |
(SpendCondition r, IsTxLike tx t r sd) => DeriveChangeOut (tx t r sd) ChangeOut PrvKeyC r Source # | |
type Rep ChangeOut Source # | |
Runners
runExtDet :: RootPrv -> SignDerivM a -> a Source #
Run using a BIP-32 extended root private key as source key, with determinisitic key derivation.
runDummy :: SignDummyM a -> a Source #
TEST: Run using dummy private key. Used e.g. for producing transactions to test serialization length, for calculating tx fees relative to tx size.
Generic signing monad. Run with e.g. runSimple
type SignSimpleM = SignM PrvKeyC Source #
type SignDerivM = SignM RootPrv Source #
type SignDummyM = SignM () Source #
class HasSigningKey key rdmScr Source #
getSignKey
HasSigningKey () r Source # | |
HasSigningKey PrvKeyC r Source # | |
DerivationSeed r => HasSigningKey RootPrv r Source # | |
class HasSigningKey signKey rdmScr => DeriveChangeOut tx coi signKey rdmScr | tx -> rdmScr where Source #
createChangeOut :: tx -> signKey -> coi -> ChangeOut Source #
(SpendCondition r, IsTxLike tx t r sd) => DeriveChangeOut (tx t r sd) ChangeOut PrvKeyC r Source # | |
(SpendCondition r, IsTxLike tx t r sd) => DeriveChangeOut (tx t r sd) (TxFee, DustPolicy) () r Source # | |
DerivationSeed r => DeriveChangeOut (SigSinglePair t r sd) (TxFee, DustPolicy) RootPrv r Source # | |
Re-exports
ECDSA signature plus sig hash flag
Eq BtcSig Source # | |
Show BtcSig Source # | |
Show ClientPayChan # | |
Generic BtcSig Source # | |
ToJSON BtcSig Source # | |
FromJSON BtcSig Source # | |
Serialize BtcSig Source # | |
NFData BtcSig Source # | |
HasSharedSecret ClientPayChan Source # | |
PaymentChannel ClientPayChan Source # | |
Eq (IgnoreSigData BtcSig) Source # | |
Eq rdmScr => Eq (IgnoreSigData (BtcTx inType rdmScr BtcSig)) Source # | |
ToJSON d => ToJSON (ServerPayChanI d) # | |
FromJSON d => FromJSON (ServerPayChanI d) # | |
PaymentChannelRecv (ServerPayChanI (MetadataI a)) Source # | |
PaymentChannel (ServerPayChanI s) Source # | |
Eq r => Ord (SigSinglePair t r BtcSig) Source # | |
type Rep BtcSig Source # | |
data VerifyError Source #