Prizes are often awarded to encourage research on products deemed of vital importance. We present a mechanism which can, in situations where the innovators are better informed about the difficulty of the research, tailor perfectly the expected reward to the expected research costs. The idea is to let the first successful inventor trade off the risk of having a competitor share the reward in exchange for a higher prize. If the goal of the designer is to minimize the prize awarded whilst encouraging innovators to conduct research, such a mechanism achieves the first best.