contraction vs. prepayment risk

What is the difference between the two? I assume they both relate to reinvestment risk, but I cannot find any explicit definition that would differentiate the two types of risk.

Prepayments cause contraction, but so can call options and put options.

Ok, so prepayment risk is what eventually leads to contraction risk?

Prepayment options are one route to contraction risk, yes.

So is the main risk in both prepayment and contraction risk is reinvestment risk and also the risk of not recieveing cash flows are scheduled times in the future?

That’s correct.