A plan to give amnesty to potentially millions of illegal aliens who have been shielded from deportation by the Deferred Action for Childhood Arrivals (DACA) program would be triggered by secured funding for a wall along the United States-Mexico border, Breitbart News has learned.

The legislation, crafted by House Speaker Paul Ryan (R-WI) and Rep. Bob Goodlatte (R-VA), obtained by Breitbart News gives at least 1.8 million DACA illegal aliens amnesty on the contingency that $25 billion is appropriated for President Trump’s border wall.

The Ryan/Goodlatte bill mandates that $25 billion be appropriated for a border wall to stop illegal immigration at the southern border. That funding “must not have been rescinded or transferred to another account” in order for the DACA amnesty to begin, a summary of the legislation provided to Breitbart News reads.

The amnesty for DACA illegal aliens would begin after five years, allowing for the eligible 1.8 million population to obtain Green Cards through a newly created “Merit-Based” immigration category.

This amnesty, though, would be halted if the $25 billion in border wall funding is not available for use at the border. A summary of the legislation notes:

Visa Availability – beginning in the sixth year of the program, the first green cards would be awarded under the new program only if the advanced appropriated funds for border security for that fiscal year have been made available for obligation, have not been transferred or reprogrammed for other non-border security purposes, and have not been rescinded. [Emphasis added]

In addition to fully funding a border wall, the Ryan/Goodlatte legislation closes the various immigration legal loopholes that perpetuate programs like “Catch and Release,” where illegal aliens are released into the U.S. while they await court proceedings.

The legislation would also allow the victims of illegal alien crimes to sue sanctuary cities for protecting criminal illegal aliens, though it does not cut funding to sanctuary cities altogether.

Sources close to Breitbart News have said that the immigration compromise deal — if passed out of the House next week — is likely to be watered down in the Senate, where the amnesty population is expected to be expanded and the enforcement measures of the legislation are expected to be gutted.