You try your best to find a buyer who is willing to pay gold first before you hand them the code. (NX Codes are more demanded than Gift NX) If not try to find a buyer that has reference and vouches from people he made transactions in the past and ask if he is legit.
Just like references when you apply for a job and the employer contacts the references to verify what you're like. In that case your the employer.