Ted Cruz has the perfect solution on how to pay for Donald Trump's border wall ... pass a law to use El Chapo's billions and loot from other lords to underwrite construction.

The Texas senator introduced a new bill Tuesday called the Ensuring Lawful Collection of Hidden Assets to Provide Order Act -- aka the EL CHAPO Act ... which does just that.

The bill would allow the U.S. to use all cash forfeited by drug lords to pay for the wall and border security.

According to Ted ... the U.S. is already gunning for more than $14 billion in drug money and other profits that the Mexican drug lords collected, and Cruz says that will go a long way toward the estimated $20 plus billion in construction costs.