logo
Formal Ledger Specification
Coin
Initializing search
    GitHub
    • Navigation
    GitHub
      • Home
      • Guide for Contributors
        • Notation
      • Ledger
        • Prelude
        • Introduction
          • Base
            • HSTypes
            • Util
          • HasCoin
          • Instances
          • Numeric
            • PositiveNat
            • UnitInterval
            • Address
            • Crypto
            • Epoch
        • Conway
          • Specification
            • Abstract
            • Certs
              • Properties
                • PoV
                • PoVLemmas
                • VoteDelegsVDeleg
            • Chain
              • Properties
                • CredDepsEqualDomRwds
                • EpochStep
                • GovDepsMatch
                • PParamsWellFormed
            • Enact
              • Properties
            • Epoch
              • Properties
                • ConstRwds
                • GovDepsMatch
                • NoPropSameDReps
            • Fees
            • Gov
              • Base
              • Actions
              • Properties
                • ChangePPGroup
            • Ledger.Ledger
              • Properties
                • GovDepsMatch
                • PoV
            • PParams
            • Properties
            • Ratify
              • Properties
            • Rewards
            • Script
              • Base
              • Timelock
              • Validation
              • Base
              • Coin
              • ValueSet
              • ValueVector
            • Transaction
            • Utxo
              • Properties
                • MinSpend
                • PoV
            • Utxow
              • Properties
              • Examples
                • HelloWorld
                • SucceedIfNumber
              • LedgerImplementation
              • Lib
              • Prelude
              • StructuredContracts
              • GovStructure
            • ConwayBootstrap
            • ConwayBootstrapEnact
            • ExternalFunctions
            • HSLedger
              • Address
              • BaseTypes
              • Cert
              • Certs
              • Chain
              • Core
              • Enact
              • Epoch
              • ExternalStructures
              • Gov
                • Core
                • Actions
              • Ledger
              • NewEpoch
              • PParams
              • Ratify
              • Transaction
              • Utxo
          • Conformance
            • Certs
              • Properties
            • Chain
              • Properties
            • Epoch
              • Properties
            • Equivalence
              • Bisimilarity
              • Certs
              • Convert
              • Deposits
              • Map
              • Utxo
            • Gov
            • Ledger
              • Properties
            • Properties
            • Script
            • Utxo
              • Properties
            • Utxow
              • Properties
        • PreConway
            • NewPP
              • Properties
            • PPUp
              • Properties
          • NewPP
            • Properties
          • PPUp
            • Properties
        • Convertible
          • Deriving
          • DerivingTest
        • HaskellTypes
          • Deriving
        • Agda Prelude
            • ComputationalRelation
            • HasSubset
            • HasSubtract
              • Instance
            • Hashable
            • STS
          • MyDebugOptions

    Coin

    {-# OPTIONS --safe #-}
    open import Ledger.Prelude
    
    module Ledger.Conway.Specification.TokenAlgebra.Coin (X : Type) where
    
    open import Algebra.Morphism.Construct.Identity
      using (isMonoidHomomorphism)
    
    open import Ledger.Conway.Specification.TokenAlgebra.Base X
    
    open TokenAlgebra
    
    Coin-TokenAlgebra : TokenAlgebra
    Coin-TokenAlgebra = λ where
      .Value                      → Coin
      .Value-CommutativeMonoid    → it
        -- ^ Agda bug? Without this line, `coinIsMonoidHomomorphism` doesn't type check anymore
      .coin                       → id
      .inject                     → id
      .policies                   → λ _ → ∅
      .size                       → λ x → 1 -- there is only ada in this token algebra
      ._≤ᵗ_                       → _≤_
      .coin∘inject≗id             → λ _ → refl
      .coinIsMonoidHomomorphism   → isMonoidHomomorphism _ refl
    
    Previous
    Base
    Next
    ValueSet
    Made with Material for MkDocs