<p>Product and services reviews are generally off-topic for this site. That said, i think the way the question is formulated allows to give some general guidance for how to go about looking for a Bitcoin wallet which fits your needs, without getting in an opinionated analysis of each of them.</p>
<p>From the question and the comments, i infer you are more familiar with Ethereum. I believe web wallets are much more common in the Ethereum world than they are in the Bitcoin world. I think if you look around for web-based Bitcoin wallets you'd mostly come across &quot;pocket money&quot; wallets which put forward Lightning or Chaumian Mint based payments rather than onchain transactions.</p>
<p>Since you don't have specific requirements for the format of the script, you could either:</p>
<ol>
<li>Look for wallets which support <a href="https://bitcoin.sipa.be/miniscript/" rel="nofollow noreferrer">Miniscript</a>. They aren't yet very common yet, but are now getting more traction and more are being developed. That said, i would expect most Miniscript-aware wallet to not support <em>any</em> Miniscript. Rather i'd expect they would simply leverage Miniscript for the usecase they are focused on addressing.</li>
<li>Look if you could integrate with Lightning. After all, payments on Lightning are just HTLC's. Except they are kept off-chain most of the time. If you choose this route, i'd advise to design your protocol such as to keep Lightning payments almost instant. It's sometimes tempting to just hold onto an HTLC (thereby blocking liquidity along the whole path), but it won't be free forever.</li>
</ol>

CC BY-SA 4.0
2024-01-15T15:02:17.267Z
2024-01-15T15:02:17.267Z
Antoine Poinsot
<p>I am creating an atomic swap interface between Bitcoin and EVM using hashed timelock contracts as the underlying swapping mechanism. The idea is to support atomic swaps via the browser, using browser-based wallets.</p>
<p>To do this I need my web interface to be able to create Bitcoin scripts programmatically and create transactions to which those scripts are attached - all via the web interface. Metamask uses Web3.js for the EVM side of this transaction, but I am not sure which browser-based Bitcoin wallet has similar functionality.</p>
<p>I need to support a bitcoin wallet that can invoke new bitcoin scripts via javascript and create transactions based on those scripts. Does such a browser-based wallet exist for Bitcoin?</p>
<p>I have looked at Xverse and Trust wallet, but no such support seems to exist.</p>
<p><strong>Question:</strong></p>
<p>Is there a browser-based bitcoin wallet that can support the programmatic creation of transactions that include custom Bitcoin scripts?</p>

CC BY-SA 4.0
2024-01-15T14:02:42.193Z
Wallet reviews are off-topic for this site. That said it's a good question. If this helps, i think browser-based wallets are much more common in Ethereum land than in Bitcoin land. In Bitcoin the only ones you'd come across would likely be "pocket money" wallets (i'm thinking of the Joule extension, Mutiny, or even Cashu) which aren't used for onchain txs. In addition there is still a limited number of wallets with support for custom scripts, which makes it very unlikely any of the browser-based wallet does support them.
Antoine Poinsot
CC BY-SA 4.0
2024-01-15T14:11:06.563Z
Thanks. If there are no browser-based options, are there any desktop-based options other than Bitcoin-QT/Bitcoind? I'm hoping one that doesn't require the user to run a full-node.
Dev Oskii
CC BY-SA 4.0
2024-01-15T14:32:10.100Z
You only need HTLCs? Are your scripts Miniscript-compatible? They should be, or it should be easy to make them so. (Side-note: given the upvotes i think we can make an exception for this question, i'll write up an answer once this conversation in the comments is over.)
Antoine Poinsot
CC BY-SA 4.0
2024-01-15T14:39:04.940Z
I haven't created the HTLC scripts yet - I was looking for a wallet solution first then I am happy to write them in whatever format is necessary. The main goal here is to enable the entire flow via the browser. So I am agnostic as to the implementation details of the HTLC script itself
Dev Oskii
<script><hash-time-locked-contract>
Do any browser wallets support custom bitcoin scripts?
Dev Oskii
# Do any browser wallets support custom bitcoin scripts?

(Asked by: username_0 on 2024-01-15)

I am creating an atomic swap interface between Bitcoin and EVM using hashed timelock contracts as the underlying swapping mechanism. The idea is to support atomic swaps via the browser, using browser-based wallets.

To do this I need my web interface to be able to create Bitcoin scripts programmatically and create transactions to which those scripts are attached - all via the web interface. Metamask uses Web3.js for the EVM side of this transaction, but I am not sure which browser-based Bitcoin wallet has similar functionality.

I need to support a bitcoin wallet that can invoke new bitcoin scripts via javascript and create transactions based on those scripts. Does such a browser-based wallet exist for Bitcoin?

I have looked at Xverse and Trust wallet, but no such support seems to exist.

**Question:**

Is there a browser-based bitcoin wallet that can support the programmatic creation of transactions that include custom Bitcoin scripts?

**Tags:** script, hash-time-locked-contract

> **Comments:**
> **username_1**: Wallet reviews are off-topic for this site. That said it's a good question. If this helps, i think browser-based wallets are much more common in Ethereum land than in Bitcoin land. In Bitcoin the only ones you'd come across would likely be "pocket money" wallets (i'm thinking of the Joule extension, Mutiny, or even Cashu) which aren't used for onchain txs. In addition there is still a limited number of wallets with support for custom scripts, which makes it very unlikely any of the browser-based wallet does support them.  
> **username_0**: Thanks. If there are no browser-based options, are there any desktop-based options other than Bitcoin-QT/Bitcoind? I'm hoping one that doesn't require the user to run a full-node.  
> **username_1**: You only need HTLCs? Are your scripts Miniscript-compatible? They should be, or it should be easy to make them so. (Side-note: given the upvotes i think we can make an exception for this question, i'll write up an answer once this conversation in the comments is over.)  
> **username_0**: I haven't created the HTLC scripts yet - I was looking for a wallet solution first then I am happy to write them in whatever format is necessary. The main goal here is to enable the entire flow via the browser. So I am agnostic as to the implementation details of the HTLC script itself  

---

## 1 answers

### Answer by username_1 on 2024-01-15. Score: 2

Product and services reviews are generally off-topic for this site. That said, i think the way the question is formulated allows to give some general guidance for how to go about looking for a Bitcoin wallet which fits your needs, without getting in an opinionated analysis of each of them.

From the question and the comments, i infer you are more familiar with Ethereum. I believe web wallets are much more common in the Ethereum world than they are in the Bitcoin world. I think if you look around for web-based Bitcoin wallets you'd mostly come across "pocket money" wallets which put forward Lightning or Chaumian Mint based payments rather than onchain transactions.

Since you don't have specific requirements for the format of the script, you could either:

1. Look for wallets which support [Miniscript](https://bitcoin.sipa.be/miniscript/). They aren't yet very common yet, but are now getting more traction and more are being developed. That said, i would expect most Miniscript-aware wallet to not support *any* Miniscript. Rather i'd expect they would simply leverage Miniscript for the usecase they are focused on addressing.
2. Look if you could integrate with Lightning. After all, payments on Lightning are just HTLC's. Except they are kept off-chain most of the time. If you choose this route, i'd advise to design your protocol such as to keep Lightning payments almost instant. It's sometimes tempting to just hold onto an HTLC (thereby blocking liquidity along the whole path), but it won't be free forever.


---

