P.rivacy
L.ogistics
A.ccessibility
P L A N.etworks
This document is a proof of correctness for the PLAN security model, an IRC-inspired virtual channel system that serves as a canvas for community content organization, access controls, real-world security features. The purpose of this system is to host PLAN-compatible clients, playback requested channel entries, process and propagate newly authored entries, and maintain a consistent and secure state.
In computer science, a "proof of correctness" refers to a formal walk-through and demonstration that a proposed method and/or design rigorously satisfies a given set of specifications or claims. The intention is to remove all doubt that there exists a set of conditions such that the proposed method would not meet all the specifications.
Below, we express a scenario, list a set of specifications, and propose a system of operation intended to address the scenario and specifications. We then proceed to demonstrate correctness for each specification, citing how the system and its prescribed operation satisfies that specification.
This document, although labeled "proof", is not perfect and has areas needing deeper analysis. It is intended to be a blueprint and serve as an ongoing open analysis of a pluggable, distributed, and extensible system. The data structures listed here are intended to convey understanding and model correctness more than they are intended to be performant.
- Scenario
- Specifications & Requirements
- Proposed System of Operation
- Standard Procedures
- Liveness vs Safety
- Proof of Specifications
A founding set of community organizers ("admins") wish to form C, a secure distributed storage network comprised of computers with varying capabilities, each running a common peer-to-peer software daemon ("node"). C is characterized by a set of individual members for any given point in time, with one or more members charged with administering member status, member permissions, and community-global rules/policies.
On their nodes, the members of C agree to employ π, an append-only CRDT. Data entries appended to π ("transactions") are characterized by an arbitrary payload buffer, a signing public key, and a signature authenticating the transaction. Transactions on any given π are considered to be "in the clear" (i.e. neither "wire" privacy nor storage privacy is assumed).
Let πC be a CRDT whose genesis is under exclusive control of the admins of C. πC is assumed to either contain (or have access to) a verification system such that a transaction submitted to πC is acceptable only if the transaction's author (signer) has explicit π-append permission ("postage"). At first this may appear to be a strong requirement, but it reflects the transference of security liability of the key(s) specified during the genesis of πC to an external set of authorities.
For example, a customized "private distro" of the Ethereum blockchain ("⧫") could be used to implement π since:
- The admins of C, on creating ⧫C, would issue themselves some large bulk amount C-Ether (postage)
- The admins of C would periodically distribute portions of C-Ether to members of C (a postage quota).
- On C's nodes, ⧫C:
- Large payload buffers would be split into 32k segments (Ethereum's transaction size limit) and then committed.
- Any transaction that does not "burn" an amount of postage commensurate with the byte size of the payload would be dropped/rejected.
- Any transaction that attempts to transfer postage from a non-designated identities would be dropped/rejected.
For context, consider watching the distinguished George Glider in this video clip speak on the empowering nature of distributed information technology.
We acknowledge that even the most advanced and secure systems are vulnerable to private key loss or theft, socially engineered deception, and physical coercion. That is, an adversary in possession of another's private keys without their knowledge, or an adversary manipulating or coercing others is difficult (or impossible) to prevent. Biometric authentication systems can mitigate some of these threats, but they also introduce additional surfaces that could be exploited (e.g. spoofing a biometric device or exploiting an engineering oversight).
Security frameworks often don't analyze or provision for the loss of private keys since the implications are typically catastrophic, effectively making the issue someone else's intractable problem. Any system lacking such analysis and provisioning can only be considered incomplete for every-day use. The system of operation presented here features swift countermeasures and recovery once it becomes known that private keys have been compromised (or suspect activity has been witnessed).
The members of C wish to assert...
- For all actors not in C, all transactions sent to, read from, and residing on πC are informationally opaque to the maximum extent possible.
- Only members of C effectively have read and append access to πC.
- Alternatively, parts of C can be set up for "public access" where non-members of C have read access to select community content.
- There is a hierarchy of member admin policies and permissions that asserts itself in order to arrive at successive states (and cannot be circumvented).
- Even if multiple members are (or become) covert adversaries of C or are otherwise coerced, it must still be impossible to:
- impersonate other members,
- insert unauthorized permission or privilege changes,
- gain access to others' private keys or information, or
- alter πC in any way that poisons or destroys community content.
- The members of C are confident and can rest assured that every member is:
- accountable, in that any exercise of their authority is community-public information and cannot be altered or concealed, and
- bound, in that they cannot circumvent C's established rules and governance.
- Even members in the highest positions of authority within C are both accountable and bound.
- New members can be invited to and join C at any time (given that C policies and permissions are met).
- A member can be deactivated from C such that they become equivalent to an actor that has never been a member of C (aside that deactivated members can retain their copies of π‘ before the community entered this new security "epoch").
- For each node ni in C, it's local replica state ("π‘i"), converges to a stable/monotonic state as πC message traffic eventually "catches up", for any set of network traffic delivery conditions (natural or adversarial). That is, π‘1...π‘N mutate such that strong eventual consistency ("SEC") is guaranteed.
- If/When it is discovered that a member's private keys are known to be either lost or possibly comprised, a "Member Halt" can be immediately initiated such that any actor in possession of said keys will have no further read or write access to C.
- Actors that can initiate a Member Halt include:
- the afflicted member, or
- a member peer (depending on community-global settings), or even
- an automated watchdog system on C (responding to abnormal or malicious activity)
- Following a Member Halt, the afflicted member's security state enters new "epoch" and incurs no additional security liability. That is, there are no potential "gotchas" sometime down the road if an adversary gains access to previously compromised keys.
- In the event that:
- an adversary gains access to admin/root private keys and hijacks C, or
- one or more admins becomes adversarial towards C, or
- πC is otherwise corrupted or vandalized,
- ...then C can elect to "hard fork" πC to an earlier time state, where specified members are struck from the member registry and others are granted admin permission.
- C, led by a coordinated admin effort, retains the ability to switch-out π technologies.
- For example, suppose πC has the safety feature such that it automatically halts under suspicious network conditions or insufficient peer connectivity (but requires central connectivity). However, earlier in C's history, they used a CRDT that favored liveness over safety, allowing partitions of C to still be able to collaborate without central connectivity.
- Or for example, suppose a member of C inadvertently adds data to the community record that is inappropriate or legally unacceptable (even if it is no longer accessible at the client level). In such case, the community would want to "rebase" the community's persistent store so that the offending content entries are not carried over.
The members of C present the following system of operation...
- This system embraces a multi-tier security model, where each community member possesses a community-common keys as well as private keys. In effect, this places the entire system's infrastructure and transaction traffic inside a cryptographic bubble.
- The system's data model is IRC-inspired in that member interaction takes the form of data entries posted serially to channels within a virtual channel address space. However, instead of channel entries just being rebroadcast to other connected clients (as on an IRC server), entries persist as transactions replicated across πC.
- When a channel is created, it is assigned a protocol descriptor string, specifying the kind of entries that are expected to appear that channel and how UI clients should interpret them (functionally comparable to MIME types). This, plus the ability for any channel entry to include arbitrary HTTP-style headers, creates many possibilities for visually-oriented client interfaces.
- Also inspired from IRC, each channel has its own permissions settings. Each channel designates an access control channel ("ACC") to be used as an oracle for channel permissions. An ACC is a special channel type that additionally conforms to a protocol designed to specify channel permissions. Like other channels, each ACC also designates a parent ACC, and so on, all the way up to C's root-level ACC.
- Member, channel, and community security and key distribution uses "epochs" to demarcate security events, in effect furnishing permissions assurance.
- In a flow known as Channel Entry Validation, each community node ("ni") iteratively mutates its local replica ("π‘i") by attempting to merge newly arriving entries from πC into π‘i. During validation, if π‘i is not yet in a state to fully validate an incoming entry e, then e is said to be "deferred" for later processing.
- This system, in effect, forms a secure and operational core outside C's channel data space, comparable to how a traditional OS maintains internal pipelines and hierarchies of operations and permissions, designed to serve and protect user processes.
- Let
UUID
represent a constant-length independently generated identifier that ensures no reasonable chance of peer collision. Although it is difficult to express collision odds in meaningful human terms (even for "modest" probability spaces such as 1 in 2160), 20 to 32 pseudo-randomly generated bytes is more than sufficient. - Each member m in C securely maintains custody of two "keyrings":
- []km: m's personal keyring, which:
- decrypts/encrypts information "sent" to/from m, and
- creates signatures that authenticate information authored by m.
- []kC: the community keyring, which ensures C's "community-public" data is only readable by members of C.
- Each entry authored by m is encrypted by m's local client using the latest community key on []kC.
- That is, []kC encrypts/decrypts
EntryCrypt
traffic to/from πC and π‘i - Newly issued community keys are securely distributed to members via the Community Epoch Channel.
- []km: m's personal keyring, which:
- Transactions residing in πC are storage containers for
EntryCrypt
:type EntryCrypt struct { CommunityKeyID UUID // The community key used to encrypt .InfoCrypt InfoCrypt []byte // EntryInfo encrypted with .CommunityKeyID ContentCrypt []byte // Channel content, encrypted with EntryInfo.ContentKeyID Sig []byte // Authenticates this entry; signed by EntryInfo.AuthorMemberID }
- Given entry e arriving from πC and access to []kC, node ni decrypts e
.InfoCrypt
into anEntryInfo
("einfo"):type EntryInfo struct { EntryOp int32 // Entry opcode. Typically, POST_CONTENT TimeAuthored int64 // When this struct was sealed/signed ChannelID UUID // Channel that this entry is posted to (or operates on) ChannelEpochID UUID // Epoch of the channel in effect when entry was authored AuthorMemberID UUID // Creator of this entry (and signer of EntryCrypt.Sig) AuthorMemberEpoch UUID // Epoch of the author's identity when entry was authored ContentKeyID UUID // Identifies the key used to encrypt EntryCrypt.ContentCrypt }
- Every entry specifies a destination
ChannelID
within C's channel space to be merged into. - During Channel Entry Validation, newly arriving entries from πC are validated and merged into node ni's locally stored
CommunityRepo
("π‘i"). - π‘i consists of:
- a datastore for each channel
UUID
that makes an appearance in C - bookkeeping needed to resume sessions with πC
- a queue of entries to be merged in accordance with Channel Entry Validation.
- a mechanism for "deferred" entries to be retried periodically
// CommunityRepo is a node's replica/repo/π‘i type CommunityRepo struct { ChannelsByID map[UUID]ChannelStore } // ChannelStore stores entries for a given channel and provides rapid access to them type ChannelStore struct { ChannelID UUID ChannelProtocol string // "/chType/ACC" or "/chType/desc/<protocol-desc>" EpochHistory []ChannelEpoch // Record of all past channel epochs EntryTable []EntryIndex // Entry info indexed by TimeAuthored and hashname ContentTome ContentTome // Entry content store/db for channel } // EntryIndex packages the the essential parts of an entry, plus status information. type EntryIndex struct { EntryInfo EntryInfo EntryStatus EntryStatus // Status of entry (e.g. LIVE, DEFERRED) ContentPos uint64 // Byte offset into ..ContentTome ContentLen uint32 // Byte length at .ContentPos in ..ContentTome }
- a datastore for each channel
Under an append-only storage model, the mechanism that gives rise to mutable permissions and access controls is centered around ChannelEpoch
.
- In a procedure known as issuing a new channel epoch, an owner of channel πΎπ posts a new revision to πΎπ's current
ChannelEpoch
to:- edit properties specific to πΎπ, or
- designate a different parent ACC for πΎπ.
- Naturally, part of Channel Entry Validation is to reject entries from members that lack the appropriate permissions to issue a new
ChannelEpoch
for a given channel.// Specifies general epoch parameters and info type EpochInfo struct { TimeStarted timestamp TimeClosed timestamp EpochID UUID ParentEpochID UUID // 0 if this is the first epoch. TransitionSecs int // How long before previous epochs "expire" ... // Other epoch transition parameters } // ChannelEpoch represents a "rev" to a channel's security properties. type ChannelEpoch struct { EpochInfo EpochInfo AccessChannelID UUID // This is channel's parent ACC; cannot form circuit MemberGrants AccessGrants // Permissions for explicitly specified members DefaultGrants AccessGrants // Permissions for members not otherwise specified }
Channels are intended as general-purpose containers for channel entries of all forms. This system uses channels internally for administration and permissions controls.
- General purpose channels, alas, are this system's primary deliverable and raison d'Γͺtre.
- Most channels are this type and a general purpose channel is somewhat analogous to a file on a traditional operating system.
- When a new channel is created, the creator (and hence owner) specifies a "protocol descriptor", a string directing client UIs to consistently interpret, handle, and present channel entries in accordance with the expectations associated with the channel's protocol.
- Each channel also names a governing access control channel ("parent ACC"). A channel's parent ACC is charged with returning a permission level for any given member
UUID
, allowing nodes in C to independently carry out Channel Entry Validation. - General purpose channels are either:
- community-public, where channel entry content is encrypted with the latest community key, or
- private, where entry content is encrypted with the key identified by einfo
.ContentKeyID
.- Key mechanics for private channels are similar to starting a new community epoch, except the channel owner updating the
ChannelEpoch
performs key generation and distribution. - Only members that have at least read-access are "sent" the keys needed in order to decrypt private channel entries.
- By default, community admins do not have the authority/means to gain access to a private channel's key.
- This ensures that only the members that have been explicitly given channel access could possibly have access to the channel's key.
- Key mechanics for private channels are similar to starting a new community epoch, except the channel owner updating the
- Access Control Channels (ACCs) are specialized channels used to express permissions for all other channels, including other ACCs.
- An ACC serves as an access authority that specifies:
- channel permissions for a given member
UUID
, and - default permissions for members not otherwise specified.
- channel permissions for a given member
- Like general purpose channels, each ACC must designate a parent ACC, and so on, all the way up to the reserved root ACC.
- Multiple channels can name the same ACC as their parent ACC, allowing a single ACC to conveniently manage permissions for any number of channels.
- ACCs also are the vehicle for key distribution, where a channel owner "sends" a newly issued private channel to each member with access, using their public key.
- An ACC serves as an access authority that specifies:
- Reserved channels are specialized channels used by the system to internally carry out community governance and member administration.
- Reserved channels specify root-level information and permissions, namely admin and member records.
- Entries in these channels must meet additional security/signing requirements and serve prescribed purposes.
- Because reserved channels have nuanced specifications, they do not solely rely on ACCs for access controls.
- The number, purpose, and use of these channels can be expanded to meet future needs.
- This is C's root access channel, specifying which members are community authorities ("admins").
- All community-public channels, including ACCs, are implicitly under authority of this channel.
- When a new community is formed ("community genesis"), the initial entries this channel are auto-generated in accordance with the parameters and policies provided by the founding members.
- Automated machinery in C can optionally be geared to use smart contracts on πC to manage, monitor, or validate entries in this channel.
- E.g. a majority vote of existing admins could be required in order to add a new admin to the root access channel.
- This is a special channel where members post revisions to their currently published
MemberEpoch
, also known as the Community Member Registry channel.MemberEpoch
contains essential information about a specific member, such as their most recently published public keys and their "home" channelUUID
// MemberEpoch contains a member's community-public info type MemberEpoch struct { MemberID UUID EpochInfo EpochInfo PubSigningKey []byte PubEncryptKey []byte HomeChannel UUID }
- Each entry is this channel embeds a
MemberEpoch
, π, and is only considered valid if:- the member who signed the entry matches the
MemberID
that appears in π (or is an authorized member delegated to do so), and - the predecessor ("parent") epoch of π is eligible to be superseded.
- the member who signed the entry matches the
MemberEpoch
importantly publishes a member's public keys to the rest of the community, allowing each node in C to maintain a database used to:- authenticate signatures on each
EntryCrypt
- encrypt entry content exclusively for a given member (used for key distribution)
- authenticate signatures on each
- Only a community admin (or certified delegate) is permitted to post a
MemberEpoch
for members other than themselves. This provides the means for:- adding new members to C,
- deactivating members from C, and
- restoring a member's access to C following a Member Halt.
- When a Member Halt has been issued on m, an special
MemberEpoch
entry ("πhalt") is posted to this channel.- The authorizing signature of πhalt must be:
- one of m's personal signatures, or
- a member previously designated by m.
- πhalt is permitted to be signed by m's recently superseded keys, otherwise an adversary in possession of []km could "lock out" m by issuing a new member epoch.
- Once πhalt goes live, Channel Entry Validation will defer all further entries bearing m's signature.
- If/When the cause for concern is addressed, a community authority would issue a new member epoch for m, superseding πhalt.
- The authorizing signature of πhalt must be:
- This channel is where a community admin (or authorized agent) posts an entry that, in effect, replaces the current community key with a newly issued key.
- This channel contains a succession of entries that embed:
- an
EpochInfo
containing parameters associated with the new community epoch, and - a newly generated symmetric key for each member m in C, encrypted using m's latest public key published in C's Member Epoch Channel:
// KeyIssue is the vessel used to securely pass a ski.KeyEntry to another member type KeyIssue struct { MemberID UUID // Specifies the recipient MemberEpochID UUID // Implies which key was used to encrypt .KeyEntryCrypt KeyEntryCrypt []byte // Encrypted ski.KeyEntry }
- an
- Given: member m wishes to replace their currently published
MemberEpoch
with a new revision:- m generates new encryption and signing key pairs and places the private keys into their personal keyring, []km.
- m prepares a replacement
MemberEpoch
, πβ², placing the newly generated public keys into πβ². - m packages πβ² into a new entry ("eπβ²"), signs it, and posts it to C's Member Epoch Channel.
- As eπβ² propagates across πC (and goes live on π‘i):
- Channel Entry Validation now requires that entries authored by m must use the newly published signing key.
- Other member clients intending to securely pass keys or content to m would use m's updated public encryption key.
- If a Member Halt has been ordered on m, then admin (or community authority) intervention is required before m is permitted to post a new
MemberEpoch
.
- Given: an admin, delegated member, or an automated agent wants to issue a new/replacement community key and deprecate the previously issued community key.
- The purpose of starting this new "community epoch" is so that an actor in possession of the community keyring ("[]kC") will no longer be able to decrypt community-public data on C unless they are currently a member of C. This typically applies after a Member Halt or after deactivating a member since it's important that the currently active community key (and an actor in possession of it) is longer used to encrypted community traffic.
- As the newly posted community key epoch goes live across the nodes of C, all new
EntryCrypt
on πC are encrypted using it. - A community authority or agent does the following:
- Generates a new symmetrical key to serve as the next community key ("kC").
- Prepares a new entry containing an
EpochInfo
("πC"). - For each open/active
MemberEpoch
("πm") in the Member Epoch Channel (for each member m in C):- Creates a new
KeyIssue
(intended for m), encrypting kC using πm.PubEncryptKey
, - Appends the
KeyIssue
key to πC's content body.
- Creates a new
- Posts πC to the Community Epoch Channel.
- Member m's client, upon seeing πC go live:
- Searches the content body of πC for a
KeyIssue
matching m's member ID. - Recovers kC from the
KeyIssue
using the member's private keyring. - Adds kC to m's own community keyring.
- Uses kC to encrypt all subsequent authored entries bound for πC
- Searches the content body of πC for a
- Within ΞC, newly authored transactions are strictly only readable by the current members of C.
- An actor in possession of a halted keyring or any keys past member epochs will not have any of the keys needed to extract kC.
- If πC favors safety, then C could additionally be configured to reject entries encrypted with a community key older than ΞC since offline nodes effectively remain in a halted state until they regain access to a critical threshold of central validators.
- Given: an owner of channel πΎπ decides to alter permissions on πΎπ, such as:
- editing πΎπ's default access permissions to be more restrictive, or
- removing access permissions for explicitly named members, or
- making πΎπ private and granting access to only specifically listed members of C.
- Similar to issuing a new member epoch, πΎπ's owner posts an entry to πΎπ to revise the current
ChannelEpoch
. - If πΎπ is private, a procedure similar to issuing a new community epoch distributes πΎπ's latest access key to members that have at least read-only access to πΎπ.
- Given: member m (or their private keyring) is potentially under the control or influence of an another.
- A "Member Halt" refers to an automated sequence of actions performed on m's behalf once it's believed that their personal keyring ("[]km") is under the influence of another.
- The conditions/requisites needed in order to initiate a Member Halt on another's behalf can be arbitrarily based on security needs and situational circumstances.
- A Member Halt on m could be initiated by:
- m, upon discovering that another actor has gained access to []km, or
- a peer of m (previously designated by m), upon receiving a message or signal of duress from m, or
- a community automated agent, noticing damning/malicious activity originating from a holder of []km.
- Once a Member Halt is initiated on m:
- A special entry is posted to the Member Epoch Channel, signaling to all nodes in C to defer all further entries signed by []km
- β this prevents any actor in possession of []km from posting any entries as m.
- A special transaction is submitted to πC, immediately "burning" the ability of m (or any actor in possession of []km) to post further transactions.
- As this propagates across πC, subsequent transactions signed by []km will be rejected because post permission on πC will no longer exist for []km.
- This removes an adversary's ability to vandalize πC (e.g filling it with junk data).
- For example, for ⧫C, the transaction would send all m's C-Ether to address
x0
.
- An admin, automated agent, or delegated member(s) would issue a new community epoch for C.
- Since newly issued community keys aren't posted for halted members, any agent(s) in possession of []km would lose all further read access to πC since they would not have a key to extract the newly issued community key for C.
- A special entry is posted to the Member Epoch Channel, signaling to all nodes in C to defer all further entries signed by []km
- Given: a Member Halt was issued on m.
- Some time later, admin(s) or delegated members can review the situation:
- When appropriate, m's access is restored and new keys issued using a variant of adding a new member.
- In the case that an adversary in possession of []km transfers their postage (their privileges on πC) to another identity before a Member Halt is issued on m, entries using postage from the illicit postage could be identified and rejected.
- In the case that an a adversary in possession of []km issued a new member epoch (impersonating m), then an admin in communication with m would issue new entries that rescind the earlier entries as appropriate. As normal Channel Entry Validation proceeds, this will automatically result in any dependent (adversary-authored) entries to be removed from "live" status.
- Given: the permissions/prerequisites on C are met to bestow member status to actor Ξ±:
- A designated authority of C generates and posts a special
MemberEpoch
, πΞ±0, in the Member Epoch Channel, containing:- a newly generated
MemberID
for Ξ±. - newly generated public keys.
- information on Ξ±'s invitation, such as:
- documentation of which authorities in C were connected to Ξ±'s invitation.
- proof that Ξ±'s invitation was granted by the collective authority of C.
- a newly generated
- Also created is token Ο, containing:
- a copy of πa0, and
- a copy of the community keyring, []kC, and
- the private half of public keys in πa0, and
- network addresses and other bootstrapping information needed in order to connect to πC, and
- a token that bestows its bearer postage on πC.
- Ο is encrypted with a passphrase, and is passed to Ξ± via USB device, email, file sharing, etc.
- Using face-to-face communication, direct contact, or other secure means, Ξ± is passed the passphrase to Ο.
- On a newly created "blank" node, nΞ± (or an existing node of C in a logged-out state):
- Ξ± passes Ο to the client
- the client prompts for the passphrase that decrypts Ο
- the client opens Ο and now has what it needs to:
- connect and write to πC
- decrypt entries from C and rebuild π‘Ξ± normally
- Once that π‘Ξ± is up to date (i.e. once πΞ±0 is live in the Member Epoch Channel), Ξ± posts a successor
MemberEpoch
as they would when starting a new member epoch.
- A designated authority of C generates and posts a special
- Given: the admins and/or collective authority of C decide that member m is to be "deactivated", meaning that m's access C is to be immediately rescinded.
- The designated authority of C performs a procedure identical to the Member Halt procedure. In effect:
- Any subsequent entries authored by m will be rejected, and
- m will be unable to post any transactions to πC, and
- All new entries on πC will be unreadable to m within ΞC
- Given node ni in C, let π‘i denote the local replica state of πC on node ni at a given time.
- Channel Entry Validation is the process of merging incoming entries arriving from πC such that entries placed into "live" status (on π‘i) comply and are in integrity with all relevant author and channel permissions and intent.
- Since entries can arrive at ni in arbitrary order from πC, entries will arrive whose validation will depend on other entries that have not yet been processed β or entries yet to even arrive.
- As node ni processes an incoming entry e to be merged with π‘i:
- If e satisfies all channel properties and parent ACC permissions, then e is placed into "live" status.
- Otherwise, if for whatever reason e cannot complete validation, then e is placed into "deferred" status.
- Node ni periodically reattempts to validate e as other entries go live on π‘i.
- Unless e was crafted with malicious intent, it would be unexpected for e to remain indefinitely deferred.
- For each new entry e arriving from πC (or is locally authored and also submitted to πC):
- Authenticate e:
- edigest β ComputeDigest(e
.CommunityKeyID
, e.InfoCrypt
, e.ContentCrypt
) - einfo β
EntryInfo
β Decrypt(e.InfoCrypt
, []kC.LookupKey(e.CommunityKeyID
)- if the community key is not found, then e is deferred.
- πauthor β π‘i.LookupMemberEpoch(einfo.
AuthorMemberID
, einfo.AuthorMemberEpoch
)- if πauthor =
nil
, then e is deferred. - if einfo
.TimeAuthored
falls outside the scope of πauthor, then e is deferred.
- if πauthor =
- kpub β π‘i.LookupPublicKey(einfo.
AuthorMemberID
, einfo.AuthorMemberEpoch
)- if kpub =
nil
, then e is deferred.
- if kpub =
- ValidateSig(edigest, e
.Sig
, kpub)- if e
.Sig
is invalid, then e is deferred.
- if e
- edigest β ComputeDigest(e
- Validate e in its destination channel:
- πΎπdst β π‘i.GetChannelStore(einfo.
ChannelID
)- if πΎπdst =
nil
, then e is deferred.
- if πΎπdst =
- Check that e cites an agreeable
ChannelEpoch
:- πcited β πΎπdst.LookupEpoch(einfo.
ChannelEpochID
)- if πcited =
nil
, then e is deferred.
- if πcited =
- if einfo
.TimeAuthored
falls outside the scope of πcited, then e is deferred. - if πcited.CanAccept(einfo), then proceed, otherwise e is deferred.
- πcited β πΎπdst.LookupEpoch(einfo.
- Check that πΎπdst's parent ACC permits e:
- πΎπAC β π‘i.GetChannelStore(πcited.
AccessChannelID
) - π
author β πΎπAC.LookupPermissions(einfo.
AuthorMemberID
) - if π
author does not allow einfo
.EntryOp
, then e is deferred.
- πΎπAC β π‘i.GetChannelStore(πcited.
- If e inserts a permissions change but does not issue a new channel epoch as required, then e is deferred.
- πΎπdst β π‘i.GetChannelStore(einfo.
- Merge e into π‘i:
- πΎπdst.InsertEntry(e)
- Propagate the mutation of πΎπdst as required ("revalidation"):
- if πΎπdst is now equally or less restrictive, then
return
since dependencies that are live will be unaffected. - if πΎπdst is now more restrictive, then revalidate dependent channels:
- trev β einfo
.TimeAuthored
- []πΎπdep β πΎπdst.GetDependentChannels(trev)
- for each πΎπj in []πΎπdep:
- Scanning forward from trev in πΎπj, for each entry ek:
- (re)validate ek (4 validate steps above)
- if ek is now deferred:
- πΎπj.RemoveEntry(ek)
- Defer ek normally
- Sub-propagate the mutation of πΎπj as applicable
- Scanning forward from trev in πΎπj, for each entry ek:
- trev β einfo
- Although there are edge cases where change propagation could result in a cascading workload, the amount of work is generally either n/a or negligible. This is because:
- Most entries are content-related, not access-control related.
- Revalidation only needs to proceed if an entry makes a channel more restrictive.
- For example, compare the number of ACL-related files stored on a conventional workstation to the total number of files.
- Only ACCs tend to have dependent channels.
- Mutations to a channel occur close to the present time, so only O(1) of all entry history typically needs to be revalidated.
- If πC favors safety over liveness, then there a highly limiting trailing time boundary for how "late" an entry can arrive (e.g. 10 seconds).
- Most entries are content-related, not access-control related.
- Revalidation can also be strategically managed, where multiple ACC mutations are scheduled such that only a single revalidation pass is needed.
- if πΎπdst is now equally or less restrictive, then
- Authenticate e:
"Liveness versus safety" refers to canonical tradeoffs made during the design of a blockchain or distributed ledger. This discussion is variant of the CAP theorem applied to distributed ledgers, where "liveness" corresponds to availability and "safety" corresponds to consistency. Here, we weigh the tradeoffs made by a given πC implementation:
- If πC favors liveness over safety (such as Ethereum or Holochain), then partitions of πC will operate independently and will synchronize when rejoined. This implies:
- ΞC will reflect network latency and topology.
- Channel Entry Validation could potentially encounter an important but late-arriving entry, triggering a cascade of entry revalidation.
- The nodes of C are conveniently "offline-first" and will operate in independent cells if network connectivity is limited.
- As partitions rejoin after some time and synchronize, each π‘i will receive new batches of old transactions (from other partitions).
- If πC favors safety over liveness (such as a central server, EOS, DFINITY, Hashgraph), then πC by definition integrates a consensus mechanism that enforces a trailing timestamp boundary ("tb") for transactions. This implies:
- ΞC is helpfully fast (1-10 seconds)
- Channel Entry Validation has the luxury to finalize entries older than tb since later-arriving entries are not possible.
- However, the nodes of C require central network connectivity in order to operate. If nodes partition from the central network:
- the πC nodes will halt, even though the nodes still have connectivity with each other, and
- the πC nodes will only resume if/when the partition regains central network connectivity.
Each item below corresponds to each item in the Specifications & Requirements section.
Signal Opacity asserts that outside actors can't infer material information by analyzing community wire traffic.
- Given that (a) all community channel entries reside within transactions stored on πC, and (b) transactions are considered to be "in the clear":
- What information is discernible to actors outside of C?
- Let Ξ± be an actor that is not a member of C, implying that Ξ± does not possess the latest community keys.
- β the only information directly available to Ξ± is the
UUID
of the encryption key used for eachEntryCrypt
on πC.- β information opacity is maximized since all information resides within
InfoCrypt
andContentCrypt
.- Adversaries snooping πC can only discern when a new community security epoch began (by noting the appearance of a new community key
UUID
). However, this is weak information since such an event could correspond to any number of circumstances.
- Adversaries snooping πC can only discern when a new community security epoch began (by noting the appearance of a new community key
- β only members of C effectively have read-access to C's content and member activity.
- β information opacity is maximized since all information resides within
- If Ξ± is a former member of C, then Ξ±'s access is limited to read-only up to when Ξ± was deactivated (when the new community epoch was issued as part of deactivating a member).
- β the only information directly available to Ξ± is the
Access Exclusivity asserts that only members of C can read and write to the shared data store.
- Read-Access Exclusivity
- Only an actor is possession of the community keyring ("[]kC") has the ability to read community-public content residing on πC. See Proof of Signal Opacity.
- Write-Access Exclusivity
- There are three layers that prevent the unauthorized mutation of πC or a community replica/repo ("π‘i"):
- πC Postage, the mechanism ensuring that πC will only accept storage transaction txnj if:
- txnj bears an author that πC recognizes as having permission to post a transaction of that size, and
- txnj bears a valid signature that proves the contents and author borne by txnj is authentic.
- Community Keyring Access, referring to that only community members are issued []kC.
- So even if actor Ξ± is able procure postage on πC, they must also submit an
EntryCrypt
containing anEntryInfo
encrypted using a recent community key β otherwise π‘i will reject it.
- So even if actor Ξ± is able procure postage on πC, they must also submit an
- Channel Entry Validation, referring to "deep" validation of entries arriving from πC. Part of this flow is verifying that:
- the signature contained in a given
EntryCrypt
is a valid signature from the memberUUID
borne by itsEntryInfo
, and - the member is a valid/current member of C (based on π‘i's Member Epoch Channel).
- the signature contained in a given
- πC Postage, the mechanism ensuring that πC will only accept storage transaction txnj if:
- Given that the members of C maintain exclusive possession of their private keys, only they can mutate πC or π‘i.
- In the case where m's private keys are possibly compromised, m would immediately initiate a Member Halt, leaving any actor in possession of m's keys challenged or unable to move past the above layers.
- For in-depth security scenario analysis, see Proof of Practical Security Provisioning.
- There are three layers that prevent the unauthorized mutation of πC or a community replica/repo ("π‘i"):
Permissions Assurance asserts the access controls on C remain in effect and cannot be circumvented.
- In order for a channel entry to be "live" in a node's repo ("π‘i"), it must repeatedly survive Channel Entry Validation.
- β each successive state of π‘i is, exclusively, an authorized mutation from its previous state.
- However, if an important entry is withheld from node ni, it is easy to imagine dependent entries piling up and π‘i being at a standstill.
- In addition to transactions arriving out of order from πC naturally, we must consider if entries are altered, reordered, or withheld by adversaries manipulating communications signals or infrastructure.
- We can rule out corruption or alteration of entries since each
EntryCrypt
bears a signature dependent on its contents, so altered entries would be immediately rejected.- The case where an adversary covertly has possession of a member's private keys is discussed in Proof of Practical Security Provisioning.
- So then, could the reordering, blocking, or withholding ("withholding") of entries from πC cause π‘i to pass through a state such that access controls or grants established by members of C could be circumvented or exploited? We separate the possibilities into two categories:
- Unauthorized key, channel, or content access
- These scenarios are characterized by gaining unauthorized access to a privileged key that in turn allows read access to restricted content within π‘i.
- Since any withholding of entries can't result in the additional generation/grant of permissions, the remaining possibility is that withholding entries somehow result in π‘i not mutating such that privileged data somehow remains accessible. This is a legitimate concern, however, Channel Entry Validation requires that any mutation that is access-restrictive in nature must also issue a new channel security epoch. In this process flow, only members with access privileges are (securely) issued the newly generated private channel key. Similarly, this is why a new community epoch is issued when a member is deactivated or a Member Halt is issued (but not when a new member is added).
- β In the case where entries are withheld from ni, there is no possibility that subsequent entries could reveal restricted material since new peer entries would be encrypted with a newly issued member, channel or community key (after ΞC) .
- Circumventing access controls
- These scenarios are characterized by posting maliciously crafted channel entries on C intended to circumvent access controls.
- Given Proof of Access Exclusivity, we know that in order for π‘i to be mutated (or maliciously manipulated), the perpetrating actor must possess both an active member and community keyring.
- β this would start with m (or an adversary covertly in possession of m's keys) authoring and submitting said entries in an attempt to somehow sidestep an aspect of the system's channel permissions enforcement. How could an entry go live across C whose parent ACC denies access? Channel Entry Validation's primary purpose is to ensure that only entries that validate under the parent channel's ACC are placed into "live" status.
- What if m (or an adversary in possession of m's keys) "hot-wires" their node or manually crafts an entry to perform an operation not allowed by m?
- Although m would be able to submit doctored entries to πC, Channel Entry Validation running on every other community node would see that m does not have the required privileges and would indefinitely defer (reject) the entry.
- This is analogous to submitting a transaction on the global Bitcoin or Ethereum blockchain that transfers coinage from an ID that does not have sufficient funds β the transaction will never validate.
- Unauthorized key, channel, or content access
Accountability Assurance asserts that members who exercise authority are accountable and remain bound to community policies and expectations.
- Every member action (mutation) on C is manifested as a channel entry, whether that is a routine content entry or a specially-signed entry in the Member Epoch Channel.
- β every member interaction (channel entry) is replicated across πC, an append-only storage layer, and available for review to all other members of C.
- β entries are immutable on πC and any attempt to conceal or rescind an entry will not alter the original entry.
- β all actions in community-public channels, which includes all community administrative reserved channels, are always openly visible for peer review and scrutiny.
- In private channels, entry content is encrypted and only members granted access by the channel's owner can read the channel's content.
- By default, not even community admins or authorities can gain access to private channel content unless they have been granted access.
- Through private channel content is cryptographically secure, some metadata is community-public information β namely, who is generating activity, with whom, and how often.
- Although the actions of a member in private channel πΎπp cannot be witnessed or reviewed by members outside of that channel, any participant of πΎπp could be pressured by community authorities to turn over the channel's keyring (or face deactivation or social/legal repercussions).
- Community authorities are free to make use of private channels (just like other community members), but any action affecting reserved or community-public channels would be publicly available information and would be part of the permanent record that is πC.
- Important channels, such as reserved channels or channels used to conduct community governance, could harness the dependable and predictable nature of "smart contracts" on πC. For example:
- C has a special community admin account capable of executing community propositions. This virtual agent (and its private keys) are wired into a smart contract on πC such that β of C's "council" members are needed to sign a proposition before the contract's "threshold" signature triggers the proposition to be executed with admin permissions.
- C makes use of a channel UI extension that in effect recreates a voting booth, allowing the members of C to vote on community propositions. Corresponding smart contracts on πC would be wired into these channels such that community members would have full assurance that voted propositions are executed reliably and predictably.
Membership Fluidity asserts that members can be added and deactivated at any time.
- Both Adding a New Member and Deactivating a Member procedures are implemented using standard entries in C's channel system. These entries, like all other channel entries, undergo Channel Entry Validation plus additional checks and restrictions.
- β Membership Fluidity is just a specific form of Permissions Assurance and is thus addressed in Proof of Permissions Assurance.
- β all the properties, assurances, and protection afforded by Channel Entry Validation extends to the ability for community authorities to add and deactivate members.
Strong Eventual Consistency asserts that community replicas eventually arrive at the same state and are independent of network delivery.
- For each node ni in C, it's local replica state ("π‘i") at a given time is dependent on:
- The set and order of entries that have arrived from πC and have been authored locally.
- Channel Entry Validation reviewing newly arrived entries and entries previously deferred.
- Given that natural or adversarial network conditions could cause entries to and from πC to be delayed or withheld:
- Once all entries replicated across πC eventually arrive at n1...nN, are π‘1...π‘N each in an equivalent ("consistent") state?
- This system's Proof of Permissions Assurance implies that the eventual state of π‘i is independent of the order of arrival of entries from πC.
Practical Security Provisioning refers a system's inherent ability to address real-world security incidents. Although this section is intended to convincingly analyze how this system provisions for severe security scenarios, we acknowledge that the more severe and multifaceted the scenario, the more complex and divergent a complete analysis becomes. Given member m in C, this system provisions for:
- A scenario where... m loses/erases all copies of their private keyring ("[]klost").
- A community admin (or delegated member) would use a procedure similar to adding a new member, resulting in a successor
MemberEpoch
to be issued for m. - β m would fully retain and resume their identity in C, however m would lack the private keys needed to access their private channels.
- Fortunately, for each private channel πΎπp that m had access to, m could regain access if at least one other member has at least read-access to πΎπp (allowing m to successfully petition for the channel's keyring).
- This could be automated and implemented in various ways, but m would not regain keys to private channels if the members are no longer active (since their client would need to be active to package keys into an entry in response to m's petition).
- If m were to someday recover []klost, access to past data would be fully restored at no disadvantage.
- If an adversary were to somehow recover []klost in an unlocked state, they would, at most, have read-access up to the time when m's new
MemberEpoch
was published.- Entries signed by []klost and processed by π‘i would be rejected since the
MemberEpoch
associated with the latest private key in []klost would be superseded.
- Entries signed by []klost and processed by π‘i would be rejected since the
- A community admin (or delegated member) would use a procedure similar to adding a new member, resulting in a successor
- A scenario where... an adversary ("O") gains access to m's private keys ("[]km") through deception, coercion, or covert access to m's client device.
- as expected, O would be able to:
- read all community-public data on C
- author entries impersonating m
- read content intended to be private for m
- When m, a peer of m, an admin, or an automated notices something is amiss, they would initiate a Member Halt on m. As part of the Member Halt:
- O would lose append/post access to C (twofold: no postage and m's
MemberEpoch
suspended), and - O would lose further read access to πC once a new community epoch is issued.
- O would lose append/post access to C (twofold: no postage and m's
- In the case that O issues a new member epoch (impersonating m) before a Member Halt is issued:
- m would still be able to issue a Member Halt, and
- an authority within C, in communication with m, would later rescind any entries in the Member Epoch Channel authored by O.
- as expected, O would be able to:
- A scenario where... a dishonest community authority ("O") within C covertly wishes to snoop on m.
- At no point would O have had access to []km since m's private keys never leave m's client process space by design.
- β O has no ability to gain access to content encrypted for m, including content in m's private channels.
- In the event that O posts a new
MemberEpoch
for m without permission, m would immediately become aware once m's client sees the epoch issued.- Hijacking another's identity as in this case would not allow the perpetrator to gain access to any of m's private data since only m has possession of []km.
- β O would only gain the ability to impersonate m only as long as m remains offline.
- At no point would O have had access to []km since m's private keys never leave m's client process space by design.
- A scenario where... multiple adversaries covertly infiltrate C.
- Plan A: Surgical Member Halt Attack
- Since a member halt only suspends a member's access to C, its utility as an attack vector is limited to a one-time DoS for the targeted member.
- This attack can be quickly be undone by an admin, and the offending member's integrity would immediately move under a spotlight.
- Limitations could be added that would guard against adversarial behavior. Examples:
- a member could be limited to ordering one Member Halt per day
- members could limit whom could order a halt on them, limiting anonymous misuse
- Plan B: Vandalization of C
- The authorities of C could:
- manually rescind the offending entries.
- retroactively deactivate the
MemberEpoch
of the offending members, resulting in a revalidation cascade as Channel Entry Validation propagates the change.- Each dependent entry would automatically be placed into rejected status on each community node during propagation.
- hard fork πC to an earlier state if the vandalism was pervasive (e.g. though postage guards against this, gigabytes of junk appended to πC).
- Proof of Independence Assurance describes variations of this recovery flow.
- The authorities of C could:
- Plan A: Surgical Member Halt Attack
Independence Assurance asserts that any member subset of C can independently fork C with a replacement governance or leadership structure.
- Suppose some members of C decide, for whatever reason, that they are better off in their own community ("Cβ²"), with their own pact of governance or leadership.
- They desire Cβ² to be the equivalent of C but only up to a given time ("tCβ²") β at which time the authority structure or membership is arbitrarily altered.
- Let g be the genesis authority of C at time of its creation.
- Let []a be the admins of C at time tCβ²
- Let []aβ² be the founders (and admins-to-be) of Cβ²
- Given that πC is append-only CRDT, each transaction is assumed to have a timestamp and identifying ID.
- β πC is characterized as a set of sealed data transactions and can be partitioned at any given time index.
- The founders of Cβ² do the following:
- Instantiate a new CRDT ("πCβ²") and allocate bulk postage identically to πC's genesis in addition to allocating bulk postage to []aβ².
- Copy the parameters from C's genesis in addition to grant admin status to []aβ².
- Transfer entries from πC to πCβ² up to time tCβ² (omitting entries as desired).
- Allocations from step (1) ensure that transactions copied from πC and posted to πCβ² will clear.
- Once is πCβ² updated up to desired time, []aβ² can effectively assert control:
- They demote or deactivate []a (and any other desired members), and
- For each member demoted/deactivated, reduce/burn their postage allocation on πCβ² as appropriate.
- β Cβ² is free to operate independently of C and under the authority of []aβ².
- Although Cβ² is now operating under altered governance or leadership, the privacy of all legacy encrypted entry content is preserved. Otherwise, members from C would have had to disclose their private keys.
Storage Portability asserts that C is not permanently bound to its storage layer implementation.
- Suppose C wishes to switch to an alternative CRDT technology.
- Using a simplified form of the steps listed in Proof of Independence Assurance, C can coordinate a switch to a new CRDT medium almost transparently.
- This is to say that π is to C as a hard drive is to an operating system. C's "hard drive" can be replaced:
- with the an updated model, or
- with a different "brand", or
- with a different storage technology all together.
In any system, replicated data transactions and messages take non-trivial periods of time to traverse and propagate across the network. Also, any number of nodes could be offline for indefinite periods of time. No assumptions are made about network connectivity or reachability in this proof, and propagation times are expressed as "ΞC":
- Let ΞC be the time period needed for there to be at least a 99.7% chance that all reachable nodes in C have received a given replicated transaction across πC.
- ΞC serves as a "rule-of-thumb" for characterizing information latency within C. It allows us to more fully express aggregate performance, decision making calculus, and case-study analysis.
- Although ΞC depends on how aggressively πC trades off redundancy with bandwidth conservation, ΞC generally tracks with
log(N)
, givenN
"well-connected" nodes. - β Even a "dumb" peer-based network has attractive latency characteristics as N increases at human scales. For example:
- Consider a collection of N=1000 well-connected nodes, having:
- a standard distribution of node neighbor latency centered at .2 sec (with Ο = .1 sec)
- a standard distribution of "swarm diameter" centered at 10 hops (with Ο = 5 hops).
- β ΞC is in the neighborhood of (.2 + 6 * .1) * (10 + 6 * 5) secs (about 1 minute).
- If N is doubled, then ΞC only increases a couple seconds since the limiting swarm diameter increases by 2-3 hops.
- Consider a collection of N=1000 well-connected nodes, having:
Like the way an operating system is only as swift as its host storage system, the latency and "liveness" (availability) of the system presented below is solely dependent on π. This means that the design tradeoffs that πC makes will determine C's overall network properties and behavior. Liveness vs Safety discusses tradeoffs for various choices of π.
Back to README