On Wednesday morning, President Donald Trump tweeted something genuinely funny:

Trump is angry at Michael Cohen, of course, because Cohen just pleaded guilty to (among other things) making an illegal contribution to Trump’s 2016 presidential campaign by paying hush money to Stormy Daniels just before the election. Moreover, Cohen told the judge in the case that he did so “in coordination with and at the direction of” Trump.

Cohen’s actions were illegal because individuals may only contribute a limited amount of money or in-kind services to political campaigns. During the 2016 election, the maximum was $5,400. Cohen fraudulently obtained a home equity loan and then wired $130,000 of it to the lawyer representing Daniels on October 27, 2016.

What Trump certainly doesn’t understand, and what makes his tweet extra-wonderful, is that the problem with Cohen isn’t just that he (in Trump’s mind) betrayed Trump. It’s that Cohen is genuinely a terrible lawyer. 

J.P. Morgan famously said, “I don’t know as I want a lawyer to tell me what I cannot do. I hire him to tell me how to do what I want to do.” But what Cohen managed to do was fail in both ways. He didn’t tell Trump that Trump couldn’t pay off Daniels using Cohen himself as a conduit — but he also failed to advise Trump that there was a way to do it that would have been totally legal.

Here’s how.

Donald Trump (and only Donald Trump) could legally donate an unlimited amount of money to his campaign, because he was the candidate. Therefore, he would have been in the clear if he had made an in-kind donation to his campaign by paying Daniels directly with his own money. He could also have used money raised by his campaign, including his own contributions, to pay Daniels. (Trump’s campaign took in a total of $333 million, with $66 million of that coming from Trump himself.)

In either case, Trump’s campaign would be required to eventually disclose the expenditure. And under federal law, the campaign would also have had to disclose the contribution within 48 hours of receiving it, assuming Trump’s hypothetical contribution to the campaign were made within 20 days of the election. (If Trump had just paid off Daniels with money already contributed to the campaign, by himself or others, such an immediate disclosure would not have been necessary, but the expenditure might have been reported on the campaign’s so-called “pre-primary” report.) But even then, the disclosures might not by themselves necessarily expose the wrongdoing.

People who don’t obsessively follow the permutations of campaign finance law may think that the Supreme Court’s notorious 2010 Citizens United decision made it legal for a billionaire to spend unlimited amounts of their money to get elected to political office. But in fact the ability of the superrich to self-fund their own campaigns goes back much further, to the Supreme Court’s 1976 ruling in a case called Buckley v. Valeo. 

The Federal Election Campaign Act, passed in 1971 and then amended significantly in 1974 after Watergate, forbade anyone running for president from spending more than $50,000 (about $300,000 today) of their own money on their campaign.

But the Supreme Court struck down this limit in Buckley. In fact, the decision sounded like Trump at the beginning of his campaign, claiming that the superrich spending their own money could actually prevent corruption, because “the use of personal funds reduces the candidate’s dependence on outside contributions and thereby counteracts the coercive pressures and attendant risks of abuse.”

Appropriately enough, one of the key forces behind Buckley v. Valeo was a youthful lawyer named John Bolton. In Bolton’s memoir “Surrender Is Not an Option,” he describes how he spent two years working on the case. According to Bolton, he convinced the huge corporate law firm Covington and Burling to take it on pro bono, and he personally filed the case on the first business day after the law took effect. “Everyone knew,” Bolton writes, that the Supreme Court’s decision would determine “the future shape of American politics.” Presumably Bolton thinks about how prescient he was as he sits at the national security adviser’s desk near the Oval Office.

If Trump had gotten good legal advice from Cohen and taken the route made possible by Buckley, the only remaining issue would be how to disclose the payoff on his FEC disclosure form. Brendan Fischer of the Campaign Legal Center, a Washington nonprofit which advocates for campaign finance reform, suggests the campaign could have called it “‘purchase of legal rights’ … or maybe they even could have gotten away with calling it ‘legal expenses.’” Of course, says Fischer, “a $130,000 payment to a porn star for legal expenses is going to raise quite a few questions.” But Daniels herself could have set up a separate vehicle to receive the funds to attempt to further obscure the purpose.

Was Trump just too cheap to pony up his own cash at the end of the campaign? When it comes to legal advice, Trump got what he paid for — and is now a potential unindicted co-conspirator in a felonious conspiracy. 

Correction: August 23, 2018
This article originally stated that federal law would not have required that hypothetical cash or in-kind contributions by Trump to his campaign to pay off Stormy Daniels be disclosed until December 8, 2016 if the contributions were made close to the election. In fact, contributions over $1,000 to campaigns within 20 days of an election must be disclosed within 48 hours.