2024-08-26 16:52:43 +05:30

83 lines
14 KiB
Plaintext
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"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":118,"color":"5"},
{"id":"dba9c662192cf5bb","type":"text","text":"**Maker**","x":-600,"y":47,"width":125,"height":58},
{"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":"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":"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":"51e650a981068490","type":"text","text":"see contract definition","x":420,"y":1120,"width":400,"height":60,"color":"2"},
{"id":"e3b8669b30d1c80e","type":"text","text":"+ signed psbt\n+ additional 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":140},
{"id":"90704c232582cd52","type":"text","text":"Coordinator\n-> will now notify the Maker that Offer has been taken\n-> Will still monitor mempool and chain for both bonds now (maker and taker)","x":80,"y":950,"width":250,"height":210},
{"id":"0d1d6b982cbde6e2","type":"file","file":"Research/Trade Pipelines/new concepts/concept locking script 1.canvas","x":420,"y":1220,"width":400,"height":400},
{"id":"2f645456949ecdb8","type":"text","text":"Addendum: We could just publish a child transaction instead of adding an input to increase the fee.","x":580,"y":186,"width":340,"height":114},
{"id":"9a5c83be6a5d2b73","type":"text","text":"[Making Transaction invalid after certain blockheight - Stackexchange](https://bitcoin.stackexchange.com/questions/123021/make-signed-transaction-invalid-after-specified-time/123029#123029)","x":580,"y":91,"width":340,"height":100},
{"id":"b500fab6ba26abf1","type":"text","text":"Maker","x":-710,"y":1210,"width":250,"height":60},
{"id":"9b054e655a321517","type":"text","text":"PSBT of contract\nMaker adds escrow input sig\n\nMaker only gets PSBT without the Sig of the Taker, so he can't maliciously hold the tx and publish it at a later point in time.","x":-345,"y":980,"width":295,"height":210},
{"id":"345fbda43e40d028","type":"text","text":"Research/use PTLC","x":580,"y":41,"width":250,"height":50,"color":"2"},
{"id":"7916e1f2236a38b6","type":"text","text":"Look into DLC negotiation procedure\nhttps://github.com/discreetlogcontracts/dlcspecs/blob/9cd9148938c616690c79d99ec6f330e213c246c5/Protocol.md","x":5,"y":500,"width":515,"height":140,"color":"4"},
{"id":"5e3c3c0695787e9a","type":"text","text":"User (Tor)Browser (Wasm)","x":-720,"y":-69,"width":305,"height":69,"color":"3"},
{"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":55,"y":-549,"width":660,"height":338},
{"id":"f3b7288289dc8954","type":"text","text":"Backend","x":195,"y":-172,"width":250,"height":60,"color":"3"},
{"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. Maybe lock the time to invalidate the bond after a certain amount of time.","x":80,"y":-98,"width":500,"height":418},
{"id":"fdb1893d5a33ab28","type":"text","text":"In Lightning Network","x":960,"y":-211,"width":250,"height":50,"color":"2"},
{"id":"5277cd694b86bb6b","type":"text","text":"Alice wants to pay Carol through Bob","x":1380,"y":-211,"width":280,"height":50},
{"id":"85b66c760332f3fd","type":"file","file":"assets/ptlc2.png","x":1210,"y":-48,"width":620,"height":548},
{"id":"c893eae93673779c","type":"text","text":"LOCK PHASE","x":1860,"y":201,"width":120,"height":50},
{"id":"3df70b3ca936442d","type":"text","text":"Maker generates a, b","x":2140,"y":216,"width":240,"height":50},
{"id":"13186938fe4262ea","type":"text","text":"Maker locks fund fund with Adaptor Signature with B","x":2500,"y":160,"width":260,"height":106},
{"id":"fcc7765243fc3246","type":"text","text":"Maker reveals timelock hash and claims back his penalty","x":3060,"y":714,"width":300,"height":65},
{"id":"50d4e3ecf700274e","type":"text","text":"? sends (a+b) to Robosats and it claims the penalty","x":3060,"y":435,"width":300,"height":65},
{"id":"d6de59256cbb3712","type":"text","text":"YES","x":2920,"y":500,"width":110,"height":50},
{"id":"d9c194fdd3f4c963","type":"text","text":"NO","x":2920,"y":664,"width":110,"height":50},
{"id":"119047b4def84c19","type":"text","text":"Maker sends (a+b) to ?","x":2120,"y":569,"width":240,"height":50},
{"id":"4db362c6f7e5620f","type":"text","text":"TRIGGER = Maker doesn't respond/ anything else","x":2555,"y":554,"width":290,"height":80},
{"id":"5f822a5a69af894a","type":"text","text":"UNLOCK PHASE","x":1860,"y":554,"width":160,"height":50},
{"id":"c8b7d0bc62b28e03","type":"text","text":"Robosats generates z","x":2140,"y":-73,"width":240,"height":50},
{"id":"a53320bd938fc27c","type":"text","text":"Sends invoice to Maker","x":2460,"y":-73,"width":240,"height":50},
{"id":"918eb7ddcf4cfa5f","type":"text","text":"SETUP PHASE","x":1860,"y":-73,"width":120,"height":50},
{"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":-380,"y":-24,"width":390,"height":230},
{"id":"356b7d6fdad4422f","type":"text","text":"Coordinator does:\n- Validate the transaction (is the input unspent, does it really lock to the coordinator, is the change the amount of the trade, is the transaction fee > 201 sat/vbyte.\n- Send response back to trader -> status code\n- monitor mempool and blockchain\n- implement logic to create a child transaction spending the bond output with really high fees\n- (publish the offer to the orderbook)\n- Create endpoint to request available offers for takers","x":795,"y":-760,"width":415,"height":500},
{"id":"706ef3652322d103","type":"text","text":"OP_SHA256 <9ed15…232e> OP_EQUALVEIRFY <Redeemers Public Key> OP_CHECKSIG\n","x":4220,"y":418,"width":305,"height":100},
{"id":"66e438712c3f0a6d","type":"text","text":"MODIFIED VERSION OF PTLC'S TO WORK WITHOUT LIGHTNING","x":2220,"y":-240,"width":360,"height":79},
{"id":"ef4f5882c2b2d88d","type":"text","text":"OP_DROP <Payment Expiry Block>OP_CHECKLOCKTIMEVERIFY OP_DROP\n\nOP_CHECKSIG","x":5100,"y":663,"width":340,"height":136,"color":"#ffffff"},
{"id":"18afaf0423782bb9","type":"text","text":"ie, The script can only be unlocked if:\n1. Provide a secret message that when fed into the SHA256 hash function results in the following output: `9ed15…232e`\n2. Provide a valid signature, proving that he or she is the actual recipient of the payment;”","x":3671,"y":360,"width":497,"height":215},
{"id":"1dc5493938b901e1","type":"text","text":"HASHLOCK","x":3420,"y":443,"width":154,"height":50},
{"id":"a13088582d111bdf","type":"text","text":"TIMELOCK","x":3440,"y":717,"width":154,"height":50},
{"id":"9fba777945323b82","type":"file","file":"assets/Pasted image 20240611105421.png","x":4220,"y":673,"width":841,"height":139},
{"id":"25fd46361e37e55c","type":"text","text":"If Robosats does not reveal the secret within 24 hours, Trader can recover the funds","x":3700,"y":690,"width":360,"height":105},
{"id":"675238072a27b5d6","type":"text","text":"There must be a way of guaranteeing that the money wont be locked up forever if anything goes wrong. We need to include a refund clause in the contract:\n\n_“If Robosats does not reveal the secret within 24 hours,  the Trader can recover the funds”_\n\nThis time-locked refund clause also helps achieve atomicity. There is no need to worry about a partial payment state. In the event of a failure, each participant individually put the time-locked refund transaction on the blockchain to retrieve their funds.\n\nThe `OP_CHECKLOCKTIMEVERIFY`, or `OP_CLTV`, opcode works by allowing the creator of a transaction to specify a specific block height or timestamp in the future when the transaction can be added to the blockchain and become valid.","x":5620,"y":560,"width":640,"height":420},
{"id":"1d841d61bbe31e60","type":"text","text":"We demand the person redeeming the money provide the secret and a signature. This way, we can bind each contract to a specific recipient.\n\n“I, Alice, will pay Bob 100 satoshis if he can:\n\nProvide a secret message that when fed into the SHA256 hash function results in the following output: `9ed15…232e`\nProvide a valid signature, proving that he or she is the actual recipient of the payment;”\nIn the analogic world, this would be a very weak guarantee because hand-written signatures can be easily falsified. Fortunately, digital signatures provide much stronger security guarantees. They are like special stamps and codes that help to prove that a message is coming from whom we expect.\n\n\n\n","x":4641,"y":188,"width":665,"height":352},
{"id":"359c2fc3eba9d53d","type":"file","file":"assets/Pasted image 20240611120722.png","x":6440,"y":480,"width":1319,"height":560},
{"id":"7c70a62ff1ae759f","type":"text","text":"FInal Contract","x":6975,"y":400,"width":250,"height":60},
{"id":"a4a39f59a3d7268e","type":"text","text":"Add Homomorphic encryption?","x":5988,"y":167,"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":-300,"y":320,"width":250,"height":260}
],
"edges":[
{"id":"77d1ff9130716b53","fromNode":"dba9c662192cf5bb","fromSide":"right","toNode":"93c73227c82f1a81","toSide":"left"},
{"id":"912dd244ef9d5a46","fromNode":"4a633210842ee3c0","fromSide":"right","toNode":"f461d9afa4298d14","toSide":"left"},
{"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":"e4df63e127b5b52a","fromNode":"51e650a981068490","fromSide":"left","toNode":"de1642ddfdfed1df","toSide":"right"},
{"id":"d96e2c3ce03c2c2c","fromNode":"345fbda43e40d028","fromSide":"right","toNode":"fdb1893d5a33ab28","toSide":"left"},
{"id":"faa64d998859087c","fromNode":"fdb1893d5a33ab28","fromSide":"right","toNode":"5277cd694b86bb6b","toSide":"left"},
{"id":"eb5e7ef359d64c1d","fromNode":"c8b7d0bc62b28e03","fromSide":"right","toNode":"a53320bd938fc27c","toSide":"left"},
{"id":"f5f5f89f53d30cdb","fromNode":"a53320bd938fc27c","fromSide":"bottom","toNode":"3df70b3ca936442d","toSide":"top"},
{"id":"16004aafc5149992","fromNode":"3df70b3ca936442d","fromSide":"right","toNode":"13186938fe4262ea","toSide":"left"},
{"id":"56e698803b4f73cb","fromNode":"119047b4def84c19","fromSide":"right","toNode":"4db362c6f7e5620f","toSide":"left"},
{"id":"c3f0911c3d3ec5ba","fromNode":"4db362c6f7e5620f","fromSide":"right","toNode":"50d4e3ecf700274e","toSide":"left"},
{"id":"086c90642df1fa3a","fromNode":"fcc7765243fc3246","fromSide":"left","toNode":"4db362c6f7e5620f","toSide":"right"},
{"id":"7c47030a0b5b2c01","fromNode":"13186938fe4262ea","fromSide":"bottom","toNode":"119047b4def84c19","toSide":"top"},
{"id":"5a8af76c5df51a38","fromNode":"50d4e3ecf700274e","fromSide":"right","toNode":"18afaf0423782bb9","toSide":"left"},
{"id":"bf101083ef4373d4","fromNode":"18afaf0423782bb9","fromSide":"right","toNode":"706ef3652322d103","toSide":"left"},
{"id":"b38c076a2317742e","fromNode":"fcc7765243fc3246","fromSide":"right","toNode":"25fd46361e37e55c","toSide":"left"},
{"id":"af58f6b4b2fa387c","fromNode":"25fd46361e37e55c","fromSide":"right","toNode":"9fba777945323b82","toSide":"left"}
]
}