mirror of
https://github.com/RoboSats/taptrade-core.git
synced 2025-12-24 13:56:57 +00:00
add output definitions for escrow contract, add steps to concept trade flow 1
This commit is contained in:
29
docs/TapTrade_obs/.obsidian/workspace.json
vendored
29
docs/TapTrade_obs/.obsidian/workspace.json
vendored
@ -4,18 +4,21 @@
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "3f4f04a94aff6fa7",
|
||||
"id": "9151bc6da6fbbb91",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "5b040089919f2e28",
|
||||
"id": "bdb9fd88a01a8909",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"type": "canvas",
|
||||
"state": {
|
||||
"file": "Research/Bitcoin fundamentals/Knowledge sources.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
"file": "Research/Trade Pipelines/new concepts/random pipeline 1 tbd.canvas",
|
||||
"viewState": {
|
||||
"x": 37.5,
|
||||
"y": 1161.15233274725,
|
||||
"zoom": -0.702925838075446
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -85,7 +88,7 @@
|
||||
"state": {
|
||||
"type": "backlink",
|
||||
"state": {
|
||||
"file": "Research/Bitcoin fundamentals/Knowledge sources.md",
|
||||
"file": "Research/Trade Pipelines/new concepts/random pipeline 1 tbd.canvas",
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical",
|
||||
@ -102,7 +105,7 @@
|
||||
"state": {
|
||||
"type": "outgoing-link",
|
||||
"state": {
|
||||
"file": "Research/Bitcoin fundamentals/Knowledge sources.md",
|
||||
"file": "Research/Trade Pipelines/new concepts/random pipeline 1 tbd.canvas",
|
||||
"linksCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
}
|
||||
@ -125,7 +128,7 @@
|
||||
"state": {
|
||||
"type": "outline",
|
||||
"state": {
|
||||
"file": "Research/Bitcoin fundamentals/Knowledge sources.md"
|
||||
"file": "Research/Trade Pipelines/new concepts/random pipeline 1 tbd.canvas"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -146,12 +149,14 @@
|
||||
"command-palette:Open command palette": false
|
||||
}
|
||||
},
|
||||
"active": "5b040089919f2e28",
|
||||
"active": "bdb9fd88a01a8909",
|
||||
"lastOpenFiles": [
|
||||
"Research/Trade Pipelines/current trade flow.canvas",
|
||||
"Research/Trade Pipelines/new concepts/random pipeline 1 tbd.canvas",
|
||||
"Research/Bitcoin fundamentals/Knowledge sources.md",
|
||||
"Research/Trade Pipelines/current trade flow.canvas",
|
||||
"Research/Bitcoin fundamentals/Taproot output structure.canvas",
|
||||
"Research/Bitcoin fundamentals/Spending Taproot UTXOs.md",
|
||||
"Research/Trade Pipelines/Existing research.md",
|
||||
"Research/Bitcoin fundamentals/Knowledge sources.md",
|
||||
"Research/Implementation/Libraries.md"
|
||||
]
|
||||
}
|
||||
@ -12,7 +12,7 @@
|
||||
{"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 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":"f61c6285cefa3b31","type":"text","text":"**Timeout**\nMaker gets his own Bond and Taker bond","x":-757,"y":660,"width":398,"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},
|
||||
{"id":"0cb3e5ea0f8dfb8b","type":"text","text":"Maker","x":-196,"y":920,"width":115,"height":60,"color":"2"},
|
||||
@ -55,7 +55,17 @@
|
||||
{"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"}
|
||||
{"id":"1eb173a56b45f948","type":"text","text":"Taker","x":1625,"y":273,"width":110,"height":60,"color":"4"},
|
||||
{"id":"826f1b6a518c2a10","type":"text","text":"","x":-2000,"y":1360,"width":250,"height":60},
|
||||
{"id":"91eb76b688aa2fa3","type":"text","text":"","x":5040,"y":1360,"width":250,"height":60},
|
||||
{"id":"85053658a29a3bb7","type":"text","text":"Script D\n\nAND(SIG(TAKER), SIG(COORDINATOR))\n\nFees to coordinator.\nRemaining to Taker.","x":816,"y":1860,"width":447,"height":200},
|
||||
{"id":"9dde114e072e9785","type":"text","text":"Script B\nAND(SIG(Maker) && SIG(Taker))\n\nEscrow + Maker Bond to Maker.\n\nTaker Bond to Taker","x":133,"y":1860,"width":250,"height":240},
|
||||
{"id":"91fe39ac62950c10","type":"text","text":"SCRIPT C\n\nAND(SIG(Maker), SIG(COORDINATOR))\n\nFees to coordinator.\nRemaining to Maker\n\n","x":418,"y":1860,"width":385,"height":200},
|
||||
{"id":"5f8cc10757f876b2","type":"text","text":"Script A\n\nAND(AND(TIMELOCK, SIG(MAKER)), SIG(COORDINATOR))\n\nTimeout if Taker doesn't respond anymore.\n\nEverything to Maker.","x":-152,"y":1860,"width":250,"height":280},
|
||||
{"id":"ef48e8e586afd9c9","type":"text","text":"Script E\nAND(TIMELOCK(**Very** long timelock) & SIG(Maker))\n\neverything to Maker\n\nbackup in case coordinator and Taker is gone.\nTimelock has to be longer than maximum escrow period. Timelock needs to be very long to incentivise cosigning with coordinator in Script C to get Fees to coordinator.\n\nAlso as protection against extortion trough Coordinator (aka. hey i help you in your dipute but it will cost 90% fees)","x":-152,"y":2180,"width":240,"height":660},
|
||||
{"id":"9652d176ca6f0655","type":"text","text":"Possible script conditions","x":-197,"y":1520,"width":285,"height":60,"color":"5"},
|
||||
{"id":"513e29d4bb6616cd","type":"text","text":"MSTB Escrow locking key\n(External key of taproot contract where trade participants lock their money to)","x":-457,"y":1660,"width":260,"height":160},
|
||||
{"id":"7a1cd17e5924c237","type":"text","text":"Internal Key\nSigned by Taker, Maker and Coordinator via MuSig2 in case of complete trade\n","x":-804,"y":1860,"width":287,"height":140}
|
||||
],
|
||||
"edges":[
|
||||
{"id":"0452390c8e326418","fromNode":"fe94f3c9a67875b6","fromSide":"bottom","toNode":"9d82ff6bff57a83c","toSide":"top","label":"1. paying/locking Maker bond and Escrow"},
|
||||
@ -119,6 +129,13 @@
|
||||
{"id":"797f33fc3f6591ba","fromNode":"508af0ac065cc414","fromSide":"top","toNode":"f37650cb37821ec1","toSide":"bottom"},
|
||||
{"id":"a1ee13348f08da96","fromNode":"58af737d4b901b93","fromSide":"bottom","toNode":"f37650cb37821ec1","toSide":"top","label":"Fees"},
|
||||
{"id":"ed04b15bb0b41fcc","fromNode":"da056e0d063f396b","fromSide":"top","toNode":"eaabe56112938e2c","toSide":"bottom"},
|
||||
{"id":"10b87549eefddaae","fromNode":"cae35a028b34a2f8","fromSide":"bottom","toNode":"eaabe56112938e2c","toSide":"top","label":"Fees"}
|
||||
{"id":"10b87549eefddaae","fromNode":"cae35a028b34a2f8","fromSide":"bottom","toNode":"eaabe56112938e2c","toSide":"top","label":"Fees"},
|
||||
{"id":"472a8a46eb9b23ae","fromNode":"91eb76b688aa2fa3","fromSide":"left","toNode":"826f1b6a518c2a10","toSide":"right","label":"Untested/incomplete thoughts below this line"},
|
||||
{"id":"aa8b98f0cfd897fe","fromNode":"7a1cd17e5924c237","fromSide":"top","toNode":"513e29d4bb6616cd","toSide":"left"},
|
||||
{"id":"316934cbb245da9e","fromNode":"ef48e8e586afd9c9","fromSide":"top","toNode":"513e29d4bb6616cd","toSide":"right"},
|
||||
{"id":"6262986d7025c285","fromNode":"9dde114e072e9785","fromSide":"top","toNode":"513e29d4bb6616cd","toSide":"right"},
|
||||
{"id":"3326fc6ba63a6040","fromNode":"5f8cc10757f876b2","fromSide":"top","toNode":"513e29d4bb6616cd","toSide":"right"},
|
||||
{"id":"730bcb6bb8477259","fromNode":"91fe39ac62950c10","fromSide":"top","toNode":"513e29d4bb6616cd","toSide":"right"},
|
||||
{"id":"fb50e1e7bbd04c9a","fromNode":"85053658a29a3bb7","fromSide":"top","toNode":"513e29d4bb6616cd","toSide":"right"}
|
||||
]
|
||||
}
|
||||
@ -5,19 +5,22 @@
|
||||
{"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":118,"color":"5"},
|
||||
{"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":388},
|
||||
{"id":"dba9c662192cf5bb","type":"text","text":"**Maker**","x":-600,"y":47,"width":125,"height":58},
|
||||
{"id":"4a633210842ee3c0","x":-665,"y":410,"width":250,"height":60,"type":"text","text":"Taker"},
|
||||
{"id":"f461d9afa4298d14","x":135,"y":410,"width":250,"height":60,"type":"text","text":"Coordinator"},
|
||||
{"id":"f1c3087260abe818","x":-275,"y":320,"width":250,"height":240,"type":"text","text":"+ payout address\n+ MuSig2 public nonce\n+ taproot public key (for agg. internal key)\n+ Bond input reference"},
|
||||
{"id":"bdce49ceea829893","x":-652,"y":690,"width":192,"height":60,"type":"text","text":"Taker"},
|
||||
{"id":"961e75c701b7f68f","x":80,"y":690,"width":250,"height":60,"type":"text","text":"Coordinator"},
|
||||
{"id":"73a7dae830df4443","x":-320,"y":660,"width":250,"height":120,"type":"text","text":"PSBT of contract\nTaker adds bond input sig"},
|
||||
{"id":"90704c232582cd52","x":80,"y":940,"width":250,"height":60,"type":"text","text":"Coordinator"},
|
||||
{"id":"b500fab6ba26abf1","x":-665,"y":1120,"width":250,"height":60,"type":"text","text":"Maker"},
|
||||
{"id":"9b054e655a321517","x":-320,"y":1010,"width":250,"height":110,"type":"text","text":"PSBT of contract\nMaker adds escrow input sig"},
|
||||
{"id":"de1642ddfdfed1df","x":80,"y":1180,"width":250,"height":120,"type":"text","text":"Coordinator \npublishes contract TX and waits for confirmation"},
|
||||
{"id":"910e5a3ee7688d0b","x":-300,"y":1380,"width":250,"height":120,"color":"6","type":"text","text":"Escrow and Bond locked in contract.\n**Chat can begin**"},
|
||||
{"id":"880c77a2d23f2cec","x":-390,"y":-39,"width":390,"height":230,"type":"text","text":"+signed TX\n\n-> Bond to coordinator\n -> change to self\n -> SIGHASH_ALL | ANYONECANPAY\n\n+MuSig2 public nonce\n+taproot public key (for agg. internal key)"},
|
||||
{"id":"e3b8669b30d1c80e","x":-610,"y":800,"width":815,"height":120,"type":"text","text":"+ signed psbt\n+ signed punishment TX in case the taker tries to spend the input somewhere else before the maker signs, the coordinator can claim or burn the bond (same like the maker bond). In case of out of band mining the maker would not lose money and the taker has a cost associated to doing this act"}
|
||||
{"id":"4a633210842ee3c0","type":"text","text":"Taker","x":-665,"y":410,"width":250,"height":60},
|
||||
{"id":"f461d9afa4298d14","type":"text","text":"Coordinator","x":135,"y":410,"width":250,"height":60},
|
||||
{"id":"f1c3087260abe818","type":"text","text":"+ payout address\n+ MuSig2 public nonce\n+ taproot public key (for agg. internal key)\n+ Bond input reference","x":-275,"y":320,"width":250,"height":240},
|
||||
{"id":"bdce49ceea829893","type":"text","text":"Taker","x":-652,"y":690,"width":192,"height":60},
|
||||
{"id":"961e75c701b7f68f","type":"text","text":"Coordinator","x":80,"y":690,"width":250,"height":60},
|
||||
{"id":"73a7dae830df4443","type":"text","text":"PSBT of contract\nTaker adds bond input sig","x":-320,"y":660,"width":250,"height":120},
|
||||
{"id":"90704c232582cd52","type":"text","text":"Coordinator","x":80,"y":940,"width":250,"height":60},
|
||||
{"id":"b500fab6ba26abf1","type":"text","text":"Maker","x":-665,"y":1120,"width":250,"height":60},
|
||||
{"id":"9b054e655a321517","type":"text","text":"PSBT of contract\nMaker adds escrow input sig","x":-320,"y":1010,"width":250,"height":110},
|
||||
{"id":"de1642ddfdfed1df","type":"text","text":"Coordinator \npublishes contract TX and waits for confirmation","x":80,"y":1180,"width":250,"height":120,"color":"2"},
|
||||
{"id":"910e5a3ee7688d0b","type":"text","text":"Escrow and Bond locked in contract.\n**Chat can begin**","x":-300,"y":1380,"width":250,"height":120,"color":"6"},
|
||||
{"id":"880c77a2d23f2cec","type":"text","text":"+signed TX\n\n-> Bond to coordinator\n -> change to self\n -> SIGHASH_ALL | ANYONECANPAY\n\n+MuSig2 public nonce\n+taproot public key (for agg. internal key)","x":-390,"y":-39,"width":390,"height":230},
|
||||
{"id":"e3b8669b30d1c80e","type":"text","text":"+ signed psbt\n+ signed punishment TX in case the taker tries to spend the input somewhere else before the maker signs, the coordinator can claim or burn the bond (same like the maker bond). In case of out of band mining the maker would not lose money and the taker has a cost associated to doing this act","x":-610,"y":800,"width":815,"height":120},
|
||||
{"id":"483fbdbcc5ea8501","type":"text","text":"I think there could be an advanced mode / external wallet mode where this could be done directly from an external Wallet e.g. Hardware wallet with Sparrow. But it would require lot of copy pasting (signed txs, psbts, addresses). Also there is secret state needed to be saved for MuSig2, this could be downloaded as file or stored encrypted on the coordinator. \n\nFor easy use there would need to be a wallet in RoboSats (BDK) but UI wise this would be either a challenge or a privacy reduction (if you use the same wallet but different Robot). It's also possible to limit the Wallet to one robot so the user must withdraw the sats after the trade (can't import wallet into robosats, only export). I think wallet could also be stored encrypted on coordinator or exported as file/seed.","x":80,"y":-480,"width":660,"height":338},
|
||||
{"id":"7645baf985ca338b","x":420,"y":1180,"width":400,"height":400,"type":"file","file":"Research/Trade Pipelines/current trade flow.canvas"},
|
||||
{"id":"51e650a981068490","x":420,"y":1120,"width":400,"height":60,"color":"2","type":"text","text":"see contract definition at the bottom here"}
|
||||
],
|
||||
"edges":[
|
||||
{"id":"77d1ff9130716b53","fromNode":"dba9c662192cf5bb","fromSide":"right","toNode":"93c73227c82f1a81","toSide":"left"},
|
||||
@ -25,6 +28,7 @@
|
||||
{"id":"e68c9bf91e484882","fromNode":"961e75c701b7f68f","fromSide":"left","toNode":"bdce49ceea829893","toSide":"right"},
|
||||
{"id":"bd911b47450ec601","fromNode":"bdce49ceea829893","fromSide":"right","toNode":"90704c232582cd52","toSide":"left"},
|
||||
{"id":"1f8f7366b09492f1","fromNode":"90704c232582cd52","fromSide":"left","toNode":"b500fab6ba26abf1","toSide":"right"},
|
||||
{"id":"d61c23261f820a35","fromNode":"b500fab6ba26abf1","fromSide":"right","toNode":"de1642ddfdfed1df","toSide":"left","label":"signed psbt"}
|
||||
{"id":"d61c23261f820a35","fromNode":"b500fab6ba26abf1","fromSide":"right","toNode":"de1642ddfdfed1df","toSide":"left","label":"signed psbt"},
|
||||
{"id":"e4df63e127b5b52a","fromNode":"51e650a981068490","fromSide":"left","toNode":"de1642ddfdfed1df","toSide":"right"}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user