- Overview
- Tutorials
- Getting started
- Get started with Canton and the JSON Ledger API
- Get Started with Canton, the JSON Ledger API, and TypeScript
- Get started with Canton Network App Dev Quickstart
- Get started with smart contract development
- Basic contracts
- Test templates using Daml scripts
- Build the Daml Archive (.dar) file
- Data types
- Transform contracts using choices
- Add constraints to a contract
- Parties and authority
- Compose choices
- Handle exceptions
- Work with dependencies
- Functional programming 101
- The Daml standard library
- Test Daml contracts
- Next steps
- Application development
- Getting started
- Development how-tos
- Component how-tos
- Explanations
- References
- Application development
- Smart contract development
- Daml language cheat sheet
- Daml language reference
- Daml standard library
- DA.Action.State.Class
- DA.Action.State
- DA.Action
- DA.Assert
- DA.Bifunctor
- DA.Crypto.Text
- DA.Date
- DA.Either
- DA.Exception
- DA.Fail
- DA.Foldable
- DA.Functor
- DA.Internal.Interface.AnyView.Types
- DA.Internal.Interface.AnyView
- DA.List.BuiltinOrder
- DA.List.Total
- DA.List
- DA.Logic
- DA.Map
- DA.Math
- DA.Monoid
- DA.NonEmpty.Types
- DA.NonEmpty
- DA.Numeric
- DA.Optional
- DA.Record
- DA.Semigroup
- DA.Set
- DA.Stack
- DA.Text
- DA.TextMap
- DA.Time
- DA.Traversable
- DA.Tuple
- DA.Validation
- GHC.Show.Text
- GHC.Tuple.Check
- Prelude
- Smart contract upgrading reference
- Glossary of concepts
The Canton Quickstart example application¶
Business case¶
The Canton Quickstart contains an example application that provides both a demonstration of a Canton application targeted at production, and a way of exercising the supporting developer scaffolding provided by the bootstrap.
This example application is a simple license management application that allows the application provider to issue licenses to application users. Canton Coin is used in this transaction. These users are assumed to be retail customers of the provider, with access to Canton and a Canton Wallet. We do not assume they are running their any of their own infrastructure beyond a (possibly outsourced) validator node.
The relevant business entities are:
Amulet: An infrastructure token usable on the Canton synchronizer. In the case of an application using Canton Network, this is Canton Coin [4].
DSO Party: The Decentralized Synchronizer Operations Canton Party. This is the party that operates the Amulet token in which the provider accepts license payments. In the case of a Canton Network Application, this is the Global Synchronizer Foundation.
Application Provider: A Canton Party representing the legal entity deploying, running, and offering the application to their users (customers). In a licensing application, this is the entity offering to sell the licenses.
Application User: A Canton Party representing the legal entity that is a customer of the application provider. In this application this is an entity with a need to purchase a license, and periodically renew it. Canton Coin is exchanged for the license.
Core workflows happy path business requirement¶
Issuing a license¶
Given that an application user (app-user) has been onboarded to the licensing application
When the application provider (app-provider) instructs the application to create a new license for the app-user
Then a new expired license is created on the ledger and made visible to the app-user
Requesting a license renewal¶
Given an app-user has a license (l1)
And the current datetime is greater than the expiration date on license (l1)
When the app-provider instructs the application to request a license renewal
Then a license renewal is created and made visible to the user
And a matching amulet (Canton Coin) payment request is created on the ledger
Paying for a license renewal¶
Given there is a license renewal request on the ledger
And a matching amulet payment request on the ledger
When the user indicates they wish to pay the renewal
Then the user is redirected to the payment request in their wallet, and can approve the request
Renewing the license¶
Given an app-user has approved an amulet payment request associated with a license renewal request
And there is an AcceptedAppPayment contract (accepted-payment) on the ledger corresponding to that approval
When the app-provider instructs the application to complete the renewal transaction
Then the license is updated with a new expiration date = renewal duration + max (old expiration date, now)
And the app-provider exercises the AcceptedAppPayment_Collect choice on accepted-payment