I think I would do it this way
From the bottom of the legs in 3 places, I would drill 1 1/2"+/- holes, and stop the holes about 2" from going thru the legs. Then drill 3, 3/8" holes thru the top of the leg. On the 2 outside holes, elongate the holes, to allow for expansion of the top,
Use 3/8" x 6" lag bolts with washers.
I would also cut a shallow dado for the legs to sit in, just because.
You could do it from the top if you wanted the exposed dowel look. I would use 2"+/- dowels.
Even if I wanted the dowel look, I would drill from bottom, and put in fake dowels. The lag bolts would allow dissassembly if wanted.