https://github.com/mikeshultz/k2v
Test project using libp2p
https://github.com/mikeshultz/k2v
Last synced: 11 days ago
JSON representation
Test project using libp2p
- Host: GitHub
- URL: https://github.com/mikeshultz/k2v
- Owner: mikeshultz
- Created: 2019-10-07T02:20:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-07T05:27:44.000Z (over 6 years ago)
- Last Synced: 2025-02-22T22:27:50.475Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# libp2p test project
**This is an incomplete experimental prototype.** There's nothing to see here...
## Proposal 0 (stupid)
- every node accepts sets for all keys
- node responds if it has a value for a key and if not, broadcasts and returns the first response
### Issues
- What happens if QmAlice responds with value for Key1(v1) before QmBruce can respond with Key1(v2)?
- should everyone be allowed to write?
- overwriting a key might be considered an attack vector
## Proposal 1 (unworkable)
### Overview
- each node becomes an authority for a key
- nodes will periodically broadcast their keys to their peers?
- if a request comes in for an unknown key, broadcast for it?
- timestamp is set with the value. newest wins
### Issues
- overwrite attack - a key can be overwritten by anyone with anything
## Proposal 2 (undecided)
### Overview
- set requests are sent via signed requests
- key is stored with the public key for the signer for verification
- only the signer can alter the value
- if a key is requested and the node doesn't have the value, the node broadcasts and if it gets a response, stores values for requested keys
- if there's a collision, lowest UTC timestamp wins
### Issues
- fraudulent timestamps provided by nodes - possibly mitigated by signature including timestamp?
## Proposal 3 (doable)
### Overview
- set requests are sent via signed requests
- key is stored with the public key for the signer
- requests must be accompanied with a public key to fetch (keys are actually [pubkey+key])
### Issues
- Limited use cases. Requester must know pubkey before making the request
## Proposal 4 (meh)
### Overview
- keys are set per node and use a multiaddr for a fully qualified key e.g /ip4/0.0.0.0/tcp/7755/QmXB5qhDpfHdYcySFL9YDBUrv1aA9y7mA5w93vZbuzhPXb/k2v/Key1
- setters must be authenticatedand authorized per node, each one has permissioned writers
### Issues
- Limited use cases. Requester must know what node the key is set on
- Mildly Centralized. If a node is known, why not just ask the node directly?