Sign Ethereum message
POST {{baseUrl}}/protocols/eth/sign
Sign an arbitrary message using the wallet's private key (Ethereum personal sign
). This endpoint is explicitly designed in a way that prevents impersonating valid Ethereum transactions.
Define the singing wallet address via defining a from
property in the body and assigning it to a string containing the address of the sending wallet. To define the sending wallet's name instead, assign the from
property to an object containing the wallet
property with the desired wallet's name.
If both wallet
and address
properties are provided, the API validates if the address
resolves to the signing wallet
.
The message payload
must not exceed the size of 10 kilobytes.
Use payload type plain
to sign standard personal_sign messages.
The plain text payload given as body property is brought into the following format: "\x19Ethereum Signed Message:\n" + message.length + message
.
It is then hashed using keccak256 and signed.
Use the raw
type to sign EIP-191 signatures. Only version 0x00 and 0x45 are allowed. Structured data (0x01) is currently not allowed.
0x19 <1 byte version>
For example:
0x19 0x00
The provided payload will be hashed with keccak256 and signed.
Request Body
{"from"=>"0x9C2E011c0CE0d75c2B62B9C5A0Ba0a7456593803", "type"=>"plain", "payload"=>"Send EUR 50 to DE89370400440532013100 at Sat, 13 Feb 2021 15:48 +00:00"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
tangany-version | number | (Required) Default header that directs the request towards desired Tangany Custody Api version (e.g 2 directs to Tangany Custody APi v2). |
Supports only major versions. |
| Content-Type
| string | | |
| Accept
| string | | |
RESPONSES
status: OK
{"address":"0x9C2E011c0CE0d75c2B62B9C5A0Ba0a7456593803","type":"plain","payload":"Send EUR 50 to DE89370400440532013100 at Sat, 13 Feb 2021 15:48 +00:00","payloadHash":"0x2d40ce64db3ad04d32f26d2713e678051320129a576ad56e39362782e13b79e2","signature":"0x0895b45dba5d64df611e762578714d915c4c69916bef2341713f374e7d0e5a3a38400289e49e19263ec9e143921335d6791fe06167fb336aca71fa89f423fbdb"}