Skip to content

Validate Proof Of Ownership

Overview

validateProofOfOwnership API validates a signed proof-of-ownership challenge. This method verifies that the provided signature was created by the owner of the specified wallet address by checking it against the original challenge message.

Params

The ValidateProofOfOwnershipParams containing the wallet address, original challenge message, and signature to validate.

  • walletAddress: the wallet address that is expected to own the signature.
  • message: the original challenge message that was signed.
  • signatureToValidate: the signature generated by signing the challenge message. This will be validated against the provided wallet address.

Result

The ValidatedProofOfOwnershipResult indicates whether the signature is valid and optionally includes the generated proof-of-ownership.

  • is valid: indicates whether the signature is valid for the given wallet address and challenge message.
  • proof: the generated proof-of-ownership object, if validation succeeds. This value is nil when isValid is false.

Code

iOS

let params = ValidateProofOfOwnershipParams.make(
    walletAddress: ...,
    message: ...,
    signatureToValidate: ...
)

addressBookService
    .validateProofOfOwnership(params: params)
    .asPublisher()
    .sink { result in
        // ...
    }

Android

val params = ValidateProofOfOwnershipParams(
    walletAddress = "...",
    message = ProofOfOwnershipMessage("..."),
    signatureToValidate = "..."
)

conio.addressBookService
    .validateProofOfOwnership(params)
    .asFlow()
    .collect { result -> 
        //...
    }