Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data MultiSig era
- class EraScript era ⇒ ShelleyEraScript era where
- mkRequireSignature ∷ KeyHash 'Witness (EraCrypto era) → NativeScript era
- getRequireSignature ∷ NativeScript era → Maybe (KeyHash 'Witness (EraCrypto era))
- mkRequireAllOf ∷ StrictSeq (NativeScript era) → NativeScript era
- getRequireAllOf ∷ NativeScript era → Maybe (StrictSeq (NativeScript era))
- mkRequireAnyOf ∷ StrictSeq (NativeScript era) → NativeScript era
- getRequireAnyOf ∷ NativeScript era → Maybe (StrictSeq (NativeScript era))
- mkRequireMOf ∷ Int → StrictSeq (NativeScript era) → NativeScript era
- getRequireMOf ∷ NativeScript era → Maybe (Int, StrictSeq (NativeScript era))
- pattern RequireSignature ∷ ShelleyEraScript era ⇒ KeyHash 'Witness (EraCrypto era) → NativeScript era
- pattern RequireAllOf ∷ ShelleyEraScript era ⇒ StrictSeq (NativeScript era) → NativeScript era
- pattern RequireAnyOf ∷ ShelleyEraScript era ⇒ StrictSeq (NativeScript era) → NativeScript era
- pattern RequireMOf ∷ ShelleyEraScript era ⇒ Int → StrictSeq (NativeScript era) → NativeScript era
- evalMultiSig ∷ (ShelleyEraScript era, NativeScript era ~ MultiSig era) ⇒ Set (KeyHash 'Witness (EraCrypto era)) → NativeScript era → Bool
- validateMultiSig ∷ (ShelleyEraScript era, EraTx era, NativeScript era ~ MultiSig era) ⇒ Tx era → NativeScript era → Bool
- newtype ScriptHash c = ScriptHash (Hash (ADDRHASH c) EraIndependentScript)
- nativeMultiSigTag ∷ ByteString
- eqMultiSigRaw ∷ MultiSig era → MultiSig era → Bool
- data MultiSigRaw era
Documentation
Instances
class EraScript era ⇒ ShelleyEraScript era where Source #
mkRequireSignature ∷ KeyHash 'Witness (EraCrypto era) → NativeScript era Source #
getRequireSignature ∷ NativeScript era → Maybe (KeyHash 'Witness (EraCrypto era)) Source #
mkRequireAllOf ∷ StrictSeq (NativeScript era) → NativeScript era Source #
getRequireAllOf ∷ NativeScript era → Maybe (StrictSeq (NativeScript era)) Source #
mkRequireAnyOf ∷ StrictSeq (NativeScript era) → NativeScript era Source #
getRequireAnyOf ∷ NativeScript era → Maybe (StrictSeq (NativeScript era)) Source #
mkRequireMOf ∷ Int → StrictSeq (NativeScript era) → NativeScript era Source #
getRequireMOf ∷ NativeScript era → Maybe (Int, StrictSeq (NativeScript era)) Source #
Instances
Crypto c ⇒ ShelleyEraScript (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Scripts mkRequireSignature ∷ KeyHash 'Witness (EraCrypto (ShelleyEra c)) → NativeScript (ShelleyEra c) Source # getRequireSignature ∷ NativeScript (ShelleyEra c) → Maybe (KeyHash 'Witness (EraCrypto (ShelleyEra c))) Source # mkRequireAllOf ∷ StrictSeq (NativeScript (ShelleyEra c)) → NativeScript (ShelleyEra c) Source # getRequireAllOf ∷ NativeScript (ShelleyEra c) → Maybe (StrictSeq (NativeScript (ShelleyEra c))) Source # mkRequireAnyOf ∷ StrictSeq (NativeScript (ShelleyEra c)) → NativeScript (ShelleyEra c) Source # getRequireAnyOf ∷ NativeScript (ShelleyEra c) → Maybe (StrictSeq (NativeScript (ShelleyEra c))) Source # mkRequireMOf ∷ Int → StrictSeq (NativeScript (ShelleyEra c)) → NativeScript (ShelleyEra c) Source # getRequireMOf ∷ NativeScript (ShelleyEra c) → Maybe (Int, StrictSeq (NativeScript (ShelleyEra c))) Source # |
pattern RequireSignature ∷ ShelleyEraScript era ⇒ KeyHash 'Witness (EraCrypto era) → NativeScript era Source #
pattern RequireAllOf ∷ ShelleyEraScript era ⇒ StrictSeq (NativeScript era) → NativeScript era Source #
pattern RequireAnyOf ∷ ShelleyEraScript era ⇒ StrictSeq (NativeScript era) → NativeScript era Source #
pattern RequireMOf ∷ ShelleyEraScript era ⇒ Int → StrictSeq (NativeScript era) → NativeScript era Source #
evalMultiSig ∷ (ShelleyEraScript era, NativeScript era ~ MultiSig era) ⇒ Set (KeyHash 'Witness (EraCrypto era)) → NativeScript era → Bool Source #
Script evaluator for native multi-signature scheme. vhks
is the set of
key hashes that signed the transaction to be validated.
validateMultiSig ∷ (ShelleyEraScript era, EraTx era, NativeScript era ~ MultiSig era) ⇒ Tx era → NativeScript era → Bool Source #
Script validator for native multi-signature scheme.
newtype ScriptHash c Source #
Instances
nativeMultiSigTag ∷ ByteString Source #
Magic number "memorialized" in the ValidateScript class under the method: scriptPrefixTag:: Core.Script era -> Bs.ByteString, for the Shelley Era.
eqMultiSigRaw ∷ MultiSig era → MultiSig era → Bool Source #
Check the equality of two underlying types, while ignoring their binary
representation, which Eq
instance normally does. This is used for testing.
data MultiSigRaw era Source #
A simple language for expressing conditions under which it is valid to withdraw from a normal UTxO payment address or to use a stake address.
The use case is for expressing multi-signature payment addresses and multi-signature stake addresses. These can be combined arbitrarily using logical operations:
- multi-way "and";
- multi-way "or";
- multi-way "N of M".
This makes it easy to express multi-signature addresses, and provides an extension point to express other validity conditions, e.g., as needed for locking funds used with lightning.
Instances
Orphan instances
Crypto c ⇒ EraScript (ShelleyEra c) Source # | |
type Script (ShelleyEra c) = (r ∷ Type) Source # type NativeScript (ShelleyEra c) = (r ∷ Type) Source # upgradeScript ∷ Script (PreviousEra (ShelleyEra c)) → Script (ShelleyEra c) Source # scriptPrefixTag ∷ Script (ShelleyEra c) → ByteString Source # getNativeScript ∷ Script (ShelleyEra c) → Maybe (NativeScript (ShelleyEra c)) Source # fromNativeScript ∷ NativeScript (ShelleyEra c) → Script (ShelleyEra c) Source # |