bisq-network / proposals

@bisq-network improvement proposals
https://bisq.wiki/Proposals
44 stars 16 forks source link

Proposal to analyze blockchain data of Bisq trades to report on failed trades, arbitration instances and long-term locked funds #352

Closed pazza83 closed 2 years ago

pazza83 commented 2 years ago

This is a Bisq Network proposal. Please familiarize yourself with the submission and review process.

This is a proposal for myself to analyze the blockchain data for 200 historic trades with fees paid with BSQ and 200 historic trades with fees trades paid with BTC to answer the following questions:

Problem

Currently the following are unknown:

Methodology

Outcome

I will provide a summary report under this proposal detailing answering the above questions and suggesting any relevant data. I will also include any observations / suggestions as necessary.

Cost

I will request $500 USD worth of BSQ for completing the above.

I think the above would be good to implement. If anyone has any data they think I should also collect then please let me know. Also I plan to do this manually so if anyone thinks there is a way to do this quicker via a script etc, or for lower cost, please let me know.

pazza83 commented 2 years ago

Just wanted to outline my definitions of failed trades.

Failed on-chain failed trades

My definitions of a on-chain failed trade for the purposes of this specific proposal is:

A failed on-chain trade is occurs when something in a users instance of Bisq is not functioning properly that results in one or any of the following on-chain events NOT occurring:

  1. Maker fee transaction ID created
  2. Taker fee transaction ID created
  3. Deposit transaction ID created
  4. For trades that have a Deposit transaction ID created they should also have a Delayed payout transaction ID created OR
  5. Taker payout address transaction ID created AND Maker payout address transaction ID created

As a failed trade results in something NOT occurring it not possible on-chain to identify it if is a case of:

The idea of going back to a chain height of 703000 means that I will be balancing looking at trades from fairly recently (October 2021), important for making sure most trades will have been completed with a fairly recent version of Bisq, whilst reducing the instances of trades being in a pending progress. This can be further accounted for by revisiting on-chain data at a later time.

Failed security related failed trades

My definitions of a Security related failed trade for the purposes of this specific proposal is:

A failed security related trade occurs when something in a users instance of Bisq is not functioning properly, or has been intentionally changed so that it results in one or any of the following on-chain events occurring:

  1. For trades that have a Deposit transaction ID created and have a singular payout address that is different from 34VLFgtFKAtwTdZ5rengTT2g2zC99sWQLC, 3EtUWqsGThPtjwUczw27YCo6EWvQdaPUyp, 3A8Zc1XioE2HRzYfbb5P8iemCS72M6vRJV, 38bZBj5peYS3Husdz7AH3gEUiUbYRD951t, or 34VLFgtFKAtwTdZ5rengTT2g2zC99sWQLC.
  2. For trades that have a Deposit transaction ID created and have three or more payout addresses.
  3. For maker or taker fees paid in BTC paid less than 0.00005 BTC, OR less than Maker: 0.1%, Taker 0.7%, OR to an address other than an associated Bisq address; 1BVxNn3T12veSK6DgqwU4Hdn7QHcDDRag7, 3EtUWqsGThPtjwUczw27YCo6EWvQdaPUyp, 3A8Zc1XioE2HRzYfbb5P8iemCS72M6vRJV, 38bZBj5peYS3Husdz7AH3gEUiUbYRD951t, or critrerias34VLFgtFKAtwTdZ5rengTT2g2zC99sWQLC
  4. For maker or taker fees paid in BSQ that are underpaid (Maker: 0.05%, Taker 0.35%).
  5. For maker, taker , deposit, or payout transactions that occur for 9 sat/vB e or less.

Hopefully zero of the trades looked at will meet criteria's 6, 7 and 8, and a marginal percentage will meet criteria's 9 and 10.

Bisq protocol related failed trades

My definitions of a Bisq protocol related failed trade is:

A failed Bisq protocol related trade when something in a users instance of Bisq is not functioning properly that results in, for example, one or any of the following occurring, this may or may not result in an on-chain failure:

These errors, whilst important to identify and reduce, are outside the scope of an on-chain analysis, this proposal.

Other notes

Just to clarify that this is on chain only and in no way will used to identify or look at trade of any individual Bisq users activity. It is looking at 400 chronological trades that take place on the platform to provide some insights.

Also I expect to run into a few barriers and problems with on-chain analysis mainly as a result of on-chain failures being difficult to identify as failed rather than pending trades, and, therefore, how to correctly categorize them. Nevertheless I feel this proposal would be a useful exercise that would provide useful information and likely more questions to be answered.

Though it would be useful to put down my thoughts process in writing, if anyone has any comments, suggestions, corrections or questions please let me know.

chimp1984 commented 2 years ago

I think it would be good to scan the blockchain for transactions which match the Bisq-trade protocol structure. Its not totally trivial to do that but possible. It will contain some potential false positives but it should be rather small. Would be at least interesting to see that ratio. It sould also be a good match with out trade statistics. If not we should figure out why. The trade statistics are not verifyable data and could be faked (as it happend a while back with that weird scamcoin).

pazza83 commented 2 years ago

Closing as approved

ghost commented 2 years ago

Please see https://github.com/jmacxx/WIP/tree/master/bisqTxChecker -- a python script that checks trade fee txs from 2020 onwards and lists any multisig deposits that have not paid out. It also attempts to produce statistics related to the questions posed above.

Results:

https://github.com/jmacxx/WIP/blob/master/bisqTxChecker/report.txt

Summary:

268359 fee payment txs analyzed
134179 trades analyzed
58 trades with locked/abandoned multisig
10006 of 102595 BSQ fee payments resulting in cancel offer or failed trade
14341 of 165764 BTC fee payments resulting in cancel offer or failed trade
33 of 102595 BSQ fee payments resulting in locked multisig
73 of 165764 BTC fee payments resulting in locked multisig
5.94173536 BTC total locked value