MCPTools Reference
identity.sign
Sign data with the identity's Ed25519 private key
Scope: identity:sign
Sign arbitrary data with this identity's Ed25519 private key. Returns the signature and the identity's DID for verification.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Base64-encoded data to sign |
Example
Agent: "Sign this message to prove my identity"
-> identity.sign({ data: "SGVsbG8gV29ybGQ=" })Returns
{
"signature": "base64-encoded-ed25519-signature",
"did": "did:web:api.mailgent.dev:identities:id-abc123",
"keyId": "did:web:api.mailgent.dev:identities:id-abc123#key-1"
}The signature can be verified by any party that resolves the DID Document at the returned did URL and checks the Ed25519 signature against the public key.
How it works
- The identity's Ed25519 private key is stored encrypted in the vault
- On signing, the key is decrypted, used to sign the data, and never exposed
- The recipient resolves the DID Document to get the public key and verifies the signature