The Berakha of "She-asa Nissim"
The gemara in Masekhet Shabbat (23a) introduces the three berakhot recited on hadlakat nerot Chanukah. The first berakha – le-hadlik ner shel Chanukah - resembles a standard birkhat ha-mitzva. The final berakha - she-hecheyanu – is also familiar: all yamim tovim carry this berakha. The middle berakha, however, appears far less frequently. In fact, only one, or possibly two, other mitzvot require the recitation of this berakha of "she-asa nissim." First, one recites this berakha before reading the megilla on Purim. Apparently, this berakha reflects the added dimension common to megilla reading and Chanukah candles - pirsumei nissa. Aside from the essential mitzva to light, one also performs the mitzva of publicizing the miracle. Similarly, the pirsumei nissa achieved through megilla reading also dictates the recitation of the extra berakha of she-asa nissim. In fact, the only other mitzva in halakha which generates pirsumei nissa – arba kossot on Pesach night – also mandates an extra berakha. Although we do not recite the standard berakha of she-asa nissim, we do recite the berakha of asher ge'alanu (immediately prior to drinking the second kos), effectively dedicating a berakha toward describing the miracle of Pesach. To summarize: there exist three mitzvot (all de-rabanan) which carry the component of pirsumei nissa. This is indicated by the presence of an additional berakha: in the case of Chanuka and Purim, the berakha of she-asah nissim, and in the case of Pesach, the berakha of asher ge'alanu.
Having attributed the berakha of she-asa nissim to pirsumei nissa, we might question the degree to which the berakha is tethered to the act of hadlaka. Did Chazal institute a completely separate berakha to commemorate the miracle, or did they instruct that the berakha be recited on the pirsumei nissa generated by the act of lighting? To what extent can the pirsumei nissa (and, by extension, the berakha) be severed from the act of lighting?
The gemara in Shabbat (23a) asserts that the berakhot are to be recited during the hadlaka. This is obviously the preferred le-khatchila option. What happens if the pirsumei nissa occurs separately from the lighting?
One scenario is actually stated by the gemara in Shabbat (23a), which instructs someone who witnesses a ner to recite the berakha of she-asa nissim. Though he has not lit himself, he may still recite the berakha on the pirsumei nissa generated by witnessing the lighting of others. Indeed, the Rishonim argue as to the scope of this halakha. According to Rashi, the berakha is recited only by someone who has not lit, will not light and has no one lighting for him at home. Ideally, she-asa nissim should be tethered to the act of lighting the menorah and the fulfillment of the mitzva of hadlaka. If this is impossible, the berakha may be severed from the act of lighting.
Even if we accept the extreme position (stated by the Rashba), that anyone who sees a ner – even if he plans to personally light - must still recite she-asa nissim, we still witness the medium of a ner as the basis for pirsumei nissa and the consequent berakha. Indeed, according to most Rishonim, if a person cannot light and does not behold anyone else lighting, he recites no berakha. Though we may separate the berakha from the ACT of lighting, it cannot be detached from the medium of ner Chanuka.
A notable exception to this position is the Me'iri (in Masekhet Shabbat), who rules that if a person has no opportunity to light or witness lights, he should still recite the berakha of she-asa nissim on the festival of Chanukah itself. Though ideally pirsumei nissa is integrated together with the mitzva of lighting, it may be isolated as an independent entity.
This question affects a second issue, as well. If someone lights the menorah in shul (and recites the berakha of she-asa nissim), should he repeat the berakha at home that evening (assuming he does not recite the berakha for anyone else)? In theory, if she-asa nissim can exist as an independent berakha, then once a person recites it that evening he may not repeat it. However, if it can only cohere within the act of hadlaka or the witnessing of hadlaka, then it must be repeated at home. Reciting it during the mitzva of public hadlaka does not excuse its recitation over private hadlaka, as the two constitute completely separate mitzvot. If the berakha exists independent of the mitzva (and instead addresses the day), then any prior recitation would obviate a second mention.