validateaddress

The validateaddress is a Litecoin RPC method that enables users to verify if a given Litecoin address is valid. This method provides important information about the address, such as its type and whether it's a spendable or watch-only address. It can be particularly useful in applications where address validation is necessary before performing transactions or when dealing with user-generated addresses to ensure their validity.


Parameters

The validateaddress method accepts one required parameter:

parameter
description
address
The Litecoin address to be validated.
Return Object

The return object contains the following fields:

name
description
isvalid
Indicates if the supplied address is valid.
address
The validated Litecoin address.
scriptPubKey
The hex-encoded scriptPubKey generated by the address.
isscript
Indicates if the address is a script address (P2SH).
iswitness
Indicates if the address is a witness address (P2WPKH or P2WSH).
witness_version
The version number of the witness program, if applicable.
witness_program
The hex value of the witness program, if applicable.
isspendable
Indicates if the address is spendable (has the private key).
iswatchonly
Indicates if the address is watch-only (wallet has the public key but not the private key).
iscompressed
Indicates if the associated public key is compressed.
account
DEPRECATED. The account associated with the address, if any.
Request Example
Request

Share on
Share on FacebookShare on XShare on LinkedIn
Did you find this page useful?