{"id":24803036,"url":"https://github.com/mlabs-haskell/agora-drep","last_synced_at":"2026-01-29T23:32:34.355Z","repository":{"id":274892048,"uuid":"924401402","full_name":"mlabs-haskell/agora-drep","owner":"mlabs-haskell","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-25T12:51:17.000Z","size":2533,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-01-26T04:17:29.621Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://mlabs-haskell.github.io/agora-drep/static/agora-drep-specification.pdf","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlabs-haskell.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-29T23:41:36.000Z","updated_at":"2026-01-12T13:59:36.000Z","dependencies_parsed_at":"2025-01-30T01:18:25.254Z","dependency_job_id":"258ad562-96d9-47a7-bcd6-839f182c4c3c","html_url":"https://github.com/mlabs-haskell/agora-drep","commit_stats":null,"previous_names":["mlabs-haskell/agora-drep"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mlabs-haskell/agora-drep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabs-haskell%2Fagora-drep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabs-haskell%2Fagora-drep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabs-haskell%2Fagora-drep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabs-haskell%2Fagora-drep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlabs-haskell","download_url":"https://codeload.github.com/mlabs-haskell/agora-drep/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabs-haskell%2Fagora-drep/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28890349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T21:06:44.224Z","status":"ssl_error","status_checked_at":"2026-01-29T21:06:42.160Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-30T05:17:06.291Z","updated_at":"2026-01-29T23:32:34.348Z","avatar_url":"https://github.com/mlabs-haskell.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agora DRep Governance Effects\n\n## Introduction\n\nThis repository contains the source code for a new set of Plutus scripts that\nallow [the Agora governance system](https://github.com/Liqwid-Labs/agora)\nto participate in Cardano governance proposals (see\n[Cardano Governance](https://cardano.org/governance/)).\n\nThe general use case these scripts enable is the creation and handling of fully\nautomated, on-chain DReps that can vote on _pre-existing_ Cardano Governance\nproposals (the creation of proposals is not supported).\n\nThe policy that decides when or how the DRep votes is not given, which allows\nan Agora-based system to implement any suitable policy they desire. There already is\nan implementation of an automatic DRep for Agora DAOs created with\n[Clarity](https://www.clarity.vote/). See the [references](#references) at the end\nof the page for more information on this.\n\nIn this document, an overview of the different scripts is given as well as instructions\non how to deploy them. At the end, two use cases are explained and references are provided\nfor more documents and websites of interest.\n\n## Keywords\n\nThe following terms are used in the document:\n\n* _Agora system_: any governance system implemented using the set of governance\n  modules provided by [Agora](https://github.com/Liqwid-Labs/agora/tree/staging).\n\n* _Agora DAO_: A specific Agora system implemented by [Clarity](https://www.clarity.vote).\n\n* _DRep_: An actor in Cardano's governance system which can author and vote on\n  Cardano governance proposals.\n\n* _Authority token / GAT_: A utility token created automatically by an Agora\n  system. These serve as \"keys\" that allow the execution of interesting on-chain\n  effects and, in secure Agora systems, **represent the explicit approval of the\n  Agora system's members**.\n\n* _Effect / Effect script_: A script that is executed **only** when a an authority\n  token is burned and which performs the desired actions of the Agora system's users.\n\n## Overview\n\n### The scripts\n\nThis repository contains the source code for three Plutus scripts:\n\n* **The voting script**, which is [an Agora effect](https://liqwid.notion.site/Effects-3364731305544dc1972221b6d1353a69).\n\n  This script is the one responsible for validating that the DRep votes as\n  intended by the Agora system.\n\n* **The proxy script**, that behaves as a compatibility wrapper.\n\n  The need for this script is explained in detail in the technical specification of\n  this repository.\n\n* **The PlutusV3 authority token script**, which is needed for the\n  \"GAT upgrade\" process. This is again explained in the technical specification, but\n  not strictly needed to implement the effect creation and execution process.\n\nThe source code of these scripts may be found under the `agora-drep` directory.\n\n### The intended use of the scripts\n\nAs explained in the Agora documentation and the technical specifications, the voting\nscript, proxy script and PlutusV3 version of the GAT minting policy are designed\nto be used in tandem.\n\nThe intended use of the scripts pre-suppose the following:\n\n* _An Agora-based governance system exists_, allowing a set of actors to\n  propose actions (implemented as Agora effects) and jointly choose to execute them\n  or reject them (via any mechanism or policy of their choice).\n\n* _The participants of this Agora system choose to delegate some or all of their\n  ADA to the automated DRep_.\n\nWith these two pre-requisites in mind, the scripts may be used in the following way:\n\n1. **DRep creation**: the automated DRep is created in the same way a human DRep is registered,\n   with the difference that the DRep voting credential used is the **credential that corresponds\n   to the voting script**.\n\n2. **Fund delegation to the DRep**: users of the Agora governance system can delegate their\n   funds to the automated DRep. A treasury may be used (like Clarity's Agora DAOs\n   do) or delegation may be achieved through other mechanisms.\n\n3. **Cardano governance proposal vote**: users of the Agora system can make the automated\n   DRep vote on a Cardano governance proposal by performing the following steps:\n\n    1. Create a Proxy effect, containing a Voting effect inside (proxy effects function as\n       wrappers). The voting effect must refer to the governance action to vote in and\n       the specific vote to cast (Yes, No, Abstain). Consult the Haddock documentation for\n       more information on the format of the Proxy and Voting datums.\n\n    2. Choose whether to execute the proxy-voting effect using the appropriate mechanisms\n       the Agora system has. For example, Clarity's Agora DAOs users vote by using a specific\n       currency.\n\n    3. Execute the proxy effect. As a result of the previous step, an effect\n       UTxO holding a GAT should exist. Furthermore, the UTxO should have as a\n       datum the proxy-voting effect the Agora system has chosen.   \n\n    4. Execute the voting effect. As a result of the previous step, an effect UTxO\n       holding a new GAT should exist. The UTxO should have as a datum the voting\n       effect chosen.\n       After the execution of this last effect, the actual voting on the Cardano\n       governance proposal will have been performed by the automated DRep.\n\n## Setup and deployment\n\n### Serialization of the scripts\n\nAll scripts can be serialized by running the export executable:\n\n```bash\n$ cabal run agora-drep-script-export\n```\n\nThis will create a `scripts` folder (if one does not exist already). Therein the\nscripts for the new proxy and voting effects may be found in binary format:\n\n```bash\n$ tree scripts\nscripts/\n└── agora\n    ├── proxyScript.bin\n    ├── proxyScript.debug.bin\n    ├── votingEffectScript.bin\n    └── votingEffectScript.debug.bin\n````\n\n### Script instantiation / applying arguments\n\nAssuming an Agora system already exists, the handling of the new Proxy and Voting\neffects is not different from other Agora effects.\n\nConsult the Haddock documentation of the [Proxy effect](https://mlabs-haskell.github.io/agora-drep/haddock/Agora-Proxy.html) and [Voting effect](https://mlabs-haskell.github.io/agora-drep/haddock/Agora-Effect-Voting.html)\nto see the function signature of both effects.\n\nSpecifically, both effects (like all Agora effects) are parameterized by\nthe `CurrencySymbol` of the enabling GAT, which will depend on the specific\nAgora system in use. Therefore, the scripts **must** have this argument applied\nbefore being used.\n\n### Creating an effect UTxO\n\nFor effect creation, consult the definition of the datum types of the scripts:\n\n* [ProxyDatum](https://mlabs-haskell.github.io/agora-drep/haddock/Agora-Proxy.html#t:ProxyDatum)\n* [VotingDatum](https://mlabs-haskell.github.io/agora-drep/haddock/Agora-Effect-Voting.html#t:VotingDatum)\n\nFor creating a voting effect, the following requirements must be met:\n\n* A UTxO **must** be created at the address of the desired effect.\n* The UTxO **must** contain a valid datum according to the data definitions linked previously\n  (i.e: the datum must be of type `VotingDatum`).\n* The UTxO **must** contain a valid GAT.\n\nAny failure to comply with these will make the UTxO unspendable.\n\n### Executing the effect\n\nFor a detailed guide on how effects are executed on Agora based systems, consult\nthe following Notion documentation:\n\n* [Effects](https://liqwid.notion.site/Effects-3364731305544dc1972221b6d1353a69)\n* [Authority Tokens](https://liqwid.notion.site/Authority-Tokens-b25d2011c8114e04ac9e73514e6b9421)\n\nThe voting script cannot be executed directly by a typical Agora system due to\nPlutusV2/PlutusV3 incompatibilities. This means a more involved process is required\nfor creation and execution of the effect.\n\nIn a previous [section](#the-intended-use-of-the-scripts), this process is sketched.\n\nAgain, for more information on this, consult the technical specification, where\nspecific interactions between the Voting, Proxy and Minting scripts are thoroughly\ndocumented.\n\nHowever, for the purposes of implementing effect creation and execution, any already\nexiting Agora based system should be able to support the new voting effect:\n\n* The voting effect creation works exactly the same (just the datum and effect address\n  are different)\n* The voting effect execution works similarly, but now two executions are required: one\n  for the proxy effect, and another for the proper voting effect.\n\n## Examples\n\n\u003e Use case: an Agora DAO delegates the ADA contained in its treasury to an automated DRep,\n\u003e which can subsequently vote on Cardano governance proposals **when and only when** the\n\u003e DAO members wish it to do so.\n\nThis use case is already implemented in [Clarity](https://www.clarity.vote), but let's see\nhow it can be achieved with the work provided here:\n\n* Agora DAOs have treasuries, with a specific associated payment and staking address.\n\n* Upon creation, Agora DAOs may choose to delegate all ADA contained in the treasury\n  address to an automated DRep. The DRep credential is derived from the voting script\n  contained in this repository.\n\n* The voting script is parameterized by a GAT which can only be minted when the DAO\n  agrees by majority to execute an on-chain effect.\n\n* Any DAO member may create proposals (which are different from Cardano governance proposals!)\n  that, when passed, will create a Proxy-Voting effect that can be executed.\n\n* Any Cardano user may execute the effect after it was created. When the effect\n  is executed, the automated DRep votes as the effect specifies.\n\nThis is a very elaborate use case, but simpler ones are also possible.\n\n\u003e Use case: a group of users decide to pool their ADA in a single, multi-signature address.\n\u003e They collectively decide to delegate the ADA in the address to an automated DRep, which\n\u003e will vote as they wish.\n\nLet's see how this can work:\n\n* Alice, Bob and Adam pool their ADA in a single, multi-signature address. Funds\n  under this address cannot be spent or delegated without (at least) 2 out of 3\n  signatures. \n\n* They all choose to delegate the ADA under this address to an automated DRep,\n  whose credential is derived from the voting script.\n\n* The voting script is parameterized by a GAT with a currency symbol corresponding\n  to _another_ multi-signature script. This GAT cannot be minted without (at least)\n  2 out of 3 signatures.\n\n* Alice wishes the DRep to vote 'Yes' on a recent Cardano governance proposal, so she\n  builds a transaction that:\n\n  * Creates a voting effect UTxO with the desired vote outcome (i.e: cast 'Yes' on\n    the desired proposal).\n  * Mints the required GAT and places it in the same UTxO. This is required to actually\n    execute the voting effect.\n\n* Alice pays the fees out of her own pocket, so there is no need to spend from the\n  multi-signature address that she shares with Bob and Adam.\n\n  But since she still wants to mint the GAT, and the GAT requires 2 out of 3 signatures,\n  she needs someone else to sign the transaction too. Fortunately, she convinced Bob\n  too, so she sends the partially signed transaction to Bob to meet the minimum threshold\n  of 2 signatures, and finally Bob submits the transaction.\n\n* Because Alice already paid for the fees of the effect creation, Bob decides to pay for the\n  effect execution. He builds a transaction that spends the effect UTxO and also\n  submits the desired 'Yes' vote on the Cardano governance proposal. He will also require\n  the signature of Alice (or Adam), because the GAT must be burnt. Once the TX is fully\n  signed, Alice submits the final transaction and the process ends with a successful\n  Cardano governance vote.\n\nThis is a simpler use case than the previous one, because a full DAO is not required and\nall the logic is implemented with Cardano native scripts.\n\n## References\n\nPlease consult the following documents for more information about specific topics:\n\n- For a full, technical specification of the developed scripts: [Specification](./specification)\n- For the documentation of the API: [Haddock documentation](https://mlabs-haskell.github.io/agora-drep/haddock/)\n- For more information about the Agora system: [Agora repository](https://github.com/Liqwid-Labs/agora)\n- For a specificaction of the Agora system: [Agora specification](https://liqwid.notion.site/Agora-Specs-Overview-fd7df78313cf4dc0b1522cb9260b77d1)\n- For more information on how to use an Agora DAO as a DRep: [Clarity's \"Agora DAO as a DRep\"](https://docs.clarity.vote/clarity-v1/agora-dao-as-a-drep)\n- [Catalyst Benchmark / Feature demo](https://youtu.be/PDtfe4f0aUA)\n- [Catalyst Closeout report](./website/closeout-report.pdf)\n- [Catalyst Closeout video](https://youtu.be/2RtffHLBsZ8)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlabs-haskell%2Fagora-drep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlabs-haskell%2Fagora-drep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlabs-haskell%2Fagora-drep/lists"}