CypherID
Identities
data SSI ::
key secp256k1(compact [U8^33] | xonly [U8^32]) | curve25519(compact [u8^32]),
seal (bc(txid [U8^32], vout U16))?,
sig (schnorr([U8 ^ 64..65]) | ecdsa([U8 ^ 65]) | eddsa([U8 ^ 64]))?
profile Profile?
type SSIExt over SSI
{-
fn read_mnemonic :: (ssi SSI) -> (mnemo Mnemonic)
let checksum := crc32 (ssi.key, ssi.seal)
mnemo := mnemonic (checksum)
-}
read mnemonic :: [([AlphaSmall ^ 3..8])^3]
crc32 key, seal |> mnemonic
check !! SSIError -- fn check :: (SSI) -> (() | SSIError)
{- this is a lambda function
fn _match :: (ssi) -> (() | SSIError)
_match1 ssi
fn _match1 :: (ssi) -> (() | SSIError)
(and (eq ssi.key.@ty, 0), (eq ssi.sig.@ty, 1))
-}
key, sig =>
-- this a function table where each row is a lambda:
-- fn _ :: (_ _, _) -> (() | SSIError)
secp256k1(_), schnorr(_) -> (),
secp256k1(_), ecdsa(_) -> (),
curve25519(_), eddsa(_) -> (),
.. -> !! SSIError.invalidSigScheme
Last updated
