Aqua ProtocolAqua Protocol
Aqua Protocol
Aqua ProtocolAqua

Documentation

Welcome to Aqua ProtocolQuick StartDevelopment GuideVersion v4 (beta)
Use Cases
Document VerificationIdentity AttestationAqua Protocol Use CasesSupply Chain Tracking
Development Tools
Aqua CLIAqua SDKAquafier API
Schema Reference
Aqua TreeFile IndexAqua Protocol Schema Reference
Revision Types
Link RevisionObject RevisionAqua Protocol RevisionsSignature RevisionTemplate RevisionWitness Revision

Documentation

Welcome to Aqua ProtocolQuick StartDevelopment GuideVersion v4 (beta)
Use Cases
Document VerificationIdentity AttestationAqua Protocol Use CasesSupply Chain Tracking
Development Tools
Aqua CLIAqua SDKAquafier API
Schema Reference
Aqua TreeFile IndexAqua Protocol Schema Reference
Revision Types
Link RevisionObject RevisionAqua Protocol RevisionsSignature RevisionTemplate RevisionWitness Revision
Docs
Schema Reference
Revision
Link Revision

Link Revision

Schema specification for Link Revisions in Aqua Protocol v4

11 min read

Link Revision

A Link Revision creates verifiable connections between separate revision chains. It allows you to establish relationships, dependencies, or references between different objects, effectively creating a graph structure of interconnected chains. Link revisions are essential for composing complex data structures and maintaining provenance across multiple chains.

Overview

Link revisions enable:

  • Chain Composition: Connect multiple independent chains together
  • Dependency Tracking: Express that one chain depends on others
  • Multi-Party Collaboration: Combine contributions from different parties
  • Provenance Graphs: Build complex data relationship structures
  • Verification Aggregation: Group related chains for batch verification

Schema Structure

Fields

FieldTypeRequiredDescription
previous_revisionstringYesHash reference to the previous revision in this chain
revision_typestringYesAlways "link" for link revisions
noncestringYesRandom 16-byte hex string for uniqueness
local_timestampnumberYesUnix timestamp when the link was created
versionstringYesProtocol version: "https://aqua-protocol.org/docs/v4/schema"
methodstringYesCanonicalization method: "scalar" (typical) or "tree"
hash_typestringYesHash algorithm: "FIPS_202-SHA3-256"
link_verification_hashesarrayYesArray of revision hashes being linked to

Field Details

link_verification_hashes

  • Type: Array of hex strings
  • Format: Each element is a lowercase hex string prefixed with 0x
  • Purpose: References to other revision chains
  • Minimum: Can be empty array (though typically contains at least one link)
  • Maximum: No strict limit, but practical limits depend on implementation
  • Order: Order may be significant depending on use case

Example

Basic Link Revision

Linking to two other chains:

Code
json
1{
2 "previous_revision": "0x3f8a7b2c9d1e4f5a6b8c0d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a",
3 "revision_type": "link",
4 "nonce": "0x7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f",
5 "local_timestamp": 1704067200,
6 "version": "https://aqua-protocol.org/docs/v4/schema",
7 "method": "scalar",
8 "hash_type": "FIPS_202-SHA3-256",
9 "link_verification_hashes": [
10 "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
11 "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
12 ]
13}

Single Link

Linking to a single chain:

Code
json
1{
2 "previous_revision": "0x9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f",
3 "revision_type": "link",
4 "nonce": "0x5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a",
5 "local_timestamp": 1704070800,
6 "version": "https://aqua-protocol.org/docs/v4/schema",
7 "method": "scalar",
8 "hash_type": "FIPS_202-SHA3-256",
9 "link_verification_hashes": [
10 "0x8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d"
11 ]
12}

Multiple Links (Aggregation)

Aggregating many chains:

Code
json
1{
2 "previous_revision": "0x1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c",
3 "revision_type": "link",
4 "nonce": "0xa1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
5 "local_timestamp": 1704074400,
6 "version": "https://aqua-protocol.org/docs/v4/schema",
7 "method": "scalar",
8 "hash_type": "FIPS_202-SHA3-256",
9 "link_verification_hashes": [
10 "0x1111111111111111111111111111111111111111111111111111111111111111",
11 "0x2222222222222222222222222222222222222222222222222222222222222222",
12 "0x3333333333333333333333333333333333333333333333333333333333333333",
13 "0x4444444444444444444444444444444444444444444444444444444444444444",
14 "0x5555555555555555555555555555555555555555555555555555555555555555"
15 ]
16}

Validation Rules

A Link Revision is valid if:

  1. Structure: Contains all required fields with correct types
  2. Revision Type: The revision_type is exactly "link"
  3. Previous Revision: References a valid existing revision
  4. Link Array: link_verification_hashes is a valid array
  5. Link Format: Each element in the array is a valid hex string with 0x prefix
  6. Link Targets: Each referenced revision should exist and be verifiable (optional strict validation)
  7. No Duplicates: Typically shouldn't contain duplicate hashes (application-specific)
  8. Hash Verification: The computed hash of the link revision is correct

Common Use Cases

1. Document Dependencies

Link a document to its source materials:

Document dependencies using link revision

2. Multi-Party Signing

Combine independent signatures:

Multi-party signing with link revision

3. Bill of Materials

Link a product to its components:

Bill of materials with component chains

Each component has its own provenance chain.

4. Credential Bundling

Group related credentials:

Credential bundling with link revision

5. Supply Chain Aggregation

Combine supply chain events:

Supply chain aggregation

6. Academic Citation

Link a paper to cited works:

Academic citation with link revision

7. Version History

Link to previous versions:

Version history with link revision

8. Approval Workflow Merge

Merge parallel approval processes:

Approval workflow merge with link revision

Link Patterns

Pattern 1: Linear Dependency Chain

Linear dependency chain

Each object depends on the previous one.

Pattern 2: Star Pattern (Aggregation)

Star pattern - one link references multiple chains

One link revision references multiple chains.

Pattern 3: Tree Pattern

Tree pattern - hierarchical structure using links

Hierarchical structure using links.

Pattern 4: Graph Pattern

Graph pattern - complex graph with cycles and multiple connections

Complex graph with cycles and multiple connections.

Implementation Notes

Creating a Link Revision

  1. Identify the chains to link
  2. Get the head (latest) revision hash from each chain
  3. Collect hashes into link_verification_hashes array
  4. Determine the previous_revision for this link
  5. Generate nonce and timestamp
  6. Create the link revision structure
  7. Compute and verify the hash

Verifying a Link Revision

Basic Verification

1. Verify link revision structure 2. Validate each hash in link_verification_hashes 3. Compute link revision hash

Deep Verification

1. Perform basic verification 2. For each linked hash: a. Retrieve the referenced revision b. Verify the referenced revision chain c. Check signatures and witnesses 3. Validate all linked chains

Link Resolution

When traversing links:

1. Start with link revision 2. Extract link_verification_hashes 3. For each hash: a. Resolve to actual revision b. Load revision chain c. Verify chain integrity 4. Build complete relationship graph

Advanced Topics

Cyclic References

Links can create cycles:

Cyclic references between chains

Handling:

  • Detect cycles during traversal
  • Use visited set to prevent infinite loops
  • Cycles may be valid depending on use case

Temporal Ordering

Links create a temporal relationship:

Link created at timestamp T references chains that existed before T

Validation:

  • Linked revisions should have timestamps < link timestamp
  • Prevents linking to "future" revisions

Partial vs Complete References

Complete Reference: Link to final revision of a chain

Link → [Complete Chain A, Complete Chain B]

Partial Reference: Link to intermediate revision

Link → [Chain A @ Revision 5, Chain B @ Revision 3]

Link Updates

To update links over time:

Link updates tracking changes over time

Each link revision chains to the previous, tracking changes.

Link Metadata

While the standard link revision doesn't include metadata, you can add it by:

  1. Creating an object revision with link metadata
  2. Following it with a link revision
Link metadata using object revision

Relationship with Other Revisions

  • Object Revisions: Can be linked, and can precede link revisions
  • Signature Revisions: Can be linked (e.g., aggregating signatures)
  • Witness Revisions: Can be linked, or can follow link revisions
  • Template Revisions: Typically not linked (they're standalone)

Security Considerations

1. Link Validation

Verify Existence: Ensure linked revisions actually exist before creating link Verify Integrity: Validate linked chains are not corrupted

2. Circular Dependencies

Detection: Implement cycle detection in verification Policy: Decide if cycles are allowed in your application

3. Link Spam

Prevention: Validate that links are meaningful and authorized Rate Limiting: Prevent excessive linking in systems

4. Temporal Consistency

Timestamp Checking: Ensure links don't reference "future" revisions Causality: Maintain causal ordering of events

5. Authorization

Link Permission: Verify the creator has rights to link to target chains Privacy: Linking may reveal relationships between otherwise private chains

Performance Considerations

Link Depth

Deep link hierarchies impact verification time:

Object → Link (10 chains) → Each chain has Link (5 chains) Total: 1 + 10 + 50 = 61 chains to verify

Optimization: Cache verified chains, use lazy loading

Link Width

Wide links (many references) increase storage and bandwidth:

Link → [1000 chains]

Optimization: Paginate links, use link batching

Verification Strategy

Lazy: Only verify linked chains when accessed Eager: Verify all linked chains upfront Selective: Verify critical paths only

Comparison with Other Approaches

vs Direct References

Direct Reference (in object payload):

Code
json
1{
2 "payload": {
3 "dependencies": ["0xabc...", "0xdef..."]
4 }
5}

Link Revision:

Code
json
1{
2 "link_verification_hashes": ["0xabc...", "0xdef..."]
3}

Advantages of Link Revision:

  • Explicit in protocol (not application-specific)
  • Verifiable without parsing payload
  • Consistent structure across applications
  • Can be signed and witnessed separately

vs Witness Batching

Witness Batching: Uses Merkle tree for efficient blockchain anchoring Link Revision: Creates explicit relationships between chains

Key Difference: Witness is about timestamping, Link is about relationships.

Best Practices

1. Use Descriptive Ordering

Order links meaningfully:

["primary_source", "secondary_source", "tertiary_source"]

2. Link to Stable Points

Link to revisions that are finalized (signed/witnessed):

Linking to stable, witnessed revisions

3. Document Link Semantics

Precede link with an object explaining the relationships:

Documenting link semantics with object metadata

4. Consider Verification Cost

Limit link depth and width for practical verification times.

5. Use Links for Cross-Chain Only

Don't use links for intra-chain references (use previous_revision instead).

See Also

  • Object Revision - Often linked
  • Signature Revision - Can aggregate via links
  • Witness Revision - Often follows links
  • Graph Theory - Mathematical foundation for link structures
Edit this pageReport an issue
Previous
Aqua Protocol Schema Reference
Next
Object Revision

Documentation

  • Getting Started
  • API Reference

Community

  • GitHub
  • Discord

Copyright © 2024 Aqua. All rights reserved.

On this page

OverviewSchema StructureFieldsField DetailsExampleBasic Link RevisionSingle LinkMultiple Links (Aggregation)Validation RulesCommon Use Cases1. Document Dependencies2. Multi-Party Signing3. Bill of Materials4. Credential Bundling5. Supply Chain Aggregation6. Academic Citation7. Version History8. Approval Workflow MergeLink PatternsPattern 1: Linear Dependency ChainPattern 2: Star Pattern (Aggregation)Pattern 3: Tree PatternPattern 4: Graph PatternImplementation NotesCreating a Link RevisionVerifying a Link RevisionLink ResolutionAdvanced TopicsCyclic ReferencesTemporal OrderingPartial vs Complete ReferencesLink UpdatesLink MetadataRelationship with Other RevisionsSecurity Considerations1. Link Validation2. Circular Dependencies3. Link Spam4. Temporal Consistency5. AuthorizationPerformance ConsiderationsLink DepthLink WidthVerification StrategyComparison with Other Approachesvs Direct Referencesvs Witness BatchingBest Practices1. Use Descriptive Ordering2. Link to Stable Points3. Document Link Semantics4. Consider Verification Cost5. Use Links for Cross-Chain OnlySee Also