The origin of ultrahigh-energy cosmic rays (UHECRs; \(E\gtrsim 10^{17}\)  eV) is an outstanding problem in physics and astrophysics. Gamma-ray bursts (GRBs), by being the most powerful electromagnetic explosions in the universe, are thought to be prime candidates to accelerate particles to ultrahigh energies [1]}, [2]}. Direct signatures of UHECRs from GRBs, however, are absent. Non-detection of high-energy neutrinos from GRBs by IceCube [3]}, [4]} has put severe constraints on the cosmic-ray acceleration during the prompt emission phase [5]}, [6]}, [7]}. Neutrino signature of the UHECR acceleration in the afterglow phase of GRBs is difficult to detect with the current generation of the neutrino detectors [8]}, [9]}, [10]}. Gamma-ray signature from very nearby GRBs on the other hand can be used to study UHECR acceleration in these ultra-relativistic jets.
