Hi. This is an alternative proposal to this. It will be a faster and cheaper method to implement dynamic fees into NuDroid but is pending the “getfee” RPC command in Nu 2.1, and requires reliance on a server for every transaction. I’ve gone into detail about what it will involve.
Amount: 1,600 NBT
This proposal will allow the correct fee to be used in NuDroid for the 2.0 protocol. It may work with the future 3.0 protocol, but this is not guaranteed. It involves the following tasks and changes:
- To create a new python wsgi script to provide NuBits fees. The script will take “application/x-www-form-urlencoded” POST data with the arguments “bytes” and “amount”. The “bytes” argument shall be the size of the transaction in bytes, and the “amount” argument shall be formatted with 4 decimal places. Using the “getfee” RPC command from Nu 2.1 onwards, the script will respond with the fee in units as a numerical string.
- Have the new script deployed on the “Default - Explorer” server, and potentially on “Default - Anton” with the collaboration of @willy
- The application will assume that the “amount” parameters should be the total value of all outputs in a transaction. It is assumed that this logic will likely achieve the correct fee with the future 3.0 protocol, although it is not guaranteed.
- To alter the fee calculation in NuDroid to first estimate coin selection with an assumed 0.01nbt fee. Then the app should make a server request for the fee. The coin selection should be reapplied. If there is a change in the transaction size as a multiple of 1000 bytes, another request should be made to the server to obtain the new fee. The process may be repeated until the fee is satisfied.
- When requesting fees, the app should try all of the trusted servers with “/getfee” appended to the URL and use the fee of the first server that responds.
- The app should give the error “Cannot obtain fee from servers” if there is an error obtaining the fees.
This update shall be released no later than 2 weeks after the grant is passed, however efforts will be made to release earlier than this if possible. If the update is not released by this time, the entire grant amount shall be burned.
The update will be released under version 4.4 on Google Play.