zcash-haskell/src/ZcashHaskell/Sapling.hs

21 lines
725 B
Haskell
Raw Normal View History

2023-06-14 15:53:29 +00:00
module ZcashHaskell.Sapling where
2023-06-14 15:53:29 +00:00
import C.Zcash
( rustWrapperIsShielded
, rustWrapperSaplingCheck
, rustWrapperSaplingVkDecode
)
import qualified Data.ByteString as BS
-- | Check if given bytesting is a valid encoded shielded address
isValidShieldedAddress :: BS.ByteString -> Bool
isValidShieldedAddress = rustWrapperIsShielded
2023-06-14 14:55:52 +00:00
-- | Check if given bytestring is a valid Sapling viewing key
isValidSaplingViewingKey :: BS.ByteString -> Bool
isValidSaplingViewingKey = rustWrapperSaplingVkDecode
2023-06-14 15:53:29 +00:00
-- | Check if the given bytestring for the Sapling viewing key matches the second bytestring for the address
matchSaplingAddress :: BS.ByteString -> BS.ByteString -> Bool
matchSaplingAddress = rustWrapperSaplingCheck