|
| 1 | +{:.post-meta} |
| 2 | +*by [Philip Glazman][], Engineer at [River Financial][]* |
| 3 | + |
| 4 | +*River Financial is a challenger financial institution specializing in Bitcoin |
| 5 | +financial services. River Financial’s flagship product, a Bitcoin brokerage, |
| 6 | +provides retail investors with a high-touch platform to buy and sell Bitcoin.* |
| 7 | + |
| 8 | +River Financial leverages two technologies in its wallet software: [Partially |
| 9 | +Signed Bitcoin Transactions (PSBTs)][topic psbt] and [Output Script |
| 10 | +Descriptors][topic descriptors]. The decision to incorporate these standards has |
| 11 | +introduced greater flexibility and interoperability in River’s wallet operations. |
| 12 | + |
| 13 | +The decision to bring PSBTs into the wallet stack was influenced by the concept |
| 14 | +of treating key signers as interfaces. PSBT is a format for signers described in |
| 15 | +[BIP174][] authored by Andrew Chow. Before this standard, there had been no |
| 16 | +standardized format to describe an unsigned transaction. As a consequence, each |
| 17 | +signer used vendor-specific formats which could not interoperate. By conforming |
| 18 | +to the PSBT standard, the wallet infrastructure can avoid vendor lock-in, reduce |
| 19 | +the attack surface in the signer logic, and have better guarantees about the |
| 20 | +transaction being created by the wallet. The standard has also made |
| 21 | +multisignature scripts safer to use, therefore significantly improving security |
| 22 | +without a notable increase in operational expense. |
| 23 | + |
| 24 | +The decision to implement Output Script Descriptors in the wallet software has |
| 25 | +greatly reduced the complexity in wallet operations and has improved flexibility |
| 26 | +in the feature set. Descriptors is a language for describing scripts that was |
| 27 | +authored by Pieter Wuille and used in Bitcoin Core. In River’s wallet software, |
| 28 | +the descriptor language is leveraged in several places from wallet creation to |
| 29 | +address generation. Before descriptors, there had been no interoperable way for |
| 30 | +wallets to import useful information about the scripts they used. By using |
| 31 | +script descriptors, River’s wallet is able to reduce the necessary information |
| 32 | +needed to start watching a script, address, or set of keys. Each wallet within |
| 33 | +the wallet software has an associated descriptor with which scripts can be |
| 34 | +created. This has two immediate benefits: |
| 35 | + |
| 36 | +1. **The wallet software is able to watch cold wallets using descriptors and |
| 37 | + subsequently derive new addresses.** In our flagship brokerage product, River |
| 38 | + clients can create fresh deposit addresses to deposit Bitcoin directly to a |
| 39 | + secure cold multisignature wallet. |
| 40 | +2. **Creating and importing new wallets is easy because the descriptor language |
| 41 | + is able to define desired scripts.** River is able to maintain many wallets |
| 42 | + with different scripts and as a result have separate security models for each |
| 43 | + wallet. A P2WSH multi-signature descriptor is used for the cold wallet and a |
| 44 | + P2WPKH descriptor for the hot (client withdrawal) wallet. Separate wallets |
| 45 | + allow River to keep the absolute minimum Bitcoin in the hot wallet (to |
| 46 | + minimize risk) and better manage the UTXO pool to service withdrawals. |
| 47 | + |
| 48 | +The decision to use both descriptors and the PSBT standard has so far been |
| 49 | +rewarding because of the flexibility and interoperability. This foundation will |
| 50 | +help River Financial scale its wallet infrastructure. |
| 51 | + |
| 52 | +{% include references.md %} |
| 53 | +[Philip Glazman]: https://github.com/philipglazman |
| 54 | +[River Financial]: https://river.com/ |
| 55 | +[topic psbt]: /en/topics/psbt/ |
| 56 | +[topic descriptors]: /en/topics/output-script-descriptors/ |
0 commit comments