A contractum trinius was a set of contracts devised by European bankers and merchants in the Middle Ages as a method of circumventing canon law edicts prohibiting usury. At the time, most Christian nations heavily incorporated scripture into their laws, and as such it was illegal for any person to charge interest on a loan of money.
To get around this, a set of three separate contracts were presented to someone seeking a loan: an investment, a sale of profit and an insurance contract. Each of these contracts were permissible under Church law, but together replicated the effect of an interest-paying loan.
The way this procedure worked was as follows: The loaner would invest a sum equal to the amount to be borrowed to the loanee for one year. The loaner would then purchase insurance for the investment from the loanee, and finally sell back the right to any profit made over a pre-arranged percentage of the investment to them. This system replicated the effects of a loan with any interest rate agreed between the two, and provided protection to the loaner against defaulting, while the loanee remained under the protection of the law when it came to collection of the money by threats or force (loan sharking).
The Church proved utterly unable to legislate against the contractum trinius, and the idea quickly spread to merchants and bankers across Christendom. It helped in part to improve public perception of the practice of usury by moneylenders, and ultimately the doctrine was rewritten by the School of Salamanca, and the ban overturned in many Protestant countries, starting with England by Henry VIII.
The practice has recently, and somewhat controversially, been revived by Islamic banks in a slightly modified form, again as a method of working around a ban of ribaa (usury) in religious scripture.