Contrastive Learning for Efficient Transaction Validation in UTXO-based Blockchains