Quick Access
Coin Methods
Monero
Miscellaneous
Methods
Monero
moneroKeyImageSync

Monero Key Image Sync

Export Monero key images for transaction outputs (UTXOs) to enable spent output tracking. The device returns encrypted key images that must be decrypted by your wallet software using the provided encryption key. The key images are encrypted using ChaCha20-Poly1305 for security.

const result = await TrezorConnect.moneroKeyImageSync(params);

Params

Including CommonParams

MoneroKeyImageSync

path

String | Array<Number>

Required

minimum length is 3. All components must be hardened (e.g., m/44'/128'/0'). read more

networkType

Enum: MAINNET (0) | TESTNET (1) | STAGENET (2) | FAKECHAIN (3)

Optional

Monero network type: 0 = MAINNET (default), 1 = TESTNET, 2 = STAGENET, 3 = FAKECHAIN

tdis

Array<MoneroTransferDetails>

Required

Transfer details (UTXOs) to export key images for

out_key

String

Required

Output public key (64 hex chars = 32 bytes)

tx_pub_key

String

Required

Transaction public key (64 hex chars = 32 bytes)

additional_tx_pub_keys

Array<String> | String

Optional

Additional transaction public keys for multi-output transactions (each 64 hex chars). Can be array or comma-separated string

internal_output_index

Number

Required

Output index within the transaction (used in hash computation)

sub_addr_major

Number

Optional

Major subaddress index (default: 0)

sub_addr_minor

Number

Optional

Minor subaddress index (default: 0)

Important Notes:

  • All keys must be exactly 64 hexadecimal characters (32 bytes)
  • The internal_output_index is included in the cryptographic hash commitment
  • additional_tx_pub_keys should only be provided for multi-output transactions (typically empty for 2-output transactions)

Example

Export key images for UTXOs from a Monero testnet transaction:

TrezorConnect.moneroKeyImageSync({
    path: "m/44'/128'/0'", // All components must be hardened
    networkType: 1, // 0=MAINNET, 1=TESTNET, 2=STAGENET
    tdis: [
        {
            out_key: '0a09ab658fca97610a38b8a5c206a0709db435341c31a9d40150df7e52440ac6',
            tx_pub_key: 'da13cd8f4cc2c4f769d88b734d71cfdc0e43d01a20eb7bff6553fd67cb2ed37e',
            additional_tx_pub_keys: [],
            internal_output_index: 1,
            sub_addr_major: 0,
            sub_addr_minor: 0,
        },
    ],
});

Example with Multiple Outputs

TrezorConnect.moneroKeyImageSync({
    path: "m/44'/128'/0'",
    tdis: [
        {
            out_key: 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890',
            tx_pub_key: 'fedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321',
            internal_output_index: 0,
            sub_addr_major: 0,
            sub_addr_minor: 0,
        },
        {
            out_key: '1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
            tx_pub_key: '0987654321fedcba0987654321fedcba0987654321fedcba0987654321fedcba',
            additional_tx_pub_keys: [
                'aabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccdd',
            ],
            internal_output_index: 1,
            sub_addr_major: 0,
            sub_addr_minor: 1,
        },
    ],
});

Result

MoneroKeyImageSyncResult type

The result contains encrypted key images. Each key image is encrypted using ChaCha20-Poly1305 AEAD.

{
    success: true,
    payload: {
        key_images: [
            {
                iv: string,         // 12-byte initialization vector/nonce
                key_image: string,  // Encrypted blob
            },
            // ... more key images
        ],
        signature: string,  // 32-byte encryption key
    }
}

Decryption

To use the key images, decrypt each one with ChaCha20-Poly1305 using the same encryption key:

// The signature field contains the encryption key
const encryptionKey = result.payload.signature;
 
// Decrypt each key image
result.payload.key_images.forEach(ki => {
    const decrypted = chacha20poly1305_decrypt(ki.key_image, encryptionKey, ki.iv);
});