Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New CAIP - Community-Powered Assessment of Trust in Discrete Resources (Split of former: Community-powered trust assessment in software components) #271

Open
wants to merge 74 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
ce04b9a
Initiation caip-x.md "Community-powered trust assessment of software …
dayksx Nov 21, 2023
99fc5e6
Update caip-x.md
dayksx Nov 21, 2023
92a737f
Update caip-x.md
dayksx Nov 21, 2023
b9c2c0b
Update caip-x.md
dayksx Nov 22, 2023
9314bab
Update caip-x.md
dayksx Nov 22, 2023
2da6cd6
Update caip-x.md
dayksx Nov 22, 2023
05ba362
Update caip-x.md
dayksx Nov 22, 2023
6b52c09
Update caip-x.md
dayksx Nov 23, 2023
f5d1b80
Update caip-x.md
dayksx Nov 23, 2023
05edd26
Update caip-x.md
dayksx Nov 24, 2023
e5f4449
Update caip-x.md
dayksx Nov 26, 2023
28fc65a
Update diagram caip-x.md
dayksx Nov 26, 2023
c412fbe
Update caip-x.md
dayksx Nov 27, 2023
7a03226
Update caip-x.md
dayksx Nov 27, 2023
c7b7fc8
Update caip-x.md
dayksx Nov 29, 2023
22c7520
Update caip-x.md
dayksx Nov 29, 2023
c6bd2fe
Update caip-x.md
dayksx Nov 30, 2023
2e3d5e0
Change from `did:snap` to `snap://`
dayksx Nov 30, 2023
ab8e9d5
Update trust scope references
dayksx Dec 4, 2023
5c49bab
Update caip-x.md
dayksx Dec 4, 2023
986cec4
Update verifiable credentials name
dayksx Dec 4, 2023
a55fd6f
Update caip-x.md
dayksx Dec 7, 2023
3833b98
Update caip-x.md
dayksx Dec 7, 2023
7726b85
Update security report credential
dayksx Dec 8, 2023
9dab667
Update caip-x.md
dayksx Dec 8, 2023
193e32f
Update caip-x.md
dayksx Dec 8, 2023
61c0061
Update caip-x.md
dayksx Dec 8, 2023
01667be
Update caip-x.md
dayksx Dec 8, 2023
7e35b85
Update caip-x.md
dayksx Dec 11, 2023
5ceb07e
Update metamodel diagram
dayksx Dec 13, 2023
f1d7291
Rename StatusCredential to ReviewCredential
dayksx Jan 29, 2024
282c3b2
Update caip-x.md
dayksx Feb 6, 2024
de4e12e
Update caip-x.md
dayksx Feb 6, 2024
9c0cb58
Update the ReviewCredential data structure
dayksx Feb 7, 2024
b86c6f6
Update the metamodel view
dayksx Feb 7, 2024
ee2d23f
mega editorial commit - formatting, images, and content edits
bumblefudge Feb 17, 2024
c7ddb83
Spelling correction
dayksx Feb 29, 2024
841f306
Change DID specification
dayksx Feb 29, 2024
f54fd5c
Set DIDs for each IDs
dayksx Feb 29, 2024
ee74c74
Spelling correction
dayksx Feb 29, 2024
737a1b5
Spelling correction
dayksx Feb 29, 2024
1066f4d
VCs proof explanation
dayksx Feb 29, 2024
9db0ef8
Set CAIP ID
dayksx Mar 7, 2024
3f85f11
add missing new ID
dayksx Mar 7, 2024
1d5dfbe
Change author info
dayksx Mar 7, 2024
6ccd7a7
initial split of caip-261
dayksx Mar 12, 2024
47520fb
Spelling correction
dayksx Feb 29, 2024
d1094c6
Change DID specification
dayksx Feb 29, 2024
0665a46
Set DIDs for each IDs
dayksx Feb 29, 2024
8266f09
Spelling correction
dayksx Feb 29, 2024
587d909
Spelling correction
dayksx Feb 29, 2024
274e77e
VCs proof explanation
dayksx Feb 29, 2024
528defe
Change author info
dayksx Mar 7, 2024
141386f
Merge branch 'main' into ChainAgnostic-editorial/pr-261-rewrite-to-ge…
dayksx Mar 12, 2024
05e907f
Merge pull request #2 from dayksx/ChainAgnostic-editorial/pr-261-rewr…
dayksx Mar 12, 2024
08a4ceb
Merge branch 'main' into caips-split
dayksx Mar 12, 2024
ad6f0f1
Update Web of Trust primitive CAIP
dayksx Mar 15, 2024
67107e6
update Web of Trust CAIP
dayksx Mar 18, 2024
8c3c2af
Update Web of Trust primitive CAIP
dayksx Mar 18, 2024
b605498
Update Web of trust primitive CAIP
dayksx Mar 19, 2024
724a4cd
Update Web of Trust Primitive CAIP
dayksx Mar 19, 2024
60abf26
Add CASA PR comments
dayksx Mar 19, 2024
54c9f8a
CAIP part-1 Web of Trust Primitives
dayksx Mar 19, 2024
f31898d
Init Community-Powered Trust Assessment CAIP-x
dayksx Mar 19, 2024
3630475
Update caip-x
dayksx Mar 19, 2024
ff72e80
Change the introductory view
dayksx Mar 21, 2024
2c52680
Update caip-x with new scope: discreet resources
dayksx Mar 21, 2024
48b9f81
Update caip-x
dayksx Mar 22, 2024
d0fed9b
Update caip-x
dayksx Mar 22, 2024
1d6e18c
Change CAIP name
dayksx Mar 26, 2024
3dc3c97
Update and rename caip-x to caip-271
dayksx Mar 26, 2024
7565070
Update diagram
dayksx Mar 26, 2024
9ca17f8
remove trust computer concept
dayksx Jun 26, 2024
67210da
Specify "type" with "verificationType" and "issueType"
dayksx Jun 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
372 changes: 372 additions & 0 deletions CAIPs/caip-261.md

Large diffs are not rendered by default.

267 changes: 267 additions & 0 deletions CAIPs/caip-271.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
---
# Every document starts with a front matter in YAML enclosed by triple dashes.
# See https://jekyllrb.com/docs/front-matter/ to learn more about this concept.
caip: CAIP-271
title: Community-Powered Assessment of Trust in Discrete Resources
author: Dayan | dayan.fc | dayan.lens | dayanx.eth | (@dayksx) <[email protected]>
discussions-to: <URL(s); if multiple, list separated by , without " or []>
status: Draft
type: Standard
created: 2023-11-21
updated: 2023-11-21
requires: CAIP-261
---

## Simple Summary

CAIP-271 introduces a data framework to represent assertions for evaluating discrete resources, such as software components, packages, or media files, by utilizing community assertions and pulling in trust data from webs of trust and other implicit trust signals.

## Abstract

The evaluation of discrete resources necessitates different kind of community feedback according to the specific purpose of the assessment.
Whether assessing resources for security concerns or for their user-friendliness, the type and depth of feedback required differ significantly.

Since these feedback are issues by peers part of a peer-to-peer network incorporating pseudonimous peers and potential malicious peers, peers reputation needs to be evaluated by calculating insight from web of trust.
CAIP-261: Web of Trust Primitives introduces a data framework to represent trust assertions among peers.

**Peers**
- **Peer Trust Assertion:** (Defined in the CAIP-261) This constitute web of trust, with trust and distrust assertions among peers;
- **Peer Trust Score:** (Defined in the CAIP-261) This represent the calculated synthetic trust scores of a peer which reflect the overall sentiment of the community.

This proposal incorporates the following basic primitives for Resources assessment as inputs :

**Discrete Resources**
- **Report Assertion:** This represents detailed presentation of factual information and objective analysis. This type of content is often backed by data, research, and objective methodologies. It's designed to inform or provide insights based on evidence and analysis, such as security or compliance report;
- **Review Assertion:** This represents a subjective assessment reflecting personal opinions and experiences. Unlike report, review assertions are based on personal viewpoints, experiences, or interpretations of the reviewer;
- **Reaction Assertion:** This represents a quantifiable expression of agreement or disagreement with a report or a review's content, typically reflecting the collective sentiment of the audience. This is a more interactive form of content, where the audience engages with the content through likes, dislikes, endorsements, or disputes.
- **Resource Trust Score:** This represent the calculated synthetic trust scores of a resource which reflect the overall sentiment of the community.

## Motivation
In the evolving landscape of the decentralized web, the permissionless distribution of discrete resources fosters innovation and participation without gatekeepers but also exposes the ecosystem to vulnerabilities such as misinformation, scams, and security threats.

Currently, in the absence of a robust, decentralized, community-powered trust assessment mechanism, verification is nearly absent or still heavily reliant on centralized solutions.
This reliance on trusted intermediaries inadvertently creates bottlenecks and control points, compromising the decentralized properties of the ecosystem.

Therefore, the motivation behind standardizing data for community-powered assessment extends beyond merely enhancing the reliability of discrete resources.
It aims to establish a universally applicable trust graph, reusable across various use-cases, to further mature and fortify the decentralized nature of the ecosystem.

## Specification

### Resources Trust Representation
#### Identifier Scheme
##### Discrete Resource identification
Discrete resources, by their nature, are static entities and should be identified with an identifier that points to a specific, unchangeable version of the resource.
To ensure the integrity and traceability of these resources, each new version must be assigned a unique identifier, distinct from its predecessors.

A recommended approach for generating these identifiers is to use the resource content's fingerprint, such as its hash. Utilizing a [Content Identifier (CID)] is an effective method for this purpose.
CIDs offer a robust, cryptographic hash of the resource's content, is self-contained and ensure that any alteration of the content would result in a different identifier, thereby preserving the integrity of the resource.

To further enhance accessibility and integration within the decentralized web, the CID should be encapsulated within a Uniform Resource Identifier (URI).
This encapsulation allows for the use of familiar and widely supported schemes, such as the IPFS scheme (ipfs://), or a custom scheme (e.g., example://).
By doing so, it provides a contextual identifier that not only points to the resource in a static, immutable manner but also offers insights into the nature or origin of the resource through the choice of URI scheme.

##### Assertions Identification
cf. CAIP-261

#### Data Model
In order to assess discrete resources, a peer can issue assertions about a discrete resource or about reviews or reports to react on their content.
![diagram1](https://github.com/dayksx/CAIPs/assets/77788154/1948e150-f964-4975-b3ee-ec6fe0a1545e)

All subsequent documents conform to the [Verifiable Credential Data Model](https://www.w3.org/TR/vc-data-model/) for the purpose of representation.
However, this standard does not prescribe any specific document type, though it may recommend internationally recognized standards.

##### Report Assertion
A report presents a detailed presentation of factual information and objective analysis.

```json
"type": ["VerifiableCredential", "ReportCredential"],
"issuanceDate": "2024-02-15T07:05:56.273Z",
"issuer": "did:pkh:eth:0x44dc4E3309B80eF7aBf41C7D0a68F0337a88F044",
"credentialSubject":
{
"id": "snap://CLwZocaUEbDErtQAsybaudZDJq65a8AwlEFgkGUpmAQ=",
"evaluationType": "Security",
"result": -1,
"issues": [
{
"criticality": 1,
"issueType": "Key leak",
"description": "`snap_getBip44Entropy` makes the parent key accessible",
"uri": "ipfs://QmEQtreH3vm6qcASGqAUsq78MQa9Ctb56afRZg1WJ5sKLdq"
},
{
"criticality": 0.5,
"findingType": "Buffer Overflow",
"uri": "ipfs://QmDlreH3vm6qcASGqAUsq78MQa9Ctb56afRZg1WJ5sKCqd"
},
{
"criticality": 0.25,
"issueType": "Phishing",
"uri": "ipfs://QmElreH3vm6qcASGqAUsq78MQa9Ctb56afRZg1WJ5sKLpl"
},
{
"criticality": 0,
"issueType": "Data leak",
"description": "API can communicate data to a centralized server"
},
]
},
"proof": {}
```

Security report with no findings:

```json
"type": ["VerifiableCredential", "ReportCredential"],
"issuanceDate": "2024-02-15T07:05:56.273Z",
"issuer": "did:pkh:eth:0x44dc4E3309B80eF7aBf41C7D0a68F0337a88F044",
"credentialSubject":
{
"id": "snap://CLwZocaUEbDErtQAsybaudZDJq65a8AwlEFgkGUpmAQ=",
"evaluationType": "Security",
"result": 1,
},
"proof": {}
```

- The `result` is the final result of the security assessment; It MUST remain within the following range: [-1,1]. This could be translated as follows: 'Very Negative' (-1), 'Negative' (-0.5), 'Neutral' (0), 'Positive' (0.5), 'Very Positive' (1);
- The `issues` (optional) lists the issues.
- The `criticality` of findings must remain within the following range: [0,1]; This could be interpreted as follows: `None` (0), `Low` (0.25), `Medium` (0.5), `High` (0.75), `Critical` (1).

Any standard inheriting this CAIP COULD propose reference lists of "type" to facilitate interoperability across different systems.

##### Review Assertion
A reaction represents a quantifiable expression of agreement or disagreement with the report's content, typically reflecting the collective sentiment of the community.

```json
"type": ["VerifiableCredential", "ReviewCredential"],
"issuanceDate": "2024-02-15T07:05:56.273Z",
"issuer": "did:pkh:eth:0x44dc4E3309B80eF7aBf41C7D0a68F0337a88F044",
"credentialSubject":
{
"id": "ipfs://QmPTqvH3vm6qcZSGqAUsq78MQa9Ctb56afRZg1WJ5sKLiu",
"rating": 0.6,
"comment": "",
},
"proof": {}
```

##### Reaction Assertion
A reaction represents a quantifiable expression of agreement or disagreement with the report's content, typically reflecting the collective sentiment of the community.

**A reaction on a report**
```json
"type": ["VerifiableCredential", "ReactionCredential"],
"issuanceDate": "2024-02-15T07:05:56.273Z",
"issuer": "did:pkh:eth:0x44dc4E3309B80eF7aBf41C7D0a68F0337a88F044",
"credentialSubject":
{
"id": "ipfs://QmPTqvH3vm6qcZSGqAUsq78MQa9Ctb56afRZg1WJ5sKLiu",
"reaction": "Endorsed",
"reason": ["Provide important context", "Vulnerabilities clearly defined"],
},
"proof": {}
```

**A reaction on a discrete resource**
Reaction can also be used directly on a software component to share a reaction.

```json
"type": ["VerifiableCredential", "ReactionCredential"],
"issuanceDate": "2024-02-15T07:05:56.273Z",
"issuer": "did:pkh:eth:0x44dc4E3309B80eF7aBf41C7D0a68F0337a88F044",
"credentialSubject":
{
"id": "snap://CLwZocaUEbDErtQAsybaudZDJq65a8AwlEFgkGUpmAQ=",
"reaction": "Disputed",
"reason": ["Scam"]
},
"proof": {}
```

- `reaction`: This defines the reaction, the standard define `Disputed` or `Endorsed` as reaction, but this can be extend to any reaction.
- `reason` (optional): This defines the reason for a given review status.

### Resources Trust Management
cf. caip-261.md

### Resources Trust Verification
cf. caip-261.md

### Resources Trust Consumption
Following the verification process, the trust graph can be utilized by any consumer to calculate insight relative to any use-case.

Please note that the method for calculating the trust scores is entirely open, and this standard does not provide specific guidelines for it.

The trust signals (incoming data) are leveraged to calculate the trust scores (outgoing data) for peers and software components.
While the computation steps may vary based on the chosen trust score computation, the following main steps give an idea of some generic processing logic from a given peer point of view:

1. Retrieve the peers (directly and indirectly connected peers that have issued reviews, security reports of the given software component),
2. Calculate the peers' trust scores (relatively to the requesting peer's point of view),
3. Weight the reviews (endorsements and disputes) based on the issuers' peers scores,
4. Weight the security reports based on the weight of the endorsements and disputes as well as the issuers' peers scores;
5. Calculate the software component's trust score based on the weight of the security reports, and if available, the software component's developers peer trust score.

Resource Trust Score:

```json
"type": ["VerifiableCredential", "ResourceTrustScoreCredential"],
"issuanceDate": "2023-11-24T12:24:42Z",
"issuer": "did:pkh:eip155:1:0x23d86aa31d4198a78baa98e49bb2da52cd15c6f0",
"credentialSubject":
{
"id": "snap://CLwZocaUEbDErtQAsybaudZDJq65a8AwlEFgkGUpmAQ=",
"trustScore": {
"confidence": 0.0555555559694767,
"value": 1
},
"trustScoreType": "IssuerTrustWeightedAverage"
},
"proof": {}
```

## Rationale

### Modularity and extensibility

The standard has been designed with modularity and solution-agnosticism, to maximize flexibility and reusability:

- Data elements are independent from each other, allowing for the use of only a subset of it,
- The data framework is agnostic to any trust value computation logic,
- Flexible data ranges leveraging floats type facilitating the creation of tailored user experiences,
- Data structures has been designed to be agnostic, enabling the reusability of the data across different use-cases.

### Identification

[DID][]s and [CID][] are decentralized identification methods that are not reliant on any centralized identity provider, making them more sustainable.

1. [Decentralized identifiers][DID] using the `pkh` and `key` methods allow for the identification of account owners or trust value issuer in a chain-agnostic manner without the complexity of on-chain resolution.
2. [Content Identifiers][CID] enable anyone to deterministically generate identifiers based on the canonicalized content of a given JSON document, and store it in a compact, tamper-evident way conducive to merging, syncing, or even CRDT patterns.

### Data

3. The security of software components is assessed based on findings from security reports,
4. The security reports can be approved or challenged by the community, through endorsement and dispute form community,

## Test Cases


## Privacy Considerations
Issuing assertions makes public the opinion of issuers (identified by their public address), and therefore should be informed about the consequence of their action.

## References
<!--Links to external resources that help understanding the CAIP better. This can e.g. be links to existing implementations. See CONTRIBUTING.md#style-guide . -->

- [CAIP-1][CAIP-1] defines the CAIP document structure

[CAIP-1]: https://ChainAgnostic.org/CAIPs/caip-1
[DID]: https://www.w3.org/TR/did-core/
[CID]: https://github.com/multiformats/cid
[did:pkh]: https://github.com/w3c-ccg/did-pkh/blob/main/did-pkh-method-draft.md
[multihash]: https://github.com/multiformats/multihash
[multicodec-json]: https://github.com/multiformats/multicodec/blob/master/table.csv#L138
[JCS]: <https://www.rfc-editor.org/rfc/rfc8785>

## Copyright

Copyright and related rights waived via [CC0](../LICENSE).
Binary file added CAIPs/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/CAIP-261/diagram1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/CAIP-261/diagram2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/CAIP-261/diagram3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.