3 ms·
Thanks for your feedback and the kind words as I have great respect for magic-wormhole as well! I watched your talk at PyCon 2016 several times as I was buildin
by dennis-tra 6y ago
Thanks for your feedback and the kind words as I have great respect for magic-wormhole as well! I watched your talk at PyCon 2016 several times as I was building pcp.
> [...] 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/ https://docs.ipfs.io/concepts/dht/
[1] https://docs.ipfs.io/concepts/content-addressing/ https://docs.ipfs.io/concepts/content-addressing/