xGov Pilot - Integration
Abstract
Section titled “Abstract”This ARC aims to explain how the xGov process can be integrated within dApps.
Motivation
Section titled “Motivation”By leveraging the xGov decentralization, it can improve the overall efficiency of this initiative.
Specification
Section titled “Specification”The keywords “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC-2119.
How to register
Section titled “How to register”How to find the xGov Escrow address
Section titled “How to find the xGov Escrow address”The xGov Escrow address can be extracted using this endpoint: https://governance.algorand.foundation/api/periods/active/.
{ ... "xgov_escrow_address": "string", ...}Registration
Section titled “Registration”Governors should specify the xGov-related fields. Specifically, governors can sign up to be xGovs by designating as beneficiaries the xGov escrow address (that changes from one governance period to the next). They can also designate an xGov-controller address that would participate on their behalf in xGov votes via the optional parameter “xGv”:“aaa”. Namely, the Notes field has the form.
af/gov1:j{“com”:nnn,“mmm1”:nnn1,“mmm2”:nnn2,“bnf”:“XYZ”,“xGv”:“ABC”} Where:
“com”:nnn is the Algo commitment; “mmm”:nnn is a commitment for LP-token with asset-ID mmm; “bnf”:“XYZ” designates the address “XYZ” as the recipient of rewards (“XYZ” must equal the xGov escrow in order to sign up as an xGov); The optional “xGv”:“ABC” designates address “ABC” as the xGov-controller of this xGov account.
Goal example
Section titled “Goal example”goal clerk send -a 0 -f ALDJ4R2L2PNDGQFSP4LZY4HATIFKZVOKTBKHDGI2PKAFZJSWC4L3UY5HN4 -t RFKCBRTPO76KTY7KSJ3HVWCH5HLBPNBHQYDC52QH3VRS2KIM7N56AS44M4 -n
‘af/gov1:j{“com”:1000000,“12345”:2,“67890”:30,“bnf”:“DRWUX3L5EW7NAYCFL3NWGDXX4YC6Y6NR2XVYIC6UNOZUUU2ERQEAJHOH4M”,“xGv”:“ALDJ4R2L2PNDGQFSP4LZY4HATIFKZVOKTBKHDGI2PKAFZJSWC4L3UY5HN4”}’
How to Interact with the Voting Application
Section titled “How to Interact with the Voting Application”How to get the Application ID
Section titled “How to get the Application ID”Every vote will be a different ID, but search for all apps created by the used account and look at the global state to see if is_bootstrapped is 1.
The ABI is available here . A working test example of how to call application’s method is here: https://github.com/algorandfoundation/nft_voting_tool/blob/main/src/algorand/smart_contracts/tests/voting.spec.ts
Rationale
Section titled “Rationale”This integration will improve the usage of the process.
Backwards Compatibility
Section titled “Backwards Compatibility”None
Security Considerations
Section titled “Security Considerations”None
Copyright
Section titled “Copyright”Copyright and related rights waived via CCO.