So is marriage. Marriages are legal contracts between individuals, are performed in accordance with secular law by agents licensed by the state. I understand the religious overlay but that doesn't change the fact that marriages occur, and are dissolved, under rules set out by the state. At the risk of sounding rather cold-blooded it seems to me that a pre-nup would be a reasonable extension of this.
You are spot on!