The gov proposal has been submitted in Koinos mainnet

in #koinos6 months ago

koinos proposal.png

Hello Koinos Community, the onchain governance proposal to add a new system call has been submitted in Koinos mainnet.

This proposal has been widely discussed in the community and reviewed by several devs, including Michael Vandeberg from Koinos Group.

What is this new system call?

This new system call is called get_contract_metadata and it is used to classify addresses by type: normal wallets / smart contract wallets.

Why is this necessary in Koinos?

Right now Koinos has 2 token standards, and both of them have some problems/limitations:

  1. KCS-1: This is the token standard used in KOIN and VHP contracts. It is designed to support smart contract wallets, which is very good. However, its design put normal wallets in a vulnerable position each time they interact with any contract: The tokens can be transferred without an explicit confirmation from the user, which is a critical security issue.
  2. KCS-2?: This token standard introduces allowances like the ones implemented in the ERC-20 contracts from Ethereum. Thanks to this improvement, the normal wallets are more protected. However, this standard does not take into account smart contract wallets. They do not support the authorize function.
    (Btw, I still don't know how to name this standard. I named it "KCS-2?" because it is similar to KCS-2, but without the NFT features).

As you can see both standards have problems. Thanks to this new get_contract_metadata system call we will be able to create a new token standard (KCS-3?) that will have the best two worlds: Allowances to protect normal accounts, and support of the authorize function for smart contract wallets.

To know more technical details please refer to the links at the end of the post.

Governance Proposal

The proposal has been submitted in koinos mainnet. This is the transaction:
https://koinosblocks.com/tx/0x1220879d80eda7fb967db3596395e487e53b8d00144d2d598f8723afa3f4d6f52f0e

The visualization in koinosblocks is not good enough, so I will put here a summary of the operations in this proposal:

{
  operations: [
    // set new contract as system contract
    {
      set_system_contract: {
        contract_id: "1C7JtWik7fTDD5r6B8n1HsU26s5M9qYp7i",
        system_contract: true
      }
    },

    // assign the ID 112 to this new contract
    // and define the entry point of the contract
    {
      set_system_call: {
        call_id: 112,
        target: {
          system_call_bundle: {
            contract_id: "1C7JtWik7fTDD5r6B8n1HsU26s5M9qYp7i",
            entry_point: 2018486792
          }
        }
      }
    },

    // create a new record in the name-service contract:
    // link the new contract with the name get_contract_metadata
    {
      call_contract: {
        contract_id: "19WxDJ9Kcvx4VqQFkpwVmwVEy1hMuwXtQE",
        args: {
          name: "set_record",
          args: {
            name: "get_contract_metadata",
            address: "1C7JtWik7fTDD5r6B8n1HsU26s5M9qYp7i"
          }
        }
      }
    }
  ],
  operation_merkle_root: "...",

  // fee required to submit this proposal
  fee: "4000000000",
}

The new contract is 1C7JtWik7fTDD5r6B8n1HsU26s5M9qYp7i. I also created a nickname for it https://koinosbox.com/nicknames/@get-contract-metadata.

That contract was uploaded in the transaction https://koinosblocks.com/tx/0x1220af4322873a2e669d0d313c4d7ccb5c2a7f82b82b7d93b4457fafc468a1aecd79 and it has the following properties:

sha-256: "7e4192b4a84103dbc4de674a730a49b9028b56f54a99424311de7457ab74467f",
authorizes_call_contract: true,
authorizes_transaction_application: true,
authorizes_upload_contract: true

meaning that I don't have control over this contract anymore. The sha-256 checksum can be verified by compiling the code of this commit: 9e1437 (with koinos-sdk-as-cli v0.1.16).

How to vote

Configure your block producer to vote for this proposal in this way:

block_producer:
  ...
  approve-proposals:
    - 0x1220ba989e81208986961f0063493e28c6a6cad9c6b51e2b981b0a6811392b366639

You can check the status and current votes in the governance contract.

Timings

2023-12-06 - 01:04: Submission of the proposal. Block producers configure their nodes to vote.
2023-12-13 - 01:04: Vote counting begins.
2023-12-27 - 01:04: Vote counting ends.
2024-01-03 - 01:04: Proposal is applied if passes the threshold of 60% of votation.

Related links

Sort:  

There's more proper visualization of the proposal (not ideal but still): https://koinosblocks.com/proposal/0x1220ba989e81208986961f0063493e28c6a6cad9c6b51e2b981b0a6811392b366639

Many thanks!