You can use what's called all-fuel chimney. Its a triple wall pipe and can be used with near zero clearance to combustibles. Its also seriously expensive. Just don't let anyone tell you that its okay to use a double wall type B gas vent on a woodburner. Very good way to burn the building down. There are ways to use single wall flue pipe in applications like yours, but they generally involve having to cut away anything combustible for a substantial distance or otherwise wrap the pipe in the vicinity of combustibles with a couple inches of mineral wool.....not a fun thing to do. You can use all fuel sections as thimbles where you have penetration of combustibles and use single wall pipe for the remainder. The nominal diameter of the all fuel is based on its ID and thats where the single wall material would connect to it. If it were me, unless there's a large distance between the ceiling and the roof, I'd run all fuel from below the ceiling continuously thru the attic space and out the roof. You can purchase a vent cap, adjustable flashing, and storm collar that is made to work with the all fuel to make the termination at the top and have a weatherproof installation. These parts arent very costly. If you check with a local heating supply house, they should be able to tell you what the local code requires for clearance, as this also determines the minimum distance from the wall to your woodstove or its single wall flue. Ideally, to make for the most cost effective installation, you want to have the stove located such that the flue will hit the center of a truss space and not require any ells to offset it in getting there. If you get into a situation that requires purchasing all fuel ells or tees you can quickly spend more than the cost of the stove on the smokepipe.