0

Suppose that we need a token staking mechanism (similar to the stake and lock function introduced in the EOSIO training). Someone owns that contract. Now the question is:

  • How would the rest of the network trust the owner of this contract? What if they change the contract after tokens are staked and add them to their account?
4
  • 1
    You can multi sig the contract to trusted members of the community, or potentially even the block producer multi sig if the contract is core enough to the network like REX. But yes always remember, contracts handle requests to update the blockchain database. And the person holding the key can change the contract and thus the database at will if they like, obviously trust would be lost. This happened with eos tribe if I remember right. – Nat Mar 15 at 12:28
  • Thanks @Nat. What is block-producer multisig? Do you have a reference on that? I'd be happy to accept this as an answer, if you can provide further details. e.g. I understand how transactions can be multisig, but not the contracts (or block producers) – towi_parallelism Mar 15 at 13:46
  • 1
    eosio.prods @active bloks.io/account/eosio#keys everything is an account on EOS, a smart contract can only be deployed to an account, that account can have permissions set such as a multi sig, multi sigs are proposed to eosio.msig where others can then sign – Nat Mar 16 at 14:04
  • 1
    bloks.io/account/eosio.msig you can see who eosio.prods represents here bloks.io/account/eosio.prods#keys – Nat Mar 16 at 14:07
1

this was answered by the comments provided.

in short you can not trust fully the contract as long as the keys controlling the account to which the contract is deployed are still in the hands of a person.

the solution can do several things, two of them are mentioned below:

  1. You can multi sig the contract to trusted members of the community.
  2. You can resign the owner account of the contract to the eosio.msig just like it is done for eosio account when a new blockchain is spawned, see an example here.

credits should go to @Nat https://eosio.stackexchange.com/users/1049/nat

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.