Copyright | 2022-2024 Vergara Technologies |
---|---|
License | MIT |
Maintainer | rene@vergara.network |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
ZcashHaskell.Orchard
Description
Functions to interact with the Orchard shielded pool of the Zcash blockchain.
Synopsis
- genOrchardSpendingKey :: Seed -> CoinType -> AccountId -> Maybe OrchardSpendingKey
- genOrchardReceiver :: Int -> Scope -> OrchardSpendingKey -> Maybe OrchardReceiver
- genOrchardReceiverFvk :: Int -> Scope -> ByteString -> Maybe OrchardReceiver
- genOrchardReceiverIvk :: Int -> ByteString -> Maybe OrchardReceiver
- isValidUnifiedAddress :: ByteString -> Maybe UnifiedAddress
- encodeUnifiedAddress :: UnifiedAddress -> Text
- decodeUfvk :: ByteString -> Maybe UnifiedFullViewingKey
- decodeUivk :: ByteString -> Maybe UnifiedIncomingViewingKey
- matchOrchardAddress :: ByteString -> ByteString -> Bool
- decryptOrchardAction :: UnifiedFullViewingKey -> OrchardAction -> Maybe DecodedNote
- decryptOrchardActionFvk :: UnifiedFullViewingKey -> Scope -> OrchardAction -> Maybe DecodedNote
- decryptOrchardActionIvk :: UnifiedIncomingViewingKey -> OrchardAction -> Maybe DecodedNote
- getSaplingFromUA :: ByteString -> Maybe Text
- decryptOrchardActionSK :: OrchardSpendingKey -> Scope -> OrchardAction -> Maybe DecodedNote
- getOrchardFrontier :: OrchardCommitmentTree -> Maybe OrchardFrontier
- getOrchardTreeAnchor :: OrchardCommitmentTree -> HexString
- getOrchardWitnessAnchor :: OrchardWitness -> HexString
- getOrchardRootTest :: Int -> HexString
- addOrchardNodeGetRoot :: Int -> ByteString -> HexString
- getOrchardTreeParts :: OrchardCommitmentTree -> Maybe OrchardTree
- getOrchardPathAnchor :: HexString -> MerklePath -> HexString
- updateOrchardCommitmentTree :: OrchardFrontier -> HexString -> Maybe OrchardFrontier
- getOrchardWitness :: OrchardFrontier -> Maybe OrchardWitness
- getOrchardNotePosition :: OrchardWitness -> Integer
- updateOrchardWitness :: OrchardWitness -> [HexString] -> OrchardWitness
- getOrchardNodeValue :: ByteString -> Maybe HexString
- combineOrchardNodes :: Integer -> HexString -> HexString -> Maybe HexString
- parseAddress :: ByteString -> Maybe ValidAddress
- compareAddress :: ValidAddress -> UnifiedAddress -> Bool
- deriveOrchardFvk :: OrchardSpendingKey -> Maybe HexString
- deriveOrchardIvk :: OrchardSpendingKey -> Maybe HexString
Documentation
Arguments
:: Seed | The cryptographic seed for the wallet |
-> CoinType | The coin type constant |
-> AccountId | The index of the account to be used |
-> Maybe OrchardSpendingKey |
Derives an Orchard spending key for the given seed and account ID
Arguments
:: Int | The index of the address to be created |
-> Scope |
|
-> OrchardSpendingKey | The spending key |
-> Maybe OrchardReceiver |
Derives an Orchard receiver for the given spending key and index
Arguments
:: Int | The index of the address to be created |
-> Scope |
|
-> ByteString | The full viewing key |
-> Maybe OrchardReceiver |
Derives an Orchard receiver for the given full viewing key and index
Arguments
:: Int | The index of the address to be created |
-> ByteString | The full viewing key |
-> Maybe OrchardReceiver |
Derives an Orchard receiver for the given incoming viewing key and index
isValidUnifiedAddress :: ByteString -> Maybe UnifiedAddress #
Checks if given bytestring is a valid encoded unified address
encodeUnifiedAddress :: UnifiedAddress -> Text #
Encode a UnifiedAddress
per ZIP-316
decodeUfvk :: ByteString -> Maybe UnifiedFullViewingKey #
Attempts to decode the given bytestring into a Unified Full Viewing Key
decodeUivk :: ByteString -> Maybe UnifiedIncomingViewingKey #
Attempts to decode the given bytestring into a Unified Full Viewing Key
matchOrchardAddress :: ByteString -> ByteString -> Bool #
Check if the given UVK matches the UA given
decryptOrchardAction :: UnifiedFullViewingKey -> OrchardAction -> Maybe DecodedNote #
Attempts to decode the given OrchardAction
using the given UnifiedFullViewingKey
.
decryptOrchardActionFvk :: UnifiedFullViewingKey -> Scope -> OrchardAction -> Maybe DecodedNote #
Attempts to decode the given OrchardAction
using the given UnifiedFullViewingKey
.
decryptOrchardActionIvk :: UnifiedIncomingViewingKey -> OrchardAction -> Maybe DecodedNote #
Attempts to decode the given OrchardAction
using the given UnifiedFullViewingKey
.
getSaplingFromUA :: ByteString -> Maybe Text #
decryptOrchardActionSK :: OrchardSpendingKey -> Scope -> OrchardAction -> Maybe DecodedNote #
Attemtps to decode the given OrchardAction
using the given OrchardSpendingKey
getOrchardTreeAnchor :: OrchardCommitmentTree -> HexString #
getOrchardWitnessAnchor :: OrchardWitness -> HexString #
getOrchardRootTest :: Int -> HexString #
addOrchardNodeGetRoot :: Int -> ByteString -> HexString #
getOrchardPathAnchor :: HexString -> MerklePath -> HexString #
Arguments
:: OrchardFrontier | the base tree |
-> HexString | the new note commitment |
-> Maybe OrchardFrontier |
Update a Orchard commitment tree
getOrchardWitness :: OrchardFrontier -> Maybe OrchardWitness #
Get the Orchard incremental witness from a commitment tree
getOrchardNotePosition :: OrchardWitness -> Integer #
Get the Sapling note position from a witness
updateOrchardWitness :: OrchardWitness -> [HexString] -> OrchardWitness #
Update the witness of an Orchard note
getOrchardNodeValue :: ByteString -> Maybe HexString #
combineOrchardNodes :: Integer -> HexString -> HexString -> Maybe HexString #
parseAddress :: ByteString -> Maybe ValidAddress #
Parse a potential Zcash address
compareAddress :: ValidAddress -> UnifiedAddress -> Bool #
Arguments
:: OrchardSpendingKey | The Orchard spending key |
-> Maybe HexString |
Derive an Orchard Full Viewing Key
Arguments
:: OrchardSpendingKey | The Orchard spending key |
-> Maybe HexString |
Derive an Orchard Incoming Viewing Key