Skip to content

[CT-03] Implement POST /transfer in Rust verifier — record ownership transfer on Stellar #856

Description

@mftee

Overview

POST /transfer in the Rust verifier is a stub (returns 200 with empty body or a placeholder). Ownership transfer is a key workflow for land documents — when a parcel changes hands, the new ownership must be recorded permanently on the Stellar blockchain.

Background

File: contract/src/lib.rstransfer_handler() (currently a stub)

Transfer approach on Stellar:
Write a new ManageData entry recording the transfer event:

  • Key: "transfer_" + &hash[..54] (max 64 bytes)
  • Value: { fromPublicKey, toPublicKey, transferredAt } serialized to bytes

This creates an immutable, ordered record of all transfers. Each call adds a new entry (with a monotonic counter suffix if multiple transfers occur).

Request body:

{
  "hash": "sha256hash...",
  "fromPublicKey": "GXXX...",
  "toPublicKey": "GYYY...",
  "reason": "sale"
}

Response: { txHash, ledger, transferredAt }

Acceptance Criteria

  • POST /transfer writes a transfer ManageData entry on Stellar
  • Transfer key format: "transfer_" + hash[:54]
  • Returns { txHash, ledger, transferredAt } on success
  • Redis cache for the document hash is updated to include the latest owner's public key
  • GET /verify/:hash/history returns all transfer records for this document in chronological order
  • Returns 404 if the hash has no prior anchor record (cannot transfer what was never anchored)

Metadata

Metadata

Assignees

No one assigned

    Labels

    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