Round-trip an Elements confidential address through its public components

A QR encoder or address book migration can preserve the spending script but lose the recipient's blinding public key. Reconstruct a known confidential destination to check the whole representation.

Extract the unconfidential address and public key

Set CONFIDENTIAL to a test address on the active Elements network. Request both components from the same address and reconstruct the confidential encoding. Only the public blinding key is needed.

plain=$(elements-cli getaddressinfo "$CONFIDENTIAL" | jq -r .unconfidential)
pub=$(elements-cli getaddressinfo "$CONFIDENTIAL" | jq -r .confidential_key)
elements-cli createblindedaddress "$plain" "$pub"

Check both parts before accepting a migration

Compare the reconstructed destination with the approved original and retain the script and blinding-key association. Two encodings can target the same spending script while supplying different blinding keys. An address-level round trip tests formatting and pairing; it does not prove that the recipient still controls either private key.

elementsproject.org getaddressinfo · elementsproject.org createblindedaddress