When using cacao nibs to brew a chocolate stout, should they be added in the boil (if so, when?), in the secondary fermenter, or both? Is there a better ingredient to add to produce the chocolate flavor?
Most "Chocolate" stouts get their flavor from a combination of roasted malts - chocolate malt, pale chocolate malt or coffee malt. There are delicious exceptions, like Young's Double Chocolate Stout.
Nibs are dehusked, roasted cacao seeds. They are high in fat (relatively tasteless cocoa butter), which does not add much flavor and which might cause problems with head retention if you put nibs in the boil. Cocoa powder is a much more concentrated source of chocolate flavor and comes without the fat. However, it is a more highly-processed product, which some people would like to avoid.
If using nibs, you could crack them and soak them in vodka to sanitize and extract any alcohol-soluble flavors, then dump the nibs plus vodka into the secondary.
If using cocoa powder, then you could add it towards the end of the boil. Beware clumping, because it is very powdery.