The design of risk sharing to promote cooperation