The Church of Scotland has questioned whether it could continue to offer marriages if same-sex legislation led to expensive court challenges.
MSPs were told there were "deep concerns" in the Kirk about the Marriage and Civil Partnership (Scotland) Bill.
The bill has been designed to protect the rights of religious groups not to carry out same-sex ceremonies.
But the Kirk fears this protection could be challenged in court.
Appearing before Holyrood's Equal Opportunities Committee, which is scrutinising the bill, Rev Alan Hamilton said the legislation could be an "invitation" to take religious bodies to court.
Mr Hamilton, the convener of the Kirk's legal questions committee, added: "We are voluntary bodies. We rely upon the donations of our members, and the thought of years of exhausting legal challenge, which is also incredibly expensive, is really very concerning.
"That is why the General Assembly of 2013 in May of this year instructed my committee, together with other councils and committees of the Church of Scotland, to consider whether in fact - and I'm saying this colloquially, this is not the terms of the deliverance of the General Assembly - whether it's worth the Church of Scotland continuing to offer marriages in Scotland.
"It gives us considerable problems internally; we're deeply concerned about the threat externally."
Mr Hamilton raised concerns that individuals or groups could end up taking religious bodies to court if they decided not to offer same-sex services.
They may be "disappointed" that a denomination or celebrant is not prepared to conduct the ceremony, he suggested.
The Kirk later said it had "no plans" to stop conducting marriages.
But it confirmed it was examining whether all marriages should be civil, with couples having the option of a church blessing afterwards.
'Optional extra'
A statement released by the Kirk said: "A decision made at the May 2013 General Assembly, which has the authority to make laws determining how the Church of Scotland operates, agreed to look over a period of two years at the case for the practice common on the continent of all marriages being civil but couples having the option of a church blessing afterwards.
"Supporters argue it could encourage couples to make a more conscious decision to go to church rather than treating church as just a particularly nice place to marry.
"Members of the Church also wanted to explore the case for church services being an optional extra after a civil ceremony, given the potential for ministers to be subject of legal action following the proposed legislation on same sex marriages."
The official terms of the instruction to the Kirk's legal questions committee were outlined in a "remits booklet" report by the General Assembly.
It called for the committee to "explore the possibility of ministers and deacons ceasing to act as civil registrars for the purpose of solemnizing marriages and report to the General Assembly of 2015".
'Destroying marriage'
The Church of Scotland called for freedom of religious belief and practice to be respected when the Scottish government published its proposals in June.
The government said at the time that religious bodies that wish to perform same-sex marriages would have to opt in.
It also said protection would be in place for individual celebrants who considered such ceremonies to be contrary to their faith.
Mr Hamilton appeared before the Holyrood committee alongside representatives of the Scottish Council of Jewish Communities, the Free Church of Scotland, the Scottish Episcopal Church and lobby group Scotland for Marriage, which all have concerns about the bill.
But the proposals have cross-party support in the Scottish Parliament, and have been backed by several smaller religious groups.
Speaking after the session, Rev David Robertson, a Free Church minister in Dundee and director of the Solas Centre for Public Christianity, said: "What the Scottish government is doing with this bill is effectively turning all marriages into civil partnerships, and therefore destroying marriage.
"We do not accept that any government has the right to redefine marriage any more than it has the right to redefine a circle as a square.
"We also believe that the Scottish government is rushing into this without a proper understanding of the consequences of this fundamental change in society."
The committee also heard from organisations who expressed the view that the protections offered to religious bodies in the bill were adequate.
'Guarantees there'
Rev David Coleman, from the Scottish United Reformed Church, said: "From one point of view they may even seem excessive but maybe it is sufficient to guarantee they are there, and no one is forced to engage in something that they are spiritually disinclined to do.
"We are in support of things because we believe the guarantees are there."
Humanist celebrant Ross Wright, of Humanist Society Scotland, told the committee the provisions in the bill were "an accommodation we are prepared to make".
"It is giving freedom to discriminate, which we are not happy with. But for the sake of getting this bill passed, we will concede it," he added.
"People who are not registrars are given the right, not the duty, to conduct marriages. Because of that, it is a mystery to me why we even need the opt-in and opt-out clauses. But they are an additional part."