# Enabling transactions to use Replace-By-Fee using BDK-Kotlin

> A quick guide on how to use the BDK-Kotlin 0.7.0 library to send transactions with the Replace-By-Fee(RBF) feature enabled.

By Tang Yetong. Published July 9, 2022. 3 min read. Category: blockchain. Tags: BDK-Kotlin, Bitcoin, RBF, Transactions.
Read it with the interactive demos: https://tangyetong.com/blog/enabling-rbf-transactions-bdk-kotlin

A quick guide on how to use the [`BDK-Kotlin 0.7.0`](https://github.com/bitcoindevkit/bdk-kotlin) library to send transactions with the Replace-By-Fee(RBF) feature enabled. 
You can use the [`Padawan Wallet`](https://github.com/thunderbiscuit/padawan-wallet) and [`dev-kit`](https://github.com/thunderbiscuit/devkit-wallet/tree/simple-wallet) open-source projects as reference. 

## TxBuilder

With the `TxBuilder()` you can create the transaciton as per usual. 

```kotlin
var txBuilder = recipientList.fold(TxBuilder()) { builder, recipient ->
    builder.addRecipient(recipient.address, recipient.amount)
}
txBuilder = txBuilder.enableRbf()
txBuilder = txBuilder.feeRate(satPerVbyte = feeRate)
return txBuilder.finish(wallet)
```

As you can see we are just adding the recipient address and amount normally, while adding a `.enableRBF()` method. 
Creating the new transaction to replace that one will be covered in a different blog post since that is a whole separate issue with tons of UI etc.
