BitGo / BitGoJS

BitGo JavaScript SDK
https://developers.bitgo.com/
Apache License 2.0
348 stars 269 forks source link

feat: add sweep function for v1 wallets #4670

Closed rushilbg closed 4 weeks ago

rushilbg commented 1 month ago

Given a list of unspents, walletPassphrase, destination, feeRate, and an encryptedUserKey, the sweep function will creates a transaction sweeping all the given unspents to the given destination, while not generating a change output.

The function half-signs the transaction using the user key, and sends it to the BitGo platform for getting the BitGo signature, while not broadcasting the transaction. The user would receive a full signed transaction that they can broadcast themselves.

Caveat: For a given list of unspents, destination, and feeRate, only one valid full signed transaction will be generated by the BitGo platform.

BTC-1224