What is required is something you will need to discuss with your local building inspectors. You can call them in the city/county where you live and they'd be glad to answer you.
I think national building codes would have a sane person believe that it shoud vent to the outside. But, many local building authorities (according to what I've read) seem to take a liberal view of that.
I wouldn't have it take the warm, moist air from a bathroom and merely move it to the attic. That insulation you have has got to collect the warm, moist air in my opinion.
But, I doubt you need to open the roof so you should be able to do it yourself.
It will be like putting a vent onto your clothes dryer. If you don't mind getting into the attic, measure the diameter of the exhaust side of the fan and measure approximate distance from the fan to the eave/edge of the house.
Then, visit a hardware store or Lowes/Home Depot sort of store. Go the the plumbing section and ask about venting ducts for your bathroom fan. They should be able to fix you up with a fitting to attach to the fan, duct to go to the sidewall / eave and a fitting to drop the air through the eave. Far less invasive and you likely have ventilation holes with screen or mesh coverings to keep critters from trying to get in.
It's the sort of homeowner/handyperson thing that you can do fairly inexpensively. If you don't have the time or inclination to get up there...go for a handyman with the usual precautions about insurance.