I remembered that I did not tell an important part to ensure the possibility of communication and updating content in P2P networks.
Not all P2P networks have the ability to send and receive private messages. Also, not always the message can be left offline. We will correct this shortcoming using three features of P2P networks: search for a file, view balls (a list of published files) or comments to a file.
The lighthouse template is created once and used to create lighthouses for communication with the author.
Our message and the beacon are free to copy other members of the network. Since it is encrypted, they will not be able to read it, but will help keep it online until the addressee receives it.
This is the file from which the beacon is formed.
The lighthouse template is created by the one who wants to receive messages (addressee) and publishes in his balloon or a comment with a magnet to another lighthouse. The template should include
Template instructions should allow generating files with identical hashes (beacons) every hour or another selected period of time.
We get the fingerprint of the public key.
gpg --list-sigs --with-fingerprint
Exporting public key
gpg --export -a > lighthouse_template_[ ].txt
Open the file ( lighthouse_template_[ ].txt
) and add the instruction.
Example:
yyyy - full year UTC ± 0: 00
mm - month UTC ± 0: 00 (supplemented with zero if less than 10)
dd - day on time UTC ± 0: 00 (supplemented with zero if less than 10)
hh - hour in 24 hour time format UTC ± 0: 00 (complemented by zero if less than 10)
Beacon file name template (important for BitTorrent network):lighthouse_yyyy-mm-ddThhZ_[ ].asc
To form a beacon, add a date and time at the end of the file in the format:
yyyy-mm-ddThhZ
Signing.
gpg --clearsign lighthouse_template_[ ].txt
File: lighthouse_template_f43b4866b4f47e8e27bfafa56f4c4f2384a3135d.asc
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 - -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v2 mQENBFk6ZDMBCADE/yoNEOosw16n3P2ZSjH+quYlSbZePBudHnAlNZ/e4KSxEnXx B/44vKJX98y0X6TjCk0TVrAfJQhOrwg9/X6IMkeii1Nzt+NhrygojuVmEJS0kHvi QoJLrotBXdYWbUtfVE8zGS/qVmtFi6ns/ouV1yqLnRSA+dVfLNa/7k5glo+7TEDt g/CkSQ5CKJowPnBYnCxF4aQQQi8ydDIMXIFVyuApPRHLNsqIeA4CFlpb2Xb3ksEN /tse4zjBRgNS3nc6SLYfv6KKb8O6oHxWzz+mXlrvL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M5k YldAG2oAOj9RhVSMI4Jt+/Tf7NZixLPjMCakrGA47wQwC9bp+AmV/ST8I6/r2t3W 4uXDLUKzvZxpBUVqEG9x0olnQiBgMicyUlW1WmyMKiorVET6rSnCv3yv33lMRQRG 5txSw/z0jXhhK6ENn0mHMGeiBqGITTwjQM7uQTkw2GmNJfHpg+jThnJQran+cGDZ tvKsoBc4BFnM4eTxZfeyYPquG2QWZ59kcqm4JRyJfHYKT+CIPQXmEmD4uyp5/Q== =QxOi - -----END PGP PUBLIC KEY BLOCK----- yyyy - UTC±0:00 mm - UTC±0:00 ( 10) dd - UTC±0:00 ( 10) hh - 24 UTC±0:00 ( 10) ( BitTorrent): lighthouse_yyyy-mm-ddThhZ_f43b4866b4f47e8e27bfafa56f4c4f2384a3135d.asc : yyyy-mm-ddThhZ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJZOr9iAAoJEG9MTyOEoxNd8RIIALQUa9BuMgh+uET4wse7sBDG 19RvKbUq+9HCOaxL+Qfz+C5VO1XVIxC/Vi2iP1RVwBjkKtTANXdxcf9jR/S2ZHpL 0ohDsJ8O8EPf0sTEr5nvGE27KobEhvAb9TbxrOLuZlWtqWh09CvgyEZPVnnMa7v1 WL6xVln2BjZOkndn60ToqPcVUYQpwIEfHBz7S8WYdRFumN8sUCfJYaXGFElSLKiA 2Y+fTayhPIKcwBTzRuIU6fQWWCUA7egZ3JsWWiBP68parRcsDDOia3UiddFRr0jW lmGrsOJiZ2Vq2xfXNqY+BfcSdT8AXnt9yUYCdaH2w2oI3uEXlw8eF8JyxO60w8k= =FJOw -----END PGP SIGNATURE-----
The lighthouse is formed from the lighthouse template according to the instructions given in it. First, the template itself goes unchanged and then there is data that is formed according to the instructions from the template.
The task of the lighthouse is that both the sender and receiver can form the same lighthouse (with the same hash) and find each other or the intermediary who stores the message using the hash.
The lighthouse on June 9, 2017 18:33 Moscow will look like this.
File: lighthouse_2017-06-09T15Z_f43b4866b4f47e8e27bfafa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5/oIC8ANlGH5fFGDMNXy5MrRuFGMv/tHDuSW56rb6Kh9jPoU+1HCAGpv4zd9 iXB/nOYHlLl3NZ4+883wd0BgIKslSpvOU8sTjqcEwcIFFHr8SBUM6x1nKSq1Ad+C bEQPBA7EKdIeV/N5CZ9s6fnvUvc1bNMOO8YdJ4wCWfDSGWu7ZdPyj+Yh+9/R7EIW bEAHX5v/IcAu1u0U53goehGvEu9K4lNjibYRu8hDU02fABEBAAGJASUEGAEIAA8F Alk6ZDMCGwwFCQEOQt0ACgkQb0xPI4SjE11j5Af9EBukKcDSQfSFBgsRRxLzfk3l B4Qa7Kb2JKPdf8p+rlC8n7b7nS1WnDsh/ADnRO1+njP4oHo4eV3P09ao9PNagM5k YldAG2oAOj9RhVSMI4Jt+/Tf7NZixLPjMCakrGA47wQwC9bp+AmV/ST8I6/r2t3W 4uXDLUKzvZxpBUVqEG9x0olnQiBgMicyUlW1WmyMKiorVET6rSnCv3yv33lMRQRG 5txSw/z0jXhhK6ENn0mHMGeiBqGITTwjQM7uQTkw2GmNJfHpg+jThnJQran+cGDZ tvKsoBc4BFnM4eTxZfeyYPquG2QWZ59kcqm4JRyJfHYKT+CIPQXmEmD4uyp5/Q== =QxOi - -----END PGP PUBLIC KEY BLOCK----- yyyy - UTC±0:00 mm - UTC±0:00 ( 10) dd - UTC±0:00 ( 10) hh - 24 UTC±0:00 ( 10) ( BitTorrent): lighthouse_yyyy-mm-ddThhZ_f43b4866b4f47e8e27bfafa56f4c4f2384a3135d.asc : yyyy-mm-ddThhZ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJZOr9iAAoJEG9MTyOEoxNd8RIIALQUa9BuMgh+uET4wse7sBDG 19RvKbUq+9HCOaxL+Qfz+C5VO1XVIxC/Vi2iP1RVwBjkKtTANXdxcf9jR/S2ZHpL 0ohDsJ8O8EPf0sTEr5nvGE27KobEhvAb9TbxrOLuZlWtqWh09CvgyEZPVnnMa7v1 WL6xVln2BjZOkndn60ToqPcVUYQpwIEfHBz7S8WYdRFumN8sUCfJYaXGFElSLKiA 2Y+fTayhPIKcwBTzRuIU6fQWWCUA7egZ3JsWWiBP68parRcsDDOia3UiddFRr0jW lmGrsOJiZ2Vq2xfXNqY+BfcSdT8AXnt9yUYCdaH2w2oI3uEXlw8eF8JyxO60w8k= =FJOw -----END PGP SIGNATURE----- 2017-06-09T15Z
Hashes of this beacon (urn: [name]: [hash or multi-hash or CIDv1])
urn:sha1:mthkta2fsilqxpoox6vessac37674gl3 urn:tree:tiger:abrmyjcyckt7lccz5jjqebazmt3tkuordfetana urn:btih:i7mif67cu6r2jkxw23qwyanlx7tqqtoy urn:ed2k:7f9112c53d5ae16377d54c6bdc34d4f7 urn:sha256:ad300aeb8b4ab6db19b640883d19d0900841c25689ed97e0ec0490cd23a7bd71 urn:ipfs:zb2rhiJLDNbWfS1z6yKcTGzQcazmumkcttkXc4FFq3hfeGn8Y
Accordingly, every hour a new lighthouse is created.
Each P2P network uses its corresponding hash.
Search for files by the beacon hash allows you to send an open message in the name of the beacon file. (Gnutella2, DirectConnect, Edonkey2000, IPFS)
Searching using a hash as part of the file name will allow you to transfer the file. This can be a private message encrypted with a public key from a beacon. (Gnutella2, DirectConnect, Edonkey2000, IPFS)
Comments to the beacon file can also be used. They can have a message or a magnet on a file with a private message. (Gnutella2)
For the IPFS network, it is necessary to find the sources of the beacon and obtain source-related files / directories using the sources' public keys. Next on the list, find the beacon itself or the file / directory with the beacon hash in the name.
Get a list of peers with a beacon:
ipfs dht findprovs [ ]
The result will be multi-peaks of public keys of peers with a beacon
We get multihash balls:
ipfs name resolve [ ]
Result / ipfs / path with multihash related file or directory
We are looking for a beacon and a file with a beacon hash in the name:
ipfs refs -r --format="<dst> <linkname>" [ ]| grep "[ ]"
As a result, we get the messages:
[ ] [ ] [ ] [ ]
In the second case, the message is the contents of the file.
Load the command:
ipfs get [ ]
These networks allow searching by hash and file name. So it is enough to use the hash as a name or to search for the beacon itself according to the hash and look at the sources' ball.
In this network, it is possible to comment on file sources. In this case, it is enough to search for a beacon by hash and look at the comments on the results. Or you can also search using a hash as part of the file name.
Not yet invented. The ability to comment on the distribution was removed from uTorrent .
There is an idea to generate a large beacon and by mashing the parts to form a barcode from which you can get a hash of the new message.
The second option is to create a set of lighthouses and then the presence on the distribution will be 1 and the absence of 0. Part of the lighthouses will encode the hash and the other part of the checksum.
Something like this.
CID (Content IDentifier)
multihash
Commands | IPFS Docs
ISO 8601 is an international standard that describes the date and time format.
Other parts:
Magnet Internet 1 - Magnet
Magnet Online 2 - Hypertext
Internet Magnets 3 - P2P Website and Forum
Internet on magnets 4 - Divide the magnet into pieces
Internet Magnets 5 - Lighthouses and Messages (Personal, Public, and Updates)
Source: https://habr.com/ru/post/330666/
All Articles