The never-ending negotiations between the 50 state attorneys general (minus a few big ones) and five major banks over penalties and standards for past, present and future mortgage servicing are finally ending, and some details are beginning to emerge from sources familiar with the deal. The big number is the $25 billion that the banks will commit to three categories of the settlement: $5 billion in cash payments, mostly to the states, $3 billion in refinancing for underwater mortgages, and $17 billion in principal reduction. Here’s the breakdown:

Of the $5 billion, $1.5 billion will go to people who have been foreclosed on and were abused in some way during the process. The claims are nearly instantaneous–“we don’t read anything, it’s check the box,” says one state AG negotiator. But the payments are also small: $1,500 to $2,000. Now, the vast majority of people who lost their homes over the last several years probably would not have been able to make their payments even if the banks had been behaving well. For them a no-questions-asked $2,000 check from the bank for the poor treatment they received in the process may be fair. On the other hand, those who were unfairly evicted may be insulted by the small amount. But no one taking the payment would be giving up any rights to bring cases against the banks for wrongful eviction or other claims they may have. The federal regulator with oversight of the issue, the Office of the Comptroller of the Currency, has sent out 4.5 million forms to potentially wrongfully evicted families; processing those claims will be paid for by the banks.

Around $2.75 billion of the $5 billion in cash the banks are coughing up will go to state programs for foreclosure mitigation efforts like legal aid hotlines, mediation between homeowners and banks and counseling. Some $750 million to the federal government for its foreclosure mitigation programs.

The $3 billion for refinancing underwater loans targets a limited population: only those who are current on their payments and who have been current for several months. The Obama administration has launched its own less-than-ambitious program in this regard. Mortgage refis tend to help those who need it least–particularly if they’re limited to people who are current on their payments. Refis also only reduce interest payments, not the actual value of the underlying loan.

The bulk of the money—$17 billion—would go to principal reduction for homeowners and a menu of other elements aimed at reducing the impact of the country’s massive housing debt. The $17 billion also is a credit rather than a cash payment by the banks, but it will give some individuals a chance to lower their mortgages. The $17 billion is a minimum number the banks need to hit in principal and secondary lien reduction and other kinds of forbearance. For every dollar of principal reduction, the banks pay off $1 of the $17 billion commitment. Other bank actions would count less to the overall $17 billion, potentially raising the overall amount the banks lose in book value as high as $32 billion or more.

In return for the $5 billion in cash and the $20 billion in credits, the banks would be released from claims against them for servicing and foreclosure abuses that might be brought against them by the states and the federal government. The states also release the banks from origination claims, that is, claims they might face for all the fraud and duplicity they engaged in when they made bad loans at the height of the housing craze. The banks do not get immunity or a release of for individual claims by homeowners–just a release from past practices State- and Federal-initiated claims. They also don’t get released for securitization abuses of the kind Citibank and Goldman Sachs have been investigated for.

The Iowa AG’s office, which led the negotiations, is bracing for criticism of the deal. The limited payments are likely to be criticized, as is the release for origination abuses. The state negotiators say all the originators are already out of business and that in most cases the claims would be too old to prosecute. Arguments over what the banks would and wouldn’t get off the hook for are what led several liberal State AGs to bolt from the deal. The $25 billion version of the price tag drops to $19 billion if California stays out of the deal, which looks likely. Other states that have dropped out have been in talks with Housing and Urban Development chief Shaun Donovan about coming back into the fold: in particular, Donovan has been in talks with New York State Attorney General Eric Schneiderman in recent weeks in the hope of getting him back into the deal, but that also seems unlikely.

It will be January at the earliest before the deal is finally unveiled.