Skip to main content

eth_decrypt

MetaMaskDeprecated

This method is deprecated and may be removed in the future.

Requests that MetaMask decrypt the specified encrypted message. The message must have been encrypted using the public encryption key of the specified Ethereum address. Returns a promise that resolves to the decrypted message, or rejects if the decryption attempt fails.

Params

(2)

1. EncryptedMessage (required)

The encrypted message to decrypt.

string

2. Address (required)

The address of the Ethereum account that can decrypt the message.

string
Match pattern:
^0x[0-9,a-f,A-F]{40}$

Result

(PermissionsList)
array of:
id
string

The permission ID.

@context
array[string]

When two people communicate with one another, the conversation takes place in a shared environment, typically called 'the context of the conversation.' This shared context allows the individuals to use shortcut terms, such as the first name of a mutual friend, to communicate more quickly without losing accuracy. A context in JSON-LD works the same way: it allows two applications to use shortcut terms to communicate more efficiently without losing accuracy.

invoker
string

A URI of the dapp being granted this permission.

caveats
array[Caveat]

Every capability document MAY add restrictions on the way the capability may be used by adding to the caveat property. Capabilities inherit the restrictions from all caveat properties of their parents, and MAY add new caveats in addition to those of their parents.

type
string

Type of caveat.

value

Value of the caveat.

name
string

Name of the caveat.


Params

EncryptedMessage

Address


Request

await window.ethereum.request({
"method": "eth_decrypt",
"params": [
null,
null
]
});