|
| 1 | +.. |
| 2 | + Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. |
| 3 | +.. |
| 4 | + SPDX-License-Identifier: Apache-2.0 |
| 5 | +
|
| 6 | +.. _feat_app_act_marker_tokenomics: |
| 7 | + |
| 8 | +Featured Application Activity Marker |
| 9 | +************************************ |
| 10 | + |
| 11 | +The *featured application activity marker* is specified in |
| 12 | +`CIP 47 <https://github.com/global-synchronizer-foundation/cips/blob/main/cip-0047/cip-0047.md>`__. A summary follows. |
| 13 | + |
| 14 | +Featured application activity markers |
| 15 | +(:ref:`FeaturedAppActivityMarker <type-splice-amulet-featuredappactivitymarker-16451>`) |
| 16 | +can be created for a transaction that adds value |
| 17 | +but does not involve a CC Transfer (e.g., a stable coin transfer or the settlement of a trade). |
| 18 | +`CIP 47 <https://github.com/global-synchronizer-foundation/cips/blob/main/cip-0047/cip-0047.md>`__ says: |
| 19 | + |
| 20 | + Featured application providers are expected to create featured application activity markers only for transactions that |
| 21 | + correspond to a transfer of an asset, or an equivalent transaction, which was enabled by the application provider. |
| 22 | + The detailed fair usage policy and enforcement thereof is left up to the Tokenomics Committee of the Global Synchronizer Foundation (GSF). |
| 23 | + |
| 24 | +Generally the guidance is to create a ``FeaturedAppActivityMarker`` for any economically important event, such as: |
| 25 | + |
| 26 | +- Lock or unlock a Real World Asset (RWA). |
| 27 | + |
| 28 | +- Transfer a RWA. |
| 29 | + |
| 30 | +- Mint or burn tokens. |
| 31 | + |
| 32 | +However, it should not be created for any intermediate steps or a `propose step <https://docs.digitalasset.com/build/3.3/sdlc-howtos/smart-contracts/develop/patterns/propose-accept.html>`__. |
| 33 | + |
| 34 | +A ``FeaturedAppActivityMarker`` is immediately converted into an |
| 35 | +:ref:`AppRewardCoupon <type-splice-amulet-apprewardcoupon-57229>` by the automation run by the Super Validators. |
| 36 | +The :ref:`AppRewardCoupon <type-splice-amulet-apprewardcoupon-57229>` |
| 37 | +is created with the DSO as the ``signatory`` and the ``provider`` field |
| 38 | +as an observer. By default, the ``provider`` can mint CC in the minting |
| 39 | +step. The ``featured`` field is set to ``true`` to indicate eligibility to |
| 40 | +receive featured application rewards, based on a :ref:`FeaturedAppRight <type-splice-amulet-featuredappright-765>` contract. |
| 41 | + |
| 42 | +There can be several ``FeaturedAppActivityMarkers`` per transaction tree |
| 43 | +which increases the total reward. However, this is only allowed for composed transactions (e.g. a settlement transaction) where trading |
| 44 | +venue and all the registries of the transferred assets would get featured app rewards. It is also possible for a single |
| 45 | +Canton transaction tree to include |
| 46 | +:ref:`ValidatorRewardCoupon <type-splice-amulet-validatorrewardcoupon-76808>`, |
| 47 | +an |
| 48 | +:ref:`AppRewardCoupon <type-splice-amulet-apprewardcoupon-57229>` |
| 49 | +and a |
| 50 | +:ref:`FeaturedAppActivityMarker <type-splice-amulet-featuredappactivitymarker-16451>`\ (s) |
| 51 | +if there are sub-transcations that create each separately. |
| 52 | + |
| 53 | + |
| 54 | +A non-featured app cannot accrue a ``FeaturedAppActivityMarker``. |
| 55 | + |
| 56 | +Creating a Featured Application Activity Marker |
| 57 | +*********************************************** |
| 58 | + |
| 59 | +There are two prerequisites for an application to create a |
| 60 | +``FeaturedAppActivityMarker``. The first is to become an approved featured |
| 61 | +application which was described in the |
| 62 | +:ref:`types_of_activity_records` |
| 63 | +section. The second is to update the application code: |
| 64 | + |
| 65 | + 1. Find the fully qualified package-id of the interface definition for the |
| 66 | + :ref:`FeaturedAppRight <type-splice-api-featuredapprightv1-featuredappright-34177>` |
| 67 | + interface which is |
| 68 | + ``7804375fe5e4c6d5afe067bd314c42fe0b7d005a1300019c73154dd939da4dda:Splice.Api.FeaturedAppRightV1:FeaturedAppRight`` |
| 69 | + for ``Splice.Api.FeaturedAppRightV1``. The command ``daml damlc |
| 70 | + inspect-dar`` can be used to find this. |
| 71 | + |
| 72 | + 2. Query the ledger using this ID to retrieve contracts from the Daml |
| 73 | + ledger that implement the |
| 74 | + :ref:`FeaturedAppRight <type-splice-api-featuredapprightv1-featuredappright-34177>` |
| 75 | + interface. The ``curl`` example below illustrates this approach. |
| 76 | + |
| 77 | + .. code-block:: bash |
| 78 | +
|
| 79 | + curl "http://$lapiParticipant/v2/state/active-contracts" \ |
| 80 | + "$jwtToken" "application/json" \ |
| 81 | + --data-raw '{ |
| 82 | + "filter": { |
| 83 | + "filtersByParty": { |
| 84 | + "'$holderPartyId'": { |
| 85 | + "cumulative": |
| 86 | + [ |
| 87 | + { |
| 88 | + "identifierFilter": { |
| 89 | + "InterfaceFilter": { |
| 90 | + "value": { |
| 91 | + "interfaceId": "'7804375fe5e4c6d5afe067bd314c42fe0b7d005a1300019c73154dd939da4dda:Splice.Api.FeaturedAppRightV1:FeaturedAppRight'", |
| 92 | + "includeInterfaceView": true, |
| 93 | + "includeCreatedEventBlob": false |
| 94 | + } |
| 95 | + } |
| 96 | + } |
| 97 | + } |
| 98 | + ]} |
| 99 | + } |
| 100 | + }, |
| 101 | + "verbose": false, |
| 102 | + "activeAtOffset":"'$latestOffset'" |
| 103 | + }' |
| 104 | +
|
| 105 | + 3. The application's Daml code will have to depend on the ``splice-api-featured-app-v1.dar`` and take an argument of type ``ContractId FeaturedAppRight`` on the choice |
| 106 | + whose execution should be featured, which allows that choice's body to call the ``FeaturedAppRight_CreateActivityMarker`` in the next step. |
| 107 | + |
| 108 | + 3. In the application's Daml code, using the ``FeaturedAppRight`` interface, exercise |
| 109 | + the ``FeaturedAppRight_CreateActivityMarker`` choice. Set the |
| 110 | + ``templateId`` to the fully qualified interface ID above. |
| 111 | + |
| 112 | + 4. For testing examples, please review the example DamlScript test |
| 113 | + `here <https://github.com/hyperledger-labs/splice/blob/a32995a0df2d447b9e76d81b770a06c296295ab5/daml/splice-dso-governance-test/daml/Splice/Scripts/TestFeaturedAppActivityMarkers.daml#L4>`__. |
| 114 | + |
| 115 | +Consider a single, simple transaction of a RWA which creates a single |
| 116 | +``FeaturedAppActivityMarker`` activity record for one ``provider`` and |
| 117 | +the ``beneficiary`` is the ``provider``: |
| 118 | + |
| 119 | + 1. A :ref:`FeaturedAppActivityMarker <type-splice-amulet-featuredappactivitymarker-16451>` contract is created in the business transaction. The |
| 120 | + ``provider`` is set to the featured application provider's party. The ``beneficiary`` must be set (unlike an |
| 121 | + :ref:`AppRewardCoupon <type-splice-amulet-apprewardcoupon-57229>`) to the party that should be eligible to mint the CC for that activity. The ``provider`` field of the |
| 122 | + FeaturedAppActivityMarker is set by calling the interface choice :ref:`FeaturedAppRight_CreateActivityMarker <type-splice-api-featuredapprightv1-featuredapprightcreateactivitymarker-36646>`. |
| 123 | + |
| 124 | + 2. No ``ValidatorRewardCoupon`` is created. |
| 125 | + |
| 126 | + |
| 127 | +It is possible to share the attribution of activity for the ``FeaturedAppActivityMarker``. The |
| 128 | +``FeaturedAppRight_CreateActivityMarker`` choice accepts a list of |
| 129 | +:ref:`AppRewardBeneficiary <type-splice-api-featuredapprightv1-apprewardbeneficiary-32645>` |
| 130 | +contracts. Then a ``FeaturedAppActivityMarker`` is created for each |
| 131 | +``beneficiary`` with the ``weight`` field set appropriately. |
| 132 | + |
| 133 | + |
0 commit comments