Skip to content

Ownership Transfer Recording Endpoint #181

@mftee

Description

@mftee

Description:

Implement a POST /transfer endpoint that anchors an ownership transfer event for a land document on the Stellar blockchain. This creates an auditable, on-chain record of a change in land ownership.

Requirements:

  • Add a TransferRequest struct:
    pub struct TransferRequest {
        pub document_hash: String,
        pub from_owner: String,
        pub to_owner: String,
        pub transfer_date: String, // ISO 8601 date string
        pub transfer_reference: String, // legal reference number
    }
  • Compute a transfer event hash: SHA-256(document_hash + from_owner + to_owner + transfer_date)
  • Anchor this transfer hash to Stellar with memo prefix TRANSFER:<transfer_hash> (truncated)
  • Store the full transfer record in a new Redis key transfer:<document_hash> as a JSON array (append each transfer to the array)
  • Add a GET /transfer/:document_hash endpoint to retrieve the transfer history from Redis

Acceptance Criteria:

  • Transfer hash is deterministic for the same inputs
  • Multiple transfers for the same document are all stored and retrievable
  • Unit tests for the transfer hash computation
  • Returns 400 if transfer_date is not a valid ISO 8601 date

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