| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cometa.Address.Byron
Description
Byron bootstrap addresses with checked payloads and checksums. Imported encodings are retained exactly; construction assigns fresh CBOR and Base58.
import qualified Cometa.Address.Byron as Byron inspectRoot text = Byron.root $ Byron.fromText text
Synopsis
- data Address
- data Root
- rootFromBytes :: ByteString -> Either Error Root
- rootBytes :: Root -> ByteString
- data AddressType
- data Attributes
- attributes :: Maybe ByteString -> Maybe Word64 -> Either Error Attributes
- derivationPayload :: Attributes -> Maybe ByteString
- networkMagic :: Attributes -> Maybe Word64
- address :: Root -> Attributes -> AddressType -> Address
- root :: Address -> Root
- addressType :: Address -> AddressType
- addressAttributes :: Address -> Attributes
- fromBytes :: ByteString -> Either Error Address
- toBytes :: Address -> ByteString
- fromText :: Text -> Either Error Address
- toText :: Address -> Text
Documentation
An address with its original checked encoding. Equality and ordering compare
address bytes; Show is diagnostic output, not its Base58 representation.
A 28-byte address root. Equality and ordering compare exact bytes.
rootFromBytes :: ByteString -> Either Error Root Source #
Import a 28-byte root without hashing; other lengths return InvalidByronAddress.
rootBytes :: Root -> ByteString Source #
Exact root bytes.
data AddressType Source #
The authority used to spend a Byron output.
Constructors
| PublicKey | Verification-key authority. |
| Script | Script authority. |
| Redeem | Initial-distribution redemption key. |
Instances
data Attributes Source #
Optional encrypted derivation payload and network magic. The payload is at most 64 bytes; empty payloads are represented as absent. Magic ranges from zero through 2^63-1. Absence identifies the main/staging network convention.
Instances
| Show Attributes Source # | |
Defined in Cometa.Address.Byron Methods showsPrec :: Int -> Attributes -> ShowS # show :: Attributes -> String # showList :: [Attributes] -> ShowS # | |
| Eq Attributes Source # | |
Defined in Cometa.Address.Byron | |
| Ord Attributes Source # | |
Defined in Cometa.Address.Byron Methods compare :: Attributes -> Attributes -> Ordering # (<) :: Attributes -> Attributes -> Bool # (<=) :: Attributes -> Attributes -> Bool # (>) :: Attributes -> Attributes -> Bool # (>=) :: Attributes -> Attributes -> Bool # max :: Attributes -> Attributes -> Attributes # min :: Attributes -> Attributes -> Attributes # | |
attributes :: Maybe ByteString -> Maybe Word64 -> Either Error Attributes Source #
Validate an encrypted payload and network magic. Invalid bounds return
InvalidByronAddress. This neither decrypts nor authenticates the payload.
derivationPayload :: Attributes -> Maybe ByteString Source #
Encrypted derivation payload, when present.
networkMagic :: Attributes -> Maybe Word64 Source #
Network magic; absence uses the main/staging network convention.
address :: Root -> Attributes -> AddressType -> Address Source #
Assemble an address with minimal CBOR and a checksum of the exact payload.
addressType :: Address -> AddressType Source #
Spending-authority form.
addressAttributes :: Address -> Attributes Source #
Validated encrypted payload and network discriminator.
fromBytes :: ByteString -> Either Error Address Source #
Validate complete outer and inner CBOR, tag 24, CRC32, root length, known
unique attributes and type. Malformed or trailing input returns
InvalidByronAddress. Accepted nonminimal and indefinite array framing is
retained exactly; attribute values must each contain one complete value.
toBytes :: Address -> ByteString Source #
Exact accepted address bytes, or fresh bytes assigned by address.