Skip to content

VerifyTransfer in fabtoken is a local debug verification function, not the on-chain validator #1768

Description

@NETIZEN-11

The VerifyTransfer function located at token/core/fabtoken/v1/transfer.go:184-188 was initially flagged as a critical
security issue because it returned nil without performing any verification. However, upon clarification from the
maintainer, this understanding was incorrect.

Key Points:

  1. VerifyTransfer is NOT the validator: This function is NOT executed by the token validator during transaction
    processing. It is a local verification function that parties can optionally use to verify if a transfer action is
    valid locally - primarily for debugging purposes.
  2. Actual validation happens elsewhere: The real on-chain validation is performed by these properly implemented
    validator functions in token/core/fabtoken/v1/validator/:
    - TransferActionValidate - Validates the transfer action structure
    - TransferSignatureValidate - Validates signatures for inputs spent by an action
    - TransferBalanceValidate - Checks that sum of inputs equals sum of outputs
    - TransferHTLCValidate - Validates HTLC scripts if present
  3. Implementation status: The VerifyTransfer function has now been implemented , but this is a
    "nice to have" feature for local verification - not a security-critical gap since the actual validation is handled by
    the separate validator functions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions