# Nano.Community Protocol Ideas
### Core Goals
- moderate & organize content (via tagging & voting)
- plan & fund objectives
- measure key results & deliverables
### Design Goals
- distributed infastructure with no reliance on singular entities
## Glossary
###### Objective
A goal with 2 or more measurables/deliverables
###### Measurable/Task/Deliverable?
A specific, quantitative, measurable/verifiable event, action, or metric attached to an objective (e.g. merged PR). Not sure what to call this.
###### Post
Text content or a link
###### Tag
A label that can be applied to posts or objectives
###### Vote
A show of support, used to moderate posts & objectives
###### Pledge
A bounty placed on key results/measurables/tasks/deliverables of objectives
## Design Overview
### Objectives & Pledging
[ how to track completed pledges ]
### Tagging
[ how is tag data used / displayed ]
### Delegation & Voting
[ todo ]
##### Hierarchy / Overriding
- Nano Account
- Community Representative
- Nano Representative
## Infastructure Components
- Node Implementation (JS/TS)
- Browser Extension
- Desktop App (not essential at the start)
- Modify nault to support signing messages
##### Peering/Communication
- Websockets? ([libp2p](https://github.com/libp2p/js-libp2p-websockets))
- Webrtc? ([signaling server](https://github.com/libp2p/js-libp2p-webrtc-star) & [direct](https://github.com/libp2p/js-libp2p-webrtc-direct))
- [bitboot](https://github.com/tintfoundation/bitboot)?
- IPFS PubSub is used to gossip account entries. The Account ID is used as the pubsub topic.
## Data structure
An append only log where each entry is content addressable on ipfs (similar to [ipfs-log](https://github.com/orbitdb/ipfs-log), [scuttlebut](https://ssbc.github.io/scuttlebutt-protocol-guide/), [hyperlog](https://github.com/mafintosh/hyperlog), [hypercore](https://hypercore-protocol.org/)).
#### Account Manifest & ID
```javascript=
{
name: 'trashman',
access_controller: '/ipfs/<hash>'
}
```
The account ID is the hash of this manifest object. The access controller is the hash of the object below. Note: `access_controller` could point to a mutable version like an eth contract or address of another append-only log.
###### Access controller
```javascript=
{
write: [ "<nano_public_key>" ]
}
```
#### Account Entry
```javascript=
{
//hash: '<ipfs hash of this entry>',
account: '<account address this belongs to>',
op: {
code: '<operation code>',
id: '<hash of value object>',
payload: {} // varies based on opcode
},
previous: '<previous entry>',
refs: ['<previous entries>'], // references to other entries, allows for skipping around
v: 0,
clock: {
id: '<lamport clock>',
time: 1
},
sig: '<nano_account_signature>' // signature of hash with a prefix
}
```
##### Operations
| Code | Value | Description |
| -------- | -------- | -------- |
| TAG:PUT | `{ label, objective_id \| post_id }` | |
| TAG:DEL | `{ tag_id }` | |
| PLEDGE:PUT | `{ objective_id }` | |
| PLEDGE:DEL | `{ pledge_id }` | |
| POST:PUT | `{ content }` | |
| OBJECTIVE:PUT | `{ content }` | |
| VOTE:PUT | `{ objective_id \| post_id }` | |
| VOTE:DEL | `{ vote_id }` | |
| COMPLETED:PUT | `{ objective_id, result_id }` | |
| COMPLETED:DEL | `{ completed_id }`| |
| ASSIGN:PUT | `{ objective_id }` | |
| ASSIGN:DEL | `{ assign_id }` | |
| DELEGATE:PUT | `{ account_id }` | |
| DELEGATE:DEL | `{ delegate_id }` | |