oxen-core icon indicating copy to clipboard operation
oxen-core copied to clipboard

transaction generated for stake unlock

Open darcys22 opened this issue 4 years ago • 2 comments
trafficstars

Addressing #1351

So I've modified the unlock transaction to include a transaction sent to the users own address.

Attempting to resolve the issue using the second option:

Require that unlock txes have an output, and thus also a fee. Thus an unlock would now have 1-output back into the originating wallet, which would make the wallet see it.

However I am also of the opinion that the 3rd option of adding a burned amount to each stake unlock is a good idea.

Could I get some feedback on if this is the right path to be taking to generate an output for the unlock stake transaction?

darcys22 avatar Nov 30 '20 00:11 darcys22

Have updated with the comments, few notes:

  1. Added the UNSTAKE_BURN_FIXED constant to oxen_economy.h and created a new section to store staking fees constants. I saw a note on the get_staking_requirement() function in service_node_rules.cpp that it should be moved to oxen_economy also. It currently has a lot of tests for fork versions which might be due for removal in the next hard fork which would simplify it and make it easier to move here also
  2. I've added the burn amount to the tx_params but unsure if this is the only step (Does an amount also need to be added to the amount field to account for this burn fee?
  3. To check that the burn was included there is already a function in blockchain.cpp Blockchain::check_fee() does this handle the check or will an additional check be needed?

darcys22 avatar Jan 12 '21 04:01 darcys22

I think we should hold off on merging this PR until post-HF. It really is something that goes along with https://github.com/oxen-io/oxen-improvement-proposals/issues/27 which is slated for the next PR.

jagerman avatar Apr 07 '21 21:04 jagerman