TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How to accept Bitcoin payments without running a full node

101 点作者 john111超过 8 年前

15 条评论

jnbiche超过 8 年前
If you&#x27;re going to run a payment system this way, by generating addresses and then checking if they&#x27;ve confirmed, the better way to do it (rather than pre-generating a batch), is to use hierarchical deterministic (HD) wallets. This way, instead of having to re-generate a batch of one-time receiving addresses to use on a regular basis, you generate a master key and then use the algorithm to generate addresses without having to use a full Bitcoin node (there are libraries in Python, JS, and all the common languages, look for &quot;BIP 32&quot; or &quot;HD Wallet&quot;). All you need to generate the deterministic addresses on your server is the master public key, thus there&#x27;s less security risk (if the master public key is disclosed, it threatens the privacy of your users, but not the integrity of your funds).<p>If you don&#x27;t want to bother generating the deterministic keys online, you could pre-generate thousands, even millions of them if you want. And keep both the private and public master keys offline. It also is a safer approach since you can securely store the master private key in a offline hardware wallet and not have to worry about keeping track of hundreds of private keys.<p>Long time since I&#x27;ve been active in Bitcoin, but this is the way I would have run a payment service without using a full node.
jstanley超过 8 年前
Author here, surprised to see this on HN! I considered submitting it myself but didn&#x27;t think this crowd was that into Bitcoin. Nice to be proven wrong :)<p>A couple of people mentioned HD wallets:<p>I initially tried using an HD wallet, but the mechanism for interacting with it was more inconvenient than generating keys manually - especially considering that you might have to generate hundreds of addresses in a row that never receive a payment.<p>I&#x27;ve added an update at the end of the article.<p>Cheers!
评论 #12940657 未加载
评论 #12939558 未加载
评论 #12939748 未加载
j2kun超过 8 年前
21 Inc. (where I work) has a very easy to use python library [1] allowing you to accept bitcoin payments via HTTP 402. But you can also just use the library to serve up a fresh payout address in plaintext on a website.<p>If you like the CLI, it has that too; it&#x27;s a fully-compliant HD wallet. Getting set up is as simple as it can be<p><pre><code> $ curl https:&#x2F;&#x2F;21.co &gt; setup.sh $ sh setup.sh $ wallet create [write down mnemonic] $ wallet payoutaddress [printed payout address] </code></pre> Then you can use `wallet history` or `wallet balance` to see incoming payments, and `wallet send` to send money to a recipient.<p>If you like the advanced stuff, it has support for micropayment channels, too.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;21dotco&#x2F;two1-python&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;21dotco&#x2F;two1-python&#x2F;</a>
csomar超过 8 年前
&gt; Third-party Bitcoin payments services typically take a 1% fee.<p>This is not accurate. Bitpay (most popular payment provider) charges you only if you settle (convert your BTC to USD).<p>If you are going through an exchange (bitfinex for example), you&#x27;ll pay 0.2% for taker rates.<p>0.8% seems reasonable enough for me considering that Bitpay provides a decent interface and decent tools.
评论 #12939381 未加载
评论 #12939169 未加载
firethief超过 8 年前
This is reckless. If your hardware corrupts data too often to sync a full node, the solution is not to hack together a homemade payment processing system with only SPV-level security that will run on your faulty hardware. This approach and the attitude behind it will lead to losing money and losing track of customer payments, probably sooner rather than later. Rolling your own payment processor is a great way to learn more about bitcoin, but use testnet coins. If receiving real money is what you want, use a tested library written by someone who put in the time and experience to do it the right way, or use a 3rd party payment processor. Don&#x27;t learn with real money; that&#x27;s learning the hard way.
therealidiot超过 8 年前
The author mentions being plagued by crashes&#x2F;corruption, but I&#x27;ve never experienced this and I&#x27;ve been running a full node for a few years. Other than the large (well, not _that_ large) storage requirements (.bitcoin is currently 101G) I&#x27;ve not got any complaints...<p>Unless there&#x27;s a bug in a recent version of bitcoind which causes it to crap out when initially catching up with the network?
评论 #12939191 未加载
评论 #12951681 未加载
olegkikin超过 8 年前
&gt; <i>I use the keyconv program from vanitygen as a convenient way to do this. Simply running &quot;keyconv -G&quot; generates an address and private key and outputs them.</i><p>You have to really trust that vanitygen tool. If there&#x27;s some bug where there&#x27;s not enough entropy in the private key generation, ALL your temporary wallets become vulnerable (e.g. someone can generate your private keys).
评论 #12940871 未加载
snitko超过 8 年前
I&#x27;m the original author of &quot;Straight&quot;, a stand-alone opensource Bitcoin payment gateway - a software that allows you to accept Bitcoin payments: <a href="https:&#x2F;&#x2F;github.com&#x2F;MyceliumGear&#x2F;straight-server" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;MyceliumGear&#x2F;straight-server</a><p>It is now part of the Mycelium Gear project, which is a hosted commercial version of it, and I don&#x27;t work for the company anymore, but the team behind it that I hired and worked with is really great and they keep working on the product.
wyager超过 8 年前
A problem I&#x27;m currently addressing that maybe someone can help with:<p>I&#x27;m using a BIP32 HD wallet master pubkey to generate addresses on the payment front-end. Now, the ideal payment-watching solution would be the following; it maintains a set of &quot;active&quot; addresses, which I can add to whenever, and notifies me whenever one receives a confirmed payment. However, I&#x27;m not sure if this exists. I would also settle for me being able to query arbitrary address balances quickly.<p>Bitcoin-core doesn&#x27;t work because adding an address causes a rescan of the entire blockchain (as it doesn&#x27;t maintain an address-indexed UTXO dictionary for all addresses), which is too slow. I think electrum-server might work. Even though I&#x27;m following the same derivation path as electrum-client, I don&#x27;t think I can use electrum-client for this (because I could conceivably be attacked with hundreds of thousands of address generation requests, which I doubt electrum-client will like). I also want to ignore adderesses more than, say, a week old, which I don&#x27;t think electrum-client supports.
out_of_protocol超过 8 年前
Article recommends creating private&#x2F;public pair via vanitiygen but imo that&#x27;s not the best way to do it.<p>Alternative:<p>Create HD wallet (via electrum e.g.), get &quot;public master key&quot; and use it everywhere. You can generate consequent public addresses using that key but you can&#x27;t generate private keys (i.e. spend anything). Now your server is protected from stealing any money and don&#x27;t require any special backups for these new keys.
inthebitcoin超过 8 年前
Hi jstanley great article I&#x27;m running similar system at <a href="https:&#x2F;&#x2F;inthebitcoin.com" rel="nofollow">https:&#x2F;&#x2F;inthebitcoin.com</a> for few months and it works great for me. No need for any third-party payment system. Space (101GB) is cheap this days !
raphinou超过 8 年前
Seems <a href="http:&#x2F;&#x2F;www.nem.io" rel="nofollow">http:&#x2F;&#x2F;www.nem.io</a> have built their software separating in client and server components, the client using the rest api published by the server. Would that be a good approach?
hashmp超过 8 年前
Just use Electrum, bread wallet for iOS or one of the many other spv clients. No need to run a full node, haven&#x27;t needed to for years.
ant6n超过 8 年前
Doesn&#x27;t stripe support bitcoin?
hashmp超过 8 年前
Just use Electrum, bread wallet for iOS or one of the many other spv clients. No need to run a full node, haven&#x27;t needed to for years.