Code Monkey home page Code Monkey logo

Comments (3)

habanoz avatar habanoz commented on May 26, 2024

Legitimate question.

Before discussing "why?" we need to understand that not all people trying to bake and use the software for payments are tech savvy. Even from the experienced peoples' standpoint, the application by nature has many configuration parameters which can easily be mistyped.

After dealing with many failure reports from users It was clear that the source of the problems for the majority of the cases was incorrect user input. This is why in V3 user input validation was put so much emphasis.

Each user input is validated against appropriate validation criteria. Most of the validation is put to payment address input because it was the source of the majority of the failure cases.

A payment address can be an alias or a PKH. It can be an implicit account or an originated contract. A payment address requires the secret key to be known so that transactions can be signed. Note that TRD does not do signing, tezos client does. So TRD does not need to know SK, but needs to check that it is known by the client. If payment address is an originated account, its manager account needs to be in the system; because manager signs for the originated account.

In order to make these checks, it is necessary to know:

  • list of addresses, aliases and SK status.
  • list of contracts and their aliases
  • manager of originated contracts

--
Another requirement is that public address of the payment account needs to be revealed. This check is based on tzscan data, because I do not know a way of getting it from client.

from tezos-reward-distributor.

habanoz avatar habanoz commented on May 26, 2024

There is a way to avoid TRD from querying account information.

Relevant information can be provided in master.yaml. Here I share an example master.yaml for those who are interested.

version : 2.0
managers: {
  "KT1EVBSE6cevRV8Uau2uySzjuYvWh7NDhnfy": "tz1YWn9eVvXuRkUxNwewVdYr71QKA8cr5Ane",
  "KT1eVBSE6cevRV8Uau2uySzjuYvWh7NDhnfy": "tz1yWn9eVvXuRkUxNwewVdYr71QKA8cr5Ane"
}
addresses_by_pkh: {
  "tz1YWn9eVvXuRkUxNwewVdYr71QKA8cr5Ane": {
    'alias': "mainnetme",
    "sk": true
  },
  "tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5": {
    'alias': "alphanet1",
    "sk": true
  },
  "tz1RW2P6sMLUMDVWimgYK6LDgsFfRALPEXik": {
    'alias': "alphanet2",
    "sk": true
  }
}

contracts_by_alias: {
  "pk1": "KT1EVBSE6cevRV8Uau2uySzjuYvWh7NDhnfy"
}

Note that this is for primarly testing porpuses. Input is not validated. If input is not correct TRD fails. Use of this method is neither suggested nor supported.

from tezos-reward-distributor.

utdrmac avatar utdrmac commented on May 26, 2024

Thanks for the explanation. As a fellow developer, I completely understand user mistypes are the common source of issues.

from tezos-reward-distributor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.