Charlie Sheen wrote a $30,000 check to a porn star in the middle of his 36-hour party binge -- because he felt like it -- and TMZ has the unbelievable proof.

Sources involved in the bender tell us ... Sheen broke out his checkbook during a conversation with a porn star Wednesday in which he asked her to join the "porn family" he wants to create.

We're told Sheen -- in a showing of good faith -- wrote a $30,000 check made out to "cash" and told the porn star to take it to the bank ... and the money was hers.

Obviously, the porn star darted for her car -- and when she got to the bank, the teller called Charlie AND one of Sheen's business associates to verify the transaction. Luckily for the porn star, it cleared.