| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Bitcoin.Script.Standard
Description
Standard scripts
- data InputScript
- isStandardInputScript :: InputScript -> Bool
- data OutputScript
- isStandardOutputScript :: OutputScript -> Bool
- createInputScript :: InputScript -> RawScript
- createTxInput :: TxInput InputScript -> TxInput RawScript
- createOutputScript :: OutputScript -> RawScript
- createTxOutput :: TxOutput OutputScript -> TxOutput RawScript
- recognizeTxInput :: TxInput RawScript -> TxInput InputScript
- recognizeInputScript :: RawScript -> InputScript
- recognizeTxOutput :: TxOutput RawScript -> TxOutput OutputScript
- recognizeOutputScript :: RawScript -> OutputScript
- recogPayToMultiSig :: [Opcode] -> Maybe (Int, [PubKey])
- recognizeTx :: Tx RawScript RawScript -> Tx InputScript OutputScript
- recognizeBlockTxs :: Block (Tx RawScript RawScript) -> Block (Tx InputScript OutputScript)
Documentation
data InputScript Source #
Standard input scripts (also known as "scriptSig")
Constructors
| CoinGeneration !RawScript | coin generation (the script has no meaning) |
| RedeemAddress !SignatureExt !PubKey | redeem a standard (to-address) transaction: <sig> <pubKey> |
| RedeemPubKey !SignatureExt | redeem a to-pubkey transaction (?) |
| RedeemMultiSig [SignatureExt] | redeem a multisig transaction |
| RedeemP2SH [SignatureExt] !RawScript | redeem a pay-to-script-hash transaction (???) |
| RedeemEmpty | OP_TRUE - accepts an AnyCanSpend script |
| UnknownInput (Either RawScript Script) | something else (that is, non-standard) |
Instances
data OutputScript Source #
Standard output scripts (also known as "scriptSig")
Constructors
| PayToAddress !PubKeyHash | OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG |
| PayToPubKey !PubKey | <pubKey> OP_CHECKSIG (accept generation, for example, but also others?) |
| PayToMultiSig !Int [PubKey] | eg. OP_2 <pubkey1> <pubkey2> <pubkey3> OP_3 OP_CHECKMULTISIG |
| PayToScriptHash !ScriptHash | OP_HASH160 <script-hash> OP_EQUAL |
| Unspendable | OP_RETURN {zero or more ops} |
| AnyCanSpend | (empty) |
| UnknownOutput (Either RawScript Script) | something else (that is, non-standard) |
Instances
createInputScript :: InputScript -> RawScript Source #
Note: RedeemP2SH is a hack. I should think again how that should work (certainly not this way...)
recognizeTxInput :: TxInput RawScript -> TxInput InputScript Source #
Recognize standard input scripts (also known as "scriptSig").
We need the whole TxInput since coinbase transactions are not possible to recognize only from the script (which can be anything).
recognizeInputScript :: RawScript -> InputScript Source #
Note: this cannot recognize coinbase transactions.
recognizeTxOutput :: TxOutput RawScript -> TxOutput OutputScript Source #
Recognize standard output scripts (also known as "scriptPubKey")
recognizeBlockTxs :: Block (Tx RawScript RawScript) -> Block (Tx InputScript OutputScript) Source #