As lotharrr mentioned other flaws, you may want to check out his suggestion which seems like the way to go for me. This to eliminates this "sanity check" step all together.
968 karma · joined January 27, 2019
As lotharrr mentioned other flaws, you may want to check out his suggestion which seems like the way to go for me. This to eliminates this "sanity check" step all together.
> [...] it creates a libp2p keypair, uses the first 44 bits of the pubkey as the transfer code, use the first 8 bits plus a rounded timestamp as a DHT channel ID, then.. publishes its libp2p contact information to a DHT slot under the channel ID and waits for the peer to connect?
That summarizes it really well. There are actually three types of records you can store in the DHT of IPFS: Provider, IPNS and Peer records [0]. What pcp stores in the DHT are:
- cid("/pcp/{unixts}/chanID") -> peerID (provider record) - peerID -> multiaddresses (peer record)
where cid stands for the content ID [1] of the given string. So the receiving peer first searches for cid("/pcp/{unixts}/chanID"), finds the peerID and then searches for its associated addresses. These addresses can contain the public address of your home router (if NAT traversal is possible) or relay addresses.
All of this complexity is pretty much hidden away by libp2p, which is amazing!
Regarding your points about using PAKE/Public Key etc: I thought of making it even harder by tying the random code to the identity - but this is indeed flawed. I'll change the logic to your suggestion!
Honestly, thanks for your write-up and the valuable input!
[0] https://docs.ipfs.io/concepts/dht/ [1] https://docs.ipfs.io/concepts/content-addressing/
I really appreciate that this project gets a little attention.
Libp2p provides ways to establish a connection through NATs. For more information I recommend looking up the Identify [0] and Circuit Relay [1] protocols, as well as the NAT Traversal docs [2].
I implemented time based sharding because the DHT entries will remain there for up to 24h. So there is a significant chance for a channel ID collision that would result in connection attempts to peers that are long gone.
This is indeed a bit unergonomic and I haven’t covered edge cases that come with that approach. Open for suggestions :)
Best
[0] https://docs.libp2p.io/concepts/protocols/#identify [1] https://docs.libp2p.io/concepts/protocols/#circuit-relay [2] https://docs.libp2p.io/concepts/nat/
navigator.registerProtocolHandler('ipfs', 'https://dweb.link/ipfs/?uri=%s', 'ipfs resolver')
Afterwards opening something like:
ipfs://QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
will be redirected to the public gateway configured above and handled accordingly.
You can also configure a different gateway as some have voiced their concern about routing everything through dweb.link.
[0] https://blog.chromium.org/2020/09/chrome-86-improved-focus-h... [1] https://developer.mozilla.org/en-US/docs/Web/API/Navigator/r... [2] https://github.com/ipfs/go-ipfs/pull/7802
Thanks for your comment and I’m glad you liked it. Your remark is true and I was concerned as well. However the HN FAQs state:
> Are reposts ok?
> If a story has not had significant attention in the last year or so, a small number of reposts is ok.
I consider 6 as a “small number” and “significant attention” certainly > 4 upvotes (the most upvotes of a previous post) - YMMV.
> Sadly the "doesn't survive compression/re-encoding" problem is kind of a show-stopper
Indeed, that’s true - fortunately there are already ways to at least limit the problem. There is some research under the umbrella of “robust JPEG steganography” which aims to persist the covert message among compression. But I don’t know how well this actually works. LSB steganography was just the most straight forward way for me to implement.
Thanks for pointing out the security issue - I certainly wouldn’t have noticed it!
I just saw your comment and you’re completely right. If someone knew this he/she could alter the image data in a way that this approach wouldn’t work anymore.
Thanks for your comment, I’ll add it to the Limitations section!
This idea came to me when I noticed that perceptually identical but slightly different images can’t be proven to Have existed at a certain point in time.
I‘m still in search of a compelling use-case though.
Happy to hear your thoughts :)
https://documents.originstamp.com/
Also wrote a CLI: