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

[Nakamoto] ATC-C MEV solution

Open jcnelson opened this issue 1 year ago • 9 comments

Implement the assumed total commit with carryover (ATC-C) Bitcoin MEV miner mitigation. See here (slide 12 and beyond) for details.

jcnelson avatar Nov 13 '23 18:11 jcnelson

@jcnelson I've just sent an email Jesse Sosslow with details around specific current and aspirational constraints for an MEV solution under Nakamoto and CC-ed you + the kinds of documentation we're interested in. Our big things are:

  1. Find a sortiton probability function that effectively hits the constraints.
  2. Define a procedure over which we can verify that it meets the constraints.

AshtonStephens avatar Jan 23 '24 14:01 AshtonStephens

The foundation will need to commission someone other than Jesse Sosslow to determine the final ATC approach, I'm putting together another ask today that's mostly the same as before but with a little more constraints so the new individual will be able to start from a nearly complete solution and just perform the analysis.

AshtonStephens avatar Jan 29 '24 16:01 AshtonStephens

The foundation's commissioned report isn't quite done yet, BUT the final equation from that analysis will recommend the approach in the original SIP, not including the logistic function.

The commissioned report will include recommendations for the constant parameters for the following:

  • The number of blocks N over which to take the median when calculating a denominator of max(median_total_commitment(N), current_total_commitment) for the sortition win probability of a miner.
  • The number of blocks J over which to take the median when calculating a numerator of min(median_commit(J), current_commitment)
  • The number of missed sortitions K over the span of L before a miner's win probability becomes 0 regardless of the other parameters.

This information should be enough to start on the code without the final values. Once the report is finished we can put in the permanent values.

AshtonStephens avatar Feb 12 '24 15:02 AshtonStephens

Met with contractor today, we will reconvene EOD Thursday EST to get a first draft of the analysis.

AshtonStephens avatar Feb 26 '24 23:02 AshtonStephens

The document we're getting is going more into previous behavior of Stacks and Bitcoin miners than analysis of the sortition algorithm. I'm going to put together a jupyter notebook that simulates the sortition behavior so the chain has that base covered.

AshtonStephens avatar Mar 04 '24 16:03 AshtonStephens

For reference, here is the commissioned report (link)

netrome avatar Mar 11 '24 15:03 netrome

For context @netrome, that is the old commissioned report, not the one commissioned for Nakamoto specifically to address the MEV issues with the new assumptions. The one we commissioned for Nakamoto didn't have the information required to address this ticket.

@netrome and I have looked into this in detail and have a report in a Jupyter notebook that we'll show to some core contributors later today or early tomorrow and will then consider it final.

AshtonStephens avatar Mar 14 '24 13:03 AshtonStephens

Pushed the report to a repo, finding the best method of sharing it

AshtonStephens avatar Mar 15 '24 14:03 AshtonStephens

The report is in a Stacks-Network repo and has the recommended constant configurations.

AshtonStephens avatar Mar 18 '24 12:03 AshtonStephens