https://github.com/matrixai/hs-libp2p-peer
https://github.com/matrixai/hs-libp2p-peer
haskell
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/matrixai/hs-libp2p-peer
- Owner: MatrixAI
- License: apache-2.0
- Created: 2017-06-04T07:50:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-16T09:13:20.000Z (over 8 years ago)
- Last Synced: 2025-01-24T06:29:48.416Z (12 months ago)
- Topics: haskell
- Language: Haskell
- Size: 28.3 KB
- Stars: 1
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TODO:
Various ID construction functions that take in strings, or bytes... etc, the main idea is that they can be cast into a multihash, and if they cannot, then they are not a valid ID.
IDFromBytes
IDFromString
we can collapse this into a single smart constructor that can handle these types of operations
the smart constructor checks whether the input type is a valid multihash
the decode
-- a peer id is a base58 encoded, sha256 multihash of a public key
-- a public key is a base64 encoded string of a protobuf containing a RSA DER buffer
-- one way to represent a peer id, is the id itself and the ability to carry around the private key and the public key, that's how the javascript does it