Skip to content

Document Revocation Endpoint #180

@mftee

Description

@mftee

Description:

Implement a POST /revoke endpoint that records a document revocation event on the Stellar blockchain. Revocation marks a previously anchored document as no longer valid (e.g., due to fraud or supersession).

Requirements:

  • Add a RevokeRequest struct:
    pub struct RevokeRequest {
        pub document_hash: String,
        pub reason: String,
        pub revoked_by: String,
    }
  • The Stellar transaction memo must encode the action as a structured string: REVOKE:<hash> (truncated to 28 bytes)
  • Before submitting the revocation, verify that the hash exists on-chain by calling verify_hash. If not found, return 404 with an appropriate message
  • Return a RevokeResponse with transaction_id and revoked_at
  • Invalidate any cached verification results for this hash after revocation

Acceptance Criteria:

  • Attempting to revoke an unanchored hash returns 404
  • Revocation transaction is submitted with the correct memo format
  • Cache entry for the revoked hash is cleared after successful revocation
  • Unit tests for memo construction and the pre-revocation existence check

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions