Releases: comit-network/baru
Releases · comit-network/baru
0.4.0
Added
- Wallet which allows users to select coins through a backend configured by them via the
GetUtxos
trait.
The provided wallet comes with a UTXO cache which this is updated usingWallet::sync
.
This allows users of the library to optimise the number of requests to their backend.
Users can also sign said UTXOs by callingWallet::sign
. Timelock
type to allow users of the library to explicitly choose the type of timelock they want to use when building the loan transaction.
For the time being, users can still pass in au32
, but they are encouraged not to.
Changed
- The borrower can now choose the collateral inputs before calling
Borrower0::new
.
Fixed
- The loan transaction no longer expects collateral and principal change outputs.
We were unconditionally adding them to the transaction which could result in attempting to build a 0-valued confidential transaction output, which is invalid.**
0.3.0
Added
- Chain on which the loan protocol takes place is no longer hard-coded to Elements (local development node).
The chain is implicitly configured by the addresses that are passed in.
Furthermore, the protocol now verifies that borrower and lender are on the same chain. - New API
build_loan_transaction
onLender0
, which wraps the now deprecatedinterpret
:- The lender now has direct control over the
principal_amount
,principal_inputs
,repayment_amount
andmin_collateral_price
.
- The lender now has direct control over the
Fixed
- Always satisfy the collateral contract input in the loan repayment transaction correctly.
We used to assume that it was located at index1
, but this could change if the number of inputs used to cover the repayment output was greater than 1.
Changed
- Lender sets collateral contract timelock, as opposed to the borrower.
- Deprecated all APIs which use
LoanRequest
, to give users more control over how they want to serialize the parameters inside loan request.
0.2.0
Added
- Dynamic liquidation branch to the loan protocol:
- New
async fn dynamic_liquidation_transaction()
API onLender1
.
It takes a message of the formprice:timestamp
and an oracle's signature on the hash of the message, so that a lender can unilaterally liquidate the loan if theprice
falls below a threshold and thetimestamp
is past a certain time. Lender0
constructor now requires blinding key of lender address and an oracle public key.
- New
Changed
loan::LoanResponse
fields:- Made
timelock
private, but accessible viaLoanResponse::collateral_contract(&self).timelock()
. - Made
transaction
private, accessible via getter. - Made
collateral_amount
private, but accessible via getter.
- Made
loan::Borrower1
fields:- Made
loan_transaction
private, but accessible via getter. - Made
collateral_amount
private, but accessible via getter.
- Made
loan::Lender1
fields:- Made
timelock
private, but accessible via getter.
- Made
fn liquidation_transaction()
API onLender1
is nowasync
.- Model the collateral contract's timelock as a
u32
.
Fixed
- Squashed an elusive bug preventing users from building version
0.1.0
of this library.
This required updatingrust-elements
to version0.18
.
0.1.0
Added
- Loan protocol and swap libraries originally developed in Project Waves.