I've implemented a BitStream proof of concept by Robin Linus in Cashu for atomic swaps between files and Lightning payments.

Atomicity is achieved via a "Nutbond" Ecash contract which can be challenged if the downloaded file doesn't decrypt right.

An explainer and demo video is linked below.

How it works:
- Clients requests download
- Server sends encrypted file, Lightning invoice & Nutbond
- Client verifies bond and pays LN invoice
- Client decrypts file with LN preimage
- If decrypt fails, client challenges Nutbond & gets refund

Some notable differences to the original proposal:
- Nutbonds are issued for each user, not per file
- Bond doesn't burn but acts as a refund to user
- No Merkle trees yet. Next logical step. Vibes well with BitTorrent.
- Bond is Ecash. Payment is on LN, could also be Ecash.

This took me a few hours to implement showing how easy it is to experiment with new contracting primitives in Cashu.

Bitcoiners are coming up with beautiful solutions for practical problems. Special thanks to Robin for sharing his cool ideas with us. Love the energy!

🎥👇 Demo (10 min):

https://mega.nz/file/rVsF1RQS#Q1ycXiC3fcsRbIYUVBxMFDQZAqKbW5PHWZdhqkj0P8A

Original post: https://twitter.com/robin_linus/status/1723343871067804060

https://image.nostr.build/8a31466566bb0ab73c60d246df35c33e1416b428878cde169e5f3673a54a9bfe.jpg


Thanks for the work and updates to both of you! Keep it up!👏👏👏


From: nostr:npub1jqzgmjp6v27d0tryewaez96mfh8ql3489whp9dssx68ypmkzpr2qgc3yr5


My head is trying to wrap itself around fully around what you just said… so you mean we could essentially make fully offline Lightning payments?


How do you know the downloaded file will decrypt to something useful and not to random garbage?


#bitvm #bitstream #cashu #bitcoin #poc #proofofconcept beta testing ready folks #atomic #swaps #plebchain


Someone needs to have verified the decrypted file hash before. Could be the merkle root of a torrent file for example, or some other well-known data (like the Blockchain).


Did I say that? This is only an atomic swap between file and Lightning payment.


But with the file I could do an offline payment?

Or rather one were I transact offline and then receive payment on Lightning or did I misunderstand the concept?


Awesome!!!💪💪💪


Hi Calle! I’m Colby, the guy mentioned at the bottom of the BitStream paper. Robin and I worked on it all year! It’s great to see traction like this.

If you want to use Merkle Trees capable of file storage, check out these Merkle DAG Trees.

These new trees have smaller branches than IPFS Merkle DAGs and support folders. We released the paper a few days ago. BitStream + Merkle DAG Trees = a revolution. :-)

https://github.com/HORNET-Storage/scionic-merkletree

https://www.hornetstorage.com/whitepaper https://image.nostr.build/3779af15eaee206a5a049bd231bb3f4cc82306f5f617255e15a8bc45c1310c66.jpg


You had me at Nutbond


I love how Cashuu and Fedinare taking things in a totally different directions and both are making more and more sense to me.

nostr:nevent1qqsz2ckuh4au7xuqpsacalt2clpfhrl0f44sw6jzj7s6njz620uqvpspzpmhxue69uhkummnw3ezuamfdejsygzsm98u9kzcp35zkpc62shck8335gqtq5yt4w26xwl0pp2a72qavvpsgqqqqqqswqfnj4


This is really cool. So with something like this, do we start to identify files by their decrypted hashes?

I know torrents do this, but we can always get a hash of a virus paired with the name of a file you want. At the end of the day, Torrents never really solved the issue of getting what you want.

Torrents were free, but now with payments involved, I want to be sure that I don't ask for mastering bitcoin, and receive the bitcoin standard.

I guess the next thing to solve is a trust/reputation system for hash -> expected content mapping?


So, for the non technical... Is it pay to view?


I heard you like 'em trees.
But how about the scionic merkel dag trees?

https://www.hornetstorage.com/


Great work implementation by nostr:npub12rv5lskctqxxs2c8rf2zlzc7xx3qpvzs3w4etgemauy9thegr43sf485vg.. I don't have enough knowledge to understand the whole work behind it.. but I awknoledge a Big game change! 🎩💜⚡🧡

nostr:nevent1qqsz2ckuh4au7xuqpsacalt2clpfhrl0f44sw6jzj7s6njz620uqvpspz3mhxue69uhhyetvv9ujumn0wd68ytnzvupzq5xeflpdskqvdq4swxj59793uvdzqzc9pzatjk3nhmcg2h0js8trqvzqqqqqqyv2xrnt
nostr:nevent1qqsz2ckuh4au7xuqpsacalt2clpfhrl0f44sw6jzj7s6njz620uqvpspz3mhxue69uhhyetvv9ujumn0wd68ytnzvupzq5xeflpdskqvdq4swxj59793uvdzqzc9pzatjk3nhmcg2h0js8trqvzqqqqqqyv2xrnt


Downsized video so it can be embedded.

https://video.nostr.build/1bb1603219587b9bdebc9625ac08bfb9e3b2cccee6482d9989bb79c327e0bf41.mp4


Waiting for your application


ser, you crush so hard


From: nostr:npub15m0xdlydcgzkn4d8x969dwwlehuunvac74z9spkl4wnj4wyhxv8smw3gx3


Ser. Why isnt the demo served up via bitstream?


#zapvertising https://www.lnesim.com


serious question: do you ever sleep?


I've implemented a BitStream proof of concept by Robin Linus in Cashu for atomic swaps between files and Lightning payments.

Atomicity is achieved via a "Nutbond" Ecash contract which can be challenged if the downloaded file doesn't decrypt right.

An explainer and demo video is linked below.

How it works:
- Clients requests download
- Server sends encrypted file, Lightning invoice & Nutbond
- Client verifies bond and pays LN invoice
- Client decrypts file with LN preimage
- If decrypt fails, client challenges Nutbond & gets refund

Some notable differences to the original proposal:
- Nutbonds are issued for each user, not per file
- Bond doesn't burn but acts as a refund to user
- No Merkle trees yet. Next logical step. Vibes well with BitTorrent.
- Bond is Ecash. Payment is on LN, could also be Ecash.

This took me a few hours to implement showing how easy it is to experiment with new contracting primitives in Cashu.

Bitcoiners are coming up with beautiful solutions for practical problems. Special thanks to Robin for sharing his cool ideas with us. Love the energy!

🎥👇 Demo (10 min):

https://mega.nz/file/rVsF1RQS#Q1ycXiC3fcsRbIYUVBxMFDQZAqKbW5PHWZdhqkj0P8A

Original post: https://twitter.com/robin_linus/status/1723343871067804060

https://image.nostr.build/8a31466566bb0ab73c60d246df35c33e1416b428878cde169e5f3673a54a9bfe.jpg


What if the file isn't necessarily what the client was looking for? (i.e. I upload a file called Terminator Movie, but it's actually Star Wars or just the first 30 minutes of the movie or even some kind of malware). Would that punishment just be reputation since the file could still be decrypted properly?


Is there a way to swap a privatekey with a  balance known but not address or pubkey to a buyer?