From 2c19eacbce75b1175793149a99ef1587d44f8487 Mon Sep 17 00:00:00 2001 From: fbock Date: Mon, 13 May 2024 17:47:11 +0200 Subject: [PATCH] update concept trade flow --- docs/TapTrade_obs/.obsidian/workspace.json | 40 +++++-------- .../Research/Implementation/Libraries.md | 3 + .../Trade Pipelines/current trade flow.canvas | 60 +++++++++---------- .../new concepts/random pipeline 1 tbd.canvas | 13 ++++ .../new concepts/random pipeline 1.canvas | 13 ---- 5 files changed, 60 insertions(+), 69 deletions(-) create mode 100644 docs/TapTrade_obs/Research/Trade Pipelines/new concepts/random pipeline 1 tbd.canvas delete mode 100644 docs/TapTrade_obs/Research/Trade Pipelines/new concepts/random pipeline 1.canvas diff --git a/docs/TapTrade_obs/.obsidian/workspace.json b/docs/TapTrade_obs/.obsidian/workspace.json index feb8fc0..317d452 100644 --- a/docs/TapTrade_obs/.obsidian/workspace.json +++ b/docs/TapTrade_obs/.obsidian/workspace.json @@ -4,22 +4,15 @@ "type": "split", "children": [ { - "id": "ecf79a0752cdbb44", + "id": "c01e7ef9b6783479", "type": "tabs", "children": [ { - "id": "4cb88f1468c68f7e", + "id": "117cb3f7c46e67c9", "type": "leaf", "state": { - "type": "canvas", - "state": { - "file": "Research/Trade Pipelines/current trade flow.canvas", - "viewState": { - "x": 525.2459763356514, - "y": -31.37831648394331, - "zoom": -1.4335164388020833 - } - } + "type": "empty", + "state": {} } } ] @@ -72,8 +65,7 @@ } ], "direction": "horizontal", - "width": 329.5, - "collapsed": true + "width": 329.5 }, "right": { "id": "5f13d93e126071cf", @@ -89,7 +81,6 @@ "state": { "type": "backlink", "state": { - "file": "Research/Trade Pipelines/current trade flow.canvas", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -106,7 +97,6 @@ "state": { "type": "outgoing-link", "state": { - "file": "Research/Trade Pipelines/current trade flow.canvas", "linksCollapsed": false, "unlinkedCollapsed": true } @@ -128,9 +118,7 @@ "type": "leaf", "state": { "type": "outline", - "state": { - "file": "Research/Trade Pipelines/current trade flow.canvas" - } + "state": {} } } ] @@ -150,18 +138,18 @@ "command-palette:Open command palette": false } }, - "active": "4cb88f1468c68f7e", + "active": "117cb3f7c46e67c9", "lastOpenFiles": [ - "Research/Implementation/Libraries.md", - "Research/Trade Pipelines/new concepts/random pipeline 1.canvas", - "signet-instance.md", + "Research/Trade Pipelines/new concepts/random pipeline 1 tbd.canvas", "Research/Trade Pipelines/current trade flow.canvas", - "Research/Trade Pipelines/new concepts/Untitled.md", - "Research/Trade Pipelines/new concepts", - "Research/Trade Pipelines/Existing research.md", - "Research/Bitcoin fundamentals/Taproot output structure.canvas", "Research/Bitcoin fundamentals/Knowledge sources.md", "Research/Bitcoin fundamentals/Signature and Flags.canvas", + "Research/Implementation/Libraries.md", + "Research/Trade Pipelines/Existing research.md", + "signet-instance.md", + "Research/Trade Pipelines/new concepts/Untitled.md", + "Research/Trade Pipelines/new concepts", + "Research/Bitcoin fundamentals/Taproot output structure.canvas", "assets/anyonecanpay.webp", "Research/Bitcoin fundamentals/Spending Taproot UTXOs.md", "Research/Implementation/UI ideas.canvas", diff --git a/docs/TapTrade_obs/Research/Implementation/Libraries.md b/docs/TapTrade_obs/Research/Implementation/Libraries.md index 0b6a813..06ced03 100644 --- a/docs/TapTrade_obs/Research/Implementation/Libraries.md +++ b/docs/TapTrade_obs/Research/Implementation/Libraries.md @@ -15,6 +15,9 @@ This crate provides a flexible rust implementation of [MuSig2](https://eprint.ia MuSig2 allows groups of mutually distrusting parties to cooperatively sign data and aggregate their signatures into a single aggregated signature which is indistinguishable from a signature made by a single private key. The group collectively controls an _aggregated public key_ which can only create signatures if everyone in the group cooperates (AKA an N-of-N multisignature scheme). MuSig2 is optimized to support secure signature aggregation with only **two round-trips of network communication.** +## [LND MuSig2 implementation](https://github.com/guggero/lnd/blob/93e069f3bd4cdb2198a0ff158b6f8f43a649e476/docs/musig2.md) + + ## [frost crate](https://github.com/ZcashFoundation/frost) This should work with bitcoin as it supports secp256k1. diff --git a/docs/TapTrade_obs/Research/Trade Pipelines/current trade flow.canvas b/docs/TapTrade_obs/Research/Trade Pipelines/current trade flow.canvas index 61df484..1744b5c 100644 --- a/docs/TapTrade_obs/Research/Trade Pipelines/current trade flow.canvas +++ b/docs/TapTrade_obs/Research/Trade Pipelines/current trade flow.canvas @@ -11,7 +11,7 @@ {"id":"534b2aec29273277","type":"text","text":"Coordinator","x":-1097,"y":333,"width":157,"height":60,"color":"4"}, {"id":"09c6192278d0c20c","type":"text","text":"Maker","x":-1000,"y":430,"width":120,"height":60,"color":"4"}, {"id":"1939841fedec6c0f","type":"text","text":"***Possible Keyspend***","x":-1203,"y":580,"width":263,"height":60,"color":"3"}, - {"id":"ab10f89dba11c188","type":"text","text":"***Protocol A***\n***MSTB*** (Maker seller taker buyer), maybe some nomenclature could be useful for further thoughts\n\nAdapted to onchain possibilities (no time limitations with onchain, so payout address can be submitted upfront/Escrow can be locked with Bond)","x":-340,"y":-760,"width":405,"height":260,"color":"3"}, + {"id":"ab10f89dba11c188","type":"text","text":"***Protocol A***\n***MSTB*** (Maker seller taker buyer), maybe some nomenclature could be useful for further thoughts\n\nAdapted a bit to onchain possibilities (no time limitations with onchain, so payout address can be submitted upfront/Escrow can be locked with Bond)","x":-340,"y":-760,"width":405,"height":260,"color":"3"}, {"id":"f61c6285cefa3b31","type":"text","text":"**Timeout**\nMaker gets his own Bond and Taker bond","x":-757,"y":660,"width":374,"height":79}, {"id":"b9b6ba151bbae01d","type":"text","text":"Maker","x":-637,"y":920,"width":134,"height":60,"color":"2"}, {"id":"425368ae6596b423","type":"text","text":"**Cooperative Cancellation**\nMaker and Taker accept to cancel trade","x":-196,"y":550,"width":362,"height":60}, @@ -25,37 +25,37 @@ {"id":"f57afde511e8ac94","type":"text","text":"**SCRIPT A**","x":-712,"y":1080,"width":250,"height":140,"color":"3"}, {"id":"b3099a08b3bd00c0","type":"text","text":"SCRIPT B","x":-60,"y":1080,"width":250,"height":140,"color":"3"}, {"id":"3c9f98938fad14f1","type":"text","text":"SCRIPT D","x":1033,"y":1080,"width":250,"height":60,"color":"3"}, - {"id":"12e9bbd2f6268125","type":"text","text":"Maker | **buying sats**","x":2223,"y":-530,"width":260,"height":60}, - {"id":"4c786c80eaae0328","type":"text","text":"2.Buy-order in Orderbook","x":2201,"y":-330,"width":305,"height":60}, - {"id":"a2878365b55bb0dd","type":"text","text":"Taker | **selling sats**","x":2603,"y":-320,"width":250,"height":50}, - {"id":"ecfbf662067bd8d1","type":"text","text":"**Possibility 1**\nMaker sent Fiat | Taker confirms","x":1943,"y":90,"width":300,"height":85,"color":"4"}, - {"id":"5b029d2935534a6b","type":"text","text":"**Possibility 2**\nMaker doesn't send fiat (and doesn't claim he did)","x":2304,"y":90,"width":424,"height":85,"color":"2"}, - {"id":"64a93699cbd7b19f","type":"text","text":"**Possibility 3**\nMaker maybe sent Fiat | Taker doesn't confirm","x":2763,"y":90,"width":500,"height":85,"color":"1"}, - {"id":"17e659c5f3819509","type":"text","text":"Fiat exchange (Chat)","x":2423,"y":-90,"width":250,"height":60}, - {"id":"95a8921e756a05bc","type":"text","text":"Coordinator","x":1566,"y":263,"width":157,"height":60,"color":"4"}, - {"id":"1fe6b931a9503506","type":"text","text":"Maker","x":1663,"y":360,"width":120,"height":60,"color":"4"}, - {"id":"6eb46f0faffe4ecc","type":"text","text":"***Possible Keyspend***","x":1460,"y":510,"width":263,"height":60,"color":"3"}, - {"id":"ae0873e7f893c725","type":"text","text":"***Protocol B***\n***MBTS*** (Maker buyer taker seller)\n\nAdapted to onchain possibilities (no time limitations with onchain, so payout address can be submitted upfront/Escrow can be locked with Bond)","x":2323,"y":-770,"width":405,"height":190,"color":"3"}, - {"id":"ca33c76fe00063c9","type":"text","text":"**Timeout**\nTaker gets his own Bond and Maker bond","x":1906,"y":590,"width":374,"height":79}, - {"id":"2913d2bd694e100d","type":"text","text":"Taker","x":2026,"y":850,"width":134,"height":60,"color":"2"}, - {"id":"9c9c86b6f06c52a8","type":"text","text":"**Cooperative Cancellation**\nMaker and Taker accept to cancel trade","x":2467,"y":480,"width":362,"height":60}, - {"id":"ccc947efca9a4670","type":"text","text":"Taker","x":2467,"y":850,"width":115,"height":60,"color":"2"}, - {"id":"ecaf23829e10e9ba","type":"text","text":"Maker","x":2863,"y":850,"width":115,"height":60,"color":"2"}, - {"id":"647e4240faa5a294","type":"text","text":"**Escrow**\nCoordinator collects Evidence of Fiat payment","x":3263,"y":297,"width":433,"height":67}, - {"id":"23f144a0cb1ffb55","type":"text","text":"Maker wins dispute","x":3663,"y":510,"width":220,"height":60}, - {"id":"58af737d4b901b93","type":"text","text":"**Taker wins dispute**\nMaker can't provide sufficient evidence of fiat payment (e.g. bank statement)","x":3138,"y":510,"width":250,"height":159}, - {"id":"293cd8b47335a173","type":"text","text":"Maker","x":3463,"y":850,"width":137,"height":60,"color":"1"}, - {"id":"aac1e0578a11d933","type":"text","text":"Coordinator","x":4023,"y":850,"width":160,"height":60,"color":"1"}, - {"id":"eb62204a0c1eb83b","type":"text","text":"**SCRIPT A**","x":1951,"y":1010,"width":250,"height":140,"color":"3"}, - {"id":"8cc946a610b66938","type":"text","text":"SCRIPT B","x":2603,"y":1010,"width":250,"height":140,"color":"3"}, - {"id":"da39ca558d9392ad","type":"text","text":"SCRIPT D","x":3696,"y":1010,"width":250,"height":60,"color":"3"}, - {"id":"1eb173a56b45f948","type":"text","text":"Taker","x":1405,"y":263,"width":110,"height":60,"color":"4"}, - {"id":"508af0ac065cc414","type":"text","text":"SCRIPT C","x":3060,"y":1150,"width":250,"height":60,"color":"3"}, - {"id":"f37650cb37821ec1","type":"text","text":"Coordinator","x":3263,"y":980,"width":160,"height":60,"color":"1"}, - {"id":"ebf87e54839a7bda","type":"text","text":"Taker","x":3076,"y":850,"width":125,"height":60,"color":"1"}, {"id":"da056e0d063f396b","type":"text","text":"SCRIPT C","x":424,"y":1240,"width":250,"height":60,"color":"3"}, {"id":"eaabe56112938e2c","type":"text","text":"Coordinator","x":600,"y":1050,"width":160,"height":60,"color":"1"}, - {"id":"898c648993e5d4f1","type":"text","text":"Maker","x":440,"y":920,"width":125,"height":60,"color":"1"} + {"id":"898c648993e5d4f1","type":"text","text":"Maker","x":440,"y":920,"width":125,"height":60,"color":"1"}, + {"id":"5b029d2935534a6b","type":"text","text":"**Possibility 2**\nMaker doesn't send fiat (and doesn't claim he did)","x":2524,"y":100,"width":424,"height":85,"color":"2"}, + {"id":"17e659c5f3819509","type":"text","text":"Fiat exchange (Chat)","x":2643,"y":-80,"width":250,"height":60}, + {"id":"9c9c86b6f06c52a8","type":"text","text":"**Cooperative Cancellation**\nMaker and Taker accept to cancel trade","x":2687,"y":490,"width":362,"height":60}, + {"id":"64a93699cbd7b19f","type":"text","text":"**Possibility 3**\nMaker maybe sent Fiat | Taker doesn't confirm","x":2983,"y":100,"width":500,"height":85,"color":"1"}, + {"id":"647e4240faa5a294","type":"text","text":"**Escrow**\nCoordinator collects Evidence of Fiat payment","x":3483,"y":307,"width":433,"height":67}, + {"id":"23f144a0cb1ffb55","type":"text","text":"Maker wins dispute","x":3883,"y":520,"width":220,"height":60}, + {"id":"58af737d4b901b93","type":"text","text":"**Taker wins dispute**\nMaker can't provide sufficient evidence of fiat payment (e.g. bank statement)","x":3358,"y":520,"width":250,"height":159}, + {"id":"8cc946a610b66938","type":"text","text":"SCRIPT B","x":2823,"y":1020,"width":250,"height":140,"color":"3"}, + {"id":"ecaf23829e10e9ba","type":"text","text":"Maker","x":3083,"y":860,"width":115,"height":60,"color":"2"}, + {"id":"508af0ac065cc414","type":"text","text":"SCRIPT C","x":3280,"y":1160,"width":250,"height":60,"color":"3"}, + {"id":"293cd8b47335a173","type":"text","text":"Maker","x":3683,"y":860,"width":137,"height":60,"color":"1"}, + {"id":"da39ca558d9392ad","type":"text","text":"SCRIPT D","x":3916,"y":1020,"width":250,"height":60,"color":"3"}, + {"id":"aac1e0578a11d933","type":"text","text":"Coordinator","x":4243,"y":860,"width":160,"height":60,"color":"1"}, + {"id":"f37650cb37821ec1","type":"text","text":"Coordinator","x":3483,"y":990,"width":160,"height":60,"color":"1"}, + {"id":"ebf87e54839a7bda","type":"text","text":"Taker","x":3296,"y":860,"width":125,"height":60,"color":"1"}, + {"id":"6eb46f0faffe4ecc","type":"text","text":"***Possible Keyspend***","x":1680,"y":520,"width":263,"height":60,"color":"3"}, + {"id":"2913d2bd694e100d","type":"text","text":"Taker","x":2246,"y":860,"width":134,"height":60,"color":"2"}, + {"id":"ccc947efca9a4670","type":"text","text":"Taker","x":2687,"y":860,"width":115,"height":60,"color":"2"}, + {"id":"95a8921e756a05bc","type":"text","text":"Coordinator","x":1786,"y":273,"width":157,"height":60,"color":"4"}, + {"id":"1fe6b931a9503506","type":"text","text":"Maker","x":1883,"y":370,"width":120,"height":60,"color":"4"}, + {"id":"ca33c76fe00063c9","type":"text","text":"**Timeout**\nTaker gets his own Bond and Maker bond","x":2126,"y":600,"width":374,"height":79}, + {"id":"ecfbf662067bd8d1","type":"text","text":"**Possibility 1**\nMaker sent Fiat | Taker confirms","x":2163,"y":100,"width":300,"height":85,"color":"4"}, + {"id":"eb62204a0c1eb83b","type":"text","text":"**SCRIPT A**","x":2171,"y":1020,"width":250,"height":140,"color":"3"}, + {"id":"12e9bbd2f6268125","type":"text","text":"Maker | **buying sats**","x":2443,"y":-520,"width":260,"height":60}, + {"id":"4c786c80eaae0328","type":"text","text":"2.Buy-order in Orderbook","x":2421,"y":-320,"width":305,"height":60}, + {"id":"a2878365b55bb0dd","type":"text","text":"Taker | **selling sats**","x":2823,"y":-310,"width":250,"height":50}, + {"id":"ae0873e7f893c725","type":"text","text":"***Protocol B***\n***MBTS*** (Maker buyer taker seller)\n\nAdapted a bit to onchain possibilities (no time limitations with onchain, so payout address can be submitted upfront/Escrow can be locked with Bond)","x":2543,"y":-760,"width":405,"height":190,"color":"3"}, + {"id":"1eb173a56b45f948","type":"text","text":"Taker","x":1625,"y":273,"width":110,"height":60,"color":"4"} ], "edges":[ {"id":"0452390c8e326418","fromNode":"fe94f3c9a67875b6","fromSide":"bottom","toNode":"9d82ff6bff57a83c","toSide":"top","label":"1. paying/locking Maker bond and Escrow"}, diff --git a/docs/TapTrade_obs/Research/Trade Pipelines/new concepts/random pipeline 1 tbd.canvas b/docs/TapTrade_obs/Research/Trade Pipelines/new concepts/random pipeline 1 tbd.canvas new file mode 100644 index 0000000..18839e5 --- /dev/null +++ b/docs/TapTrade_obs/Research/Trade Pipelines/new concepts/random pipeline 1 tbd.canvas @@ -0,0 +1,13 @@ +{ + "nodes":[ + {"id":"5b8863761f608702","type":"text","text":"Just going to write some stuff down here while thinking about it. **Don't expect it to make sense yet!**","x":-415,"y":-360,"width":460,"height":80,"color":"1"}, + {"id":"8b7862709255b800","type":"text","text":"\n***MSTB*** (Maker seller taker buyer)","x":-345,"y":-440,"width":320,"height":60,"color":"3"}, + {"id":"428c2dc0767db819","type":"text","text":"semi trusted - coordinator could steal/burn bond - but low risk as bonds are small and reputation would be damaged. Also no control on full trade amount.","x":-402,"y":-260,"width":434,"height":120,"color":"5"}, + {"id":"dba9c662192cf5bb","type":"text","text":"**Maker**","x":-600,"y":42,"width":125,"height":60}, + {"id":"93c73227c82f1a81","type":"text","text":"**Coordinator**\n\nwatches Mempool and Chain, could publish the bond TX. Essentially just to prevent orderbook spam / for skin in the game.\n\n*SIGHASH_ALL | ANYONECANPAY* could make it possible for the coordinator to add inputs up to the height of the bond to push the TX fees without losing capital itself. \nAlso out of band mining would cause a cost for the Maker so there is always a price to being unreliable. \n\nThe Maker could be required to use Inputs at least the value of the trade amount to proof that he owns enough sats to fulfill the trade.","x":80,"y":-118,"width":500,"height":380}, + {"id":"810eebcd41474f56","x":-310,"y":360,"width":250,"height":60,"type":"text","text":"...tbc"} + ], + "edges":[ + {"id":"77d1ff9130716b53","fromNode":"dba9c662192cf5bb","fromSide":"right","toNode":"93c73227c82f1a81","toSide":"left","label":"signed TX\n\n-> Bond to coordinator\n -> change to self"} + ] +} \ No newline at end of file diff --git a/docs/TapTrade_obs/Research/Trade Pipelines/new concepts/random pipeline 1.canvas b/docs/TapTrade_obs/Research/Trade Pipelines/new concepts/random pipeline 1.canvas deleted file mode 100644 index ff6a641..0000000 --- a/docs/TapTrade_obs/Research/Trade Pipelines/new concepts/random pipeline 1.canvas +++ /dev/null @@ -1,13 +0,0 @@ -{ - "nodes":[ - {"id":"94ad2b7c2e51b676","x":-3,"y":-660,"width":250,"height":60,"type":"text","text":""}, - {"id":"ce45a9a761640918","type":"text","text":"**Maker**","x":-380,"y":-140,"width":125,"height":60}, - {"id":"5b8863761f608702","type":"text","text":"Just going to write some stuff down here while thinking about it. Don't expect it to make sense yet!","x":-220,"y":-480,"width":405,"height":110,"color":"1"}, - {"id":"8b7862709255b800","type":"text","text":"\n***MSTB*** (Maker seller taker buyer)","x":-177,"y":-320,"width":320,"height":60,"color":"3"}, - {"id":"545e4ff11933963a","type":"text","text":"**Coordinator**\nMonitors mempool and chain\n\nSpending the input is always costly, so it could work as spam prevention.","x":143,"y":-195,"width":277,"height":170}, - {"id":"5ef2d6eee11db40b","type":"text","text":"**Taker**","x":-380,"y":140,"width":125,"height":60} - ], - "edges":[ - {"id":"ffcfdb8c955cf910","fromNode":"ce45a9a761640918","fromSide":"right","toNode":"545e4ff11933963a","toSide":"left","label":"Signed TX (unpublished)\n* Bond to coordinator\n*Escrow amount to himself"} - ] -} \ No newline at end of file