MyBitFoundation / MyBit-Network.tech

🔷 The MyBit Network™ technology - Smart contracts and APIs to interact with the MyBit ecosystem
https://tech.mybit.io
GNU General Public License v3.0
20 stars 19 forks source link

Use days instead of blocks on MyBit Will #194

Closed mybit-bot closed 5 years ago

mybit-bot commented 5 years ago

Introduction: To enhance the user experience of MyBit Will (will.mybit.io) We want to replace the current method of verifying life based on Block numbers with number of days.

Current Behaviour: Choose in how many blocks one must verify they are alive.

Desired Behaviour: Choose an amount in days and the block number to distribute is calculated on the back-end without the user knowing. Requirements:

  1. Implement a "number of days" feature instead of inputting blocks
  2. Calculation of Block number for verification deadline should be done on the back-end.
  3. Anywhere on dApp that mentions Block # should be changed to date (such as on transaction and redeem page if applicable).

To Submit:

  1. Comment on task with a staging URL to get approval for design and placement.
  2. Please submit a pull request with the final version once complete.

Disclaimer All work completed via the MyBit Decentralised Development Fund is property of the MyBit Foundation (CHE-177.186.963) and may be used, re-used, and/or distributed, re-distributed by the MyBit Foundation for financial gain. The contributor holds no warrant nor claims for any future payments resulting from monetisation schemes originating from the MyBit Foundation or any of its affiliates. Where law permits outside of open source regulations, the contributor is not permitted to distribute any work completed via the MyBit Decentralised Development Fund (DDF) for personal gain.

StevenJNPearce commented 5 years ago
  1. Calculation of Block number for verification deadline should be done on the back-end.

@mybit-bot @jjperezaguinaga Could you please clarify this requirement, as is this application doesn't appear to have a backend currently (other than the smart contracts/blockchain) How would you like the backend implemented? A simple node app with a single GET endpoint returning number of blocks for a given number of days is ok?

Edit: Thinking on this further, it needs the contracts updating to use block.timestamp instead of block number, so that things don't go wrong with the ice-age and/or future hard forks that change the average blocktime.

cryptnotiq commented 5 years ago

@csmartinsfct @jjperezaguinaga can one of you respond to ^^

csmartinsfct commented 5 years ago

@StevenJNPearce the term backend was somewhat misused there, it basically means the number of days is automatically calculated by the dApp.

Regarding your edit, good point. @kyledewy can you comment on that?

0xdewy commented 5 years ago

Yaa it should definitely be using timestamp. Block number is always an approximation based on recent network usage, so it would be the same case after a hard fork. Timestamp is a better option for this dapp, since there doesn't seem to be much incentive for miners to adjust the blocks timestamp.