Secretary of State William F. Galvin and several state lawmakers, alarmed by the flood of secret money that poured into the Boston mayor's race, are preparing legislation that would require outside groups to disclose their donors in real time.
Outside political committees pumped nearly $4 million into the Boston election, most of it to help elect Martin J. Walsh.
But current law does not require those groups to reveal their donors until January. That means voters had no way of knowing, before they cast their ballots, who funded many of the ads that saturated the airwaves during the race.
Galvin, who is the state's top elections official, said he is working with the state Office of Campaign and Political Finance in hopes of passing the law before the governor's race next year, when outside committees are expected to spend even more money to influence the outcome.
"The pace is clearly accelerating with independent expenditures, so knowing what the sources of these funds are is really important to the voter," Galvin said Monday. "Whether they're left, right, or center, it doesn't matter. The public ought to know where the money is coming from."
A version of the legislation passed the state Senate last year, but died in the House, because time ran out and not because of outright opposition, according to Senator James B. Eldridge, an Acton Democrat who sponsored the bill along with Representative Cory Atkins, a Concord Democrat.
But the involvement of Galvin and the Office of Campaign and Political Finance gives the bill some new heft. And, supporters say, the heavy spending by outside groups in the mayor's race showed how secret money can affect local races, not just presidential and congressional elections.
"To see it brought down to the local level woke a lot of people up, including a lot of legislators who were involved in the mayor's race," Eldridge said. "Suddenly, people realize the size of the money that could be spent on a municipal race, and that could go all the way down to the municipal race in their town."
The bill is a response to the array of outside groups that have proliferated since 2010, when the Supreme Court opened the door to unlimited spending by unions and corporations on political races.
In the Boston mayoral race, those groups spent about $2.5 million on behalf of Walsh, a state representative and longtime labor leader. Many of the groups were affiliated with labor unions. Walsh's opponent, Councilor at Large John R. Connolly, was the beneficiary of about $1.3 million in spending by outside committees, many of which were linked with education groups.
Some had innocuous-sounding names that did not hint at their affiliations. A group called One Boston, for example, was formed just days before the election and dropped $480,000 on television ads backing Walsh.
"Everybody was wondering, who are these people? Where are they from?" said Pamela H. Wilmot, executive director of Common Cause Massachusetts, a government watchdog group. "They're totally behind the veil in terms of knowing what they're about. It's just unacceptable."
Michael Sullivan, director of the state Office of Campaign and Political Finance, had asked the groups to voluntarily disclose their donors before voters went to the polls on Nov. 5. But most declined to do so since it was not required by law.
Under the version of the bill that passed the Senate last year, independent groups would be required to disclose how much they spent and who their donors are within seven days of spending more than $250 on a political campaign. Galvin and Sullivan are working to toughen that bill.
In addition, the legislation would require independent groups to list their top five donors on their television ads.
Kathryn Norton, a Walsh spokesman, declined to comment on the legislation, saying she has not had a chance to review the details. But she said the mayor-elect supports the overall goal, of forcing outside groups to reveal their backers.
"During the course of the election, we said they should absolutely disclose," she said.
But David N. Bossie, who is president of Citizens United, the group that was plaintiff in the 2010 Supreme Court case, said forcing the disclosure of donors flies in the face of the country's founding principles.
"Since the founding of our republic, individuals have wanted to be anonymous, whether it's in political writing or political donations, and that has been a right of Americans for over 200 years," he said. "That's not something I think we should be giving up because some liberal groups in a liberal state want to even further erode the First Amendment."
Bradley A. Smith, a Republican and former member of the Federal Election Commission, said forcing disclosure could also burden small independent committees that rely on volunteers to manage their finances. And more broadly, he said, he was skeptical that requiring outside groups to disclose their donors would matter much to voters.
"You don't find many voters who will come in and change their votes based on who has given someone money or even bother to look that up," Smith said. "I sometimes fear we put too much emphasis on disclosure and think it can do things it cannot do, and then we overlook the potential problems and costs it could create."
Michael Levenson can be reached at email@example.com. Follow him on Twitter @mlevenson.