Skip to content

Add Optional Strict Monotonic Timestamp and Anti-Backdate Checks #313

@Oluwaseyi89

Description

@Oluwaseyi89

Summary

Update the registry_contract to optionally enforce that new document/project entries have strictly increasing (monotonic) timestamps and cannot be backdated, ensuring historical integrity and preventing manipulation of project/document history.

Social Media Link

Let's collaborate on Discord. And ensure to star our repo.

Technical Context

  • Motivation: Allowing backdated or non-monotonic timestamps can undermine the trustworthiness of the registry, enabling actors to rewrite history or create ambiguous document orderings. Enforcing monotonicity and anti-backdating protects the integrity of the registry timeline.
  • Current State: The contract does not enforce any ordering or anti-backdating checks on timestamps for new entries.

Requirements

Contract Changes

  • Add an optional (configurable) flag to enable strict monotonic timestamp enforcement.
  • When enabled, require that each new document/project entry has a timestamp strictly greater than the previous entry for the same project.
  • Reject any entry with a timestamp less than or equal to the last recorded timestamp (anti-backdate).
  • Return clear error messages for violations.

Acceptance Criteria

  • When enabled, contract enforces strict monotonicity and anti-backdating for timestamps.
  • Violations are rejected with clear errors.
  • Unit tests cover:
    • Successful addition of monotonic entries
    • Rejection of backdated or duplicate-timestamp entries
    • Toggle of the enforcement flag

Definition of Done

  • PR with contract code changes and tests
  • Documentation updated to describe the enforcement option
  • Team review completed

Working Directory:

stellar-core/verifiable-registry/contracts/registry_contract


Metadata

Metadata

Assignees

Labels

RustThis issue is to be implemented with Rust programming language.SorobanThis issue is to be implemented with Soroban SDKStellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions