低成本Bitcoin錢包SegWit轉移大作戰 Send Bitcoin with Low Fees (EN/CN)

in #bitcoin7 years ago (edited)

今次希望和大家分享我使用低成本把Bitcoin從舊有錢包轉移到使用SegWit新錢包的大作戰。(不是B2X)Check out English ver in the middle of this story. Everyone wants low fees, especially Bitcoin Transaction Fees. I am going to tell you what I did today to lower my Bitcoin transaction fees.

有甚麼值得寫一篇文章去轉移Bitcoin?有的,是錢的問題。我在一個群組上看見有其他人跟我一樣用了8美元去做一個交易,8美元是一個天價!!這是一個很貴的交易呢。

轉移的背景

這次大作戰的起因是有兩個。第一個是因為我要在申領Bitcoin Gold之前把錢包中的Bitcoin全部拿走,以保障我的權益。第二是因為我買了Ledger Nano S這個硬體錢包,可以把Bitcoin轉換到新的SegWit錢包。

Bitcoin Gold

要申領Bitcoin Gold,大家是要把自己Bitcoin錢包的Private Key交到Bitcoin Gold的錢包內才可。這當然是對自己的Bitcoin安全有威脅。所以我走到Bitcoin Gold開發者那裏問了兩次,他們確認了現在我可以安全轉移現有的Bitcoin到別處,所以我就行動了。

Ledger Nano S

我相信有很多朋友都在這一兩星期收到了Ledger Wallet的付運。在我打算做開箱文的時候,我見到有其他朋友已做了,所以我就把開箱文的主意打消掉,改為寫像這篇的使用心得。

Ledger Nano S的好處是它的硬體跟軟體的配撘很好,並不如有一位KOL因為它那張寫下Recovery Seed的紙張不濟就變得不好用。但有一點是要說明的,就是我花了一點時間測試使用方法,及把Recovery Seed回復到硬件數次,包括特意把Recovery Seed入錯的測試,及把Recovery Seed回復到其他軟體Wallet的測試才安心使用,建議大家都做這些測試。

為何要轉換至SegWit

轉換至SegWit其實是可以把交易費用壓低。例如舊有Bitcoin交易的大小是226 bytes,而SegWit交易以計算費用的virtual bytes來計算大約是40% off (六折),即是傳送至3字開首的SegWit 地址價錢是40% off(對比之前原來1字開首的地址的費用)。

免用腦的低價交易轉送

由於我對其他軟錢包已經失去了信心,我就只是用Electrum電腦版來測試,它可以讓我微調交易費用。我把費用調節至最便宜,它告訴我要 0.00019122 BTC作全額費用。

這個全額費用的意思是不計交易大小的bytes,全部費用就是0.00019122 BTC這麼多。今天的Bitcoin價格是$5900,換回美元計算是需要 $1.12。便宜了許多呢~

計算費用

那不是很便宜嗎?8美元去到1.12美元.....在做了一點研究後,我知道其實還可以更便宜

我發現其實有數個網站是可以做交易費用的估價,而我就建議大家先到這個網站看看:
https://bitcoinfees.21.co

在這裏我做了三件事。

首先必要的是更改一個選項,就是左上角Fee下面,由Satoshis PER BYTE調節成BTC PER BYTE。這個其實是方便我自己的計算,因為我所有的計算都是以BTC作為單位,用了Satoshi為單位就看不慣了,易出錯。

第二是在圖表中找出最先是綠色的那一個數值,再望一下右手面的Delay時間。這一步其實是多餘的...

第三,是在圖下的那幾句說話:

Which fee should I use?

The fastest and cheapest transaction fee is currently 0.0000009 BTC/byte, shown in green at the top.
For the median transaction size of 226 bytes, this results in a fee of 0.0002034 BTC.

這是說,一般交易的大小是226 bytes,你願意付0.0000009 BTC/byte的話,把這兩個數值相乘,就會得出 0.0002034 BTC 這個全額費用。

你見到這裏所顯示的價錢比Electrum顯示的那個還貴。不過這是指最快的費用,即不用等太多時間的費用,對比圖表的Delay是 0 to 2 blocks,即最耐是20分鐘的時間。我是不急需10分鐘內就有第一個confirmation的,一般設定較低的費用作較遲的交易計算,BTC錢包也會即時顯示安排了這個交易。

更便宜的費用

是否真的不給 0.0002034 BTC就不會快速計算交易?不是的,網絡不繁忙就便宜點都可以快的。但設定得太便宜就有機會令交易永久不獲計算,後果可以好嚴重..... Electrum電腦版可以讓我們有追加額外交易費用的功能,所以是比較安全的。

警告:請必定要先用非常小的數目測試過數次才進行大面額交易。如你不肯定是否正確,不要嘗試用於大額交易。如你有很多Bitcoin,請使用Electrum提供的費用,因你太有錢了

要慳,可以看看這個網站:
https://btc.com/stats/unconfirmed-tx

到達之後,你會見到這兩行:

Current best transaction fees
40 Satoshis/byte | 0.0004 BTC/KB

我用的是第一個數值,第二個數值你千萬不要理會。(可到先前的那個網站了解這兩個的分別)

我們要知道 1 Satoshi 等如多少 BTC。

1 Satoshi = 0.00000001 BTC
小數點後七個零,之後第八個位就是Satoshi

40 Satoshis/byte = 0.00000040 BTC,比先前那個網站所說的 0.0000009 BTC/byte 平了55%!!(0.0000009 BTC/byte 在顯示小數點後8個位,其實是 0.00000090,即 90 Satoshis。)用這個價錢來計算,我的交易費用是 0.00000040 x 226 = 0.00009040 BTC。對比原先在Electrum顯示的價錢也平了53%!換算美金,0.53336 就可以。

付便宜價錢要等多久?

由於我是有數個錢包戶口要轉送,當然平得多就更開心。但我都很小心,做了一次測試。我轉送了 0.0001 BTC,並用了 0.00009040 BTC 這個費用,結果.......

ryo-btc-tx-fee-01.jpg

不用10分鐘就開始進行交易計算,這不就是買經濟位,坐頭等的𣈱快體驗?!

費用設定得太低會如何?

太低的意思,今日來說大概是指30 Satoshi 以下,因為費用太低,令交易在等待處理。這個情況會為你帶來不便,但通常不會有遺失Bitcoin的情況發生。處理方法有幾個。

ryo-replaceable-by-fee-03.jpg
Electrum - 我這個交易費用設定太低了 @.@
幸好可以用 Replaceable / Increase Fee

如果你本身像我一樣是用Electrum,是可以補付費用的。條件是交易之前啟用了Replaceable By Fee的設定,你是可以補付交易費用。

另一個方法是使用Transaction Accelerator,提供服務者有兩個,一個是ViaBTC,另一個是BTC.com。BTC.com那個是很貴的,建議你用免費(但有限制)的ViaBTC TX Accelerator
https://pool.viabtc.com/tools/txaccelerator

等待transaction reappearance也是可行方法,到了指定時間仍未能處理,就會退回原有錢包。不過現在Bitcoin network的設定是2星期。

另外還有CPFP Child Pays For Parent的方法,但就不在我今天要寫的範圍了,有興趣的話可以搜尋一下 。

當然,在我例子中的40 Satoshis其實已經很相宜,實在沒必要冒險把價錢再壓低

結論

經過今次實驗,我得出兩個結論:

  1. 一定要選用可以自訂交易費用的錢包,最好是可以用Replaceable By Fee
  2. 可以自訂費用的時候,簡單用本文這兩個網站就可以安全地大慳特慳了

在我寫完這篇之後,我就發現建議便格由40 Satoshis 上升到 105 Satoshis,所以有時等一等都是需要的。聽說在週末的時候,費用還會更平呢。建議記緊在B2X啟動之前,把你的BTC安頓好。 ^_^

English Version

Recently, I am consolidating my Bitcoin accounts and researched a bit on fees. I was told by a friend in a community group he had the same bad experience on a very expensive transaction fees of up to US$8. It was not even at a price this high of US$6000.

Goal

I need to transfer all my Bitcoin from several wallets to some new wallets because I want to claim my Bitcoin Gold. The 2nd reason is to migrate all my existing wallets to Ledger Wallet that has implemented proper SegWit supports. (Not B2X-SegWit2X)

Bitcoin Gold

To claim Bitcoin Gold, I have to provide my private keys of existing Bitcoin wallets to a different wallet. It has been advised best to empty my existing BTC wallet first. After talking to the developer of the Bitcoin Gold, I am told I am safe to move my BTC now. That’s why I am taking actions.

Ledger Nano S

I believe many of you reading this story has recently received the Ledger Nano S from your back orders. I originally planned to do an open box review, but gave up because I found several reviews that have been properly written. Instead, I am going to write some useful tips.

Ledger Nano S is good on its combination of hardware with software. The hardware is well designed, while the software is easy to use. The only thing at the moment I want to advise everyone is to test your Recovery Seed several times before actually transferring your coins in. I tested a few times for successful recovery, as well as intentionally enter the seed wrong to see what would happens – found that entering the seed wrong will not get through, good to know, right?

Why switching to SegWit?

The benefit of SegWit is to lower the transaction fees. The non-SegWit Bitcoin transactions are usually around 226 bytes. SegWit transactions have its size about 40% smaller in virtual bytes than non-SegWit transactions. As fees are calculated in virtual bytes, this means the fee should be lowered by 40%.

Note: non-SegWit addresses start with 1, SegWit address start with 3.

Idiot-proof low fees transaction

I lose faith on some wallets due to their unreasonably high fees. Now I only use Electrum and Mycelium - they let me set fees manually. I tested today with Electrum and it suggested a fee for the transaction at 0.00019122 BTC, seems good, right?

This fee is not a per byte fee, this is the fee that will complete the transactions. Convert this fee at today’s Bitcoin Price of $5900, it is $1.12, quite affordable.

Calculate your fee

Why calculate? Isn’t $1.12 a lot cheaper than $8? After some research, I realized there could be a better rate.

There are a few websites that do fee estimations, and I think this one is the 1st one we can use.

https://bitcoinfees.21.co

I did 3 things in this website.

1st, change the unit from Sat to BTC. Satoshis PER BYTE -> BTC PER BYTE. This should make life easier, as most of us see our Bitcoin in BTC.

2nd, look for the value next to the first green bar. Take a look at the time delay shown at the right.

3rd, take a look at the text right below the chart:

Which fee should I use?

The fastest and cheapest transaction fee is currently 0.0000009 BTC/byte, shown in green at the top.
For the median transaction size of 226 bytes, this results in a fee of 0.0002034 BTC.

This means you take the fee per byte and multiply it by 226. This means you need 0.0002034 BTC to complete a transaction.

As you can see, this is more expensive than the one suggested by Electrum. Well, here, the main point is fastest. The assumption is you pay this fee to let the transaction be processed within the delay, which is 2 blocks shown in the chart, that is 20 minutes. I do not need to get the transaction be confirmed immediately, so I can set a lower fee to save a bit. Even if I set a lower fee, the wallet that will receive the Bitcoin will inform me immediately after I broadcast the transactions.

I want a cheaper fee

Is it a must to pay 0.0002034 BTC to have a fast confirmation? Not really. If the network is less busy, a lower fee should get through quite fast.

But be sure to set a fee that is good enough to get the transaction be processed. Setting unrealistic fee will make your transaction never get processed. Desktop version of Electrum is good in this sense because you can add additional transaction fee after the broadcast.

WARNING: Try with a very small amount! Better with Electrum with Replaceable By Fee turned On. Do not send large amount of Bitcoin if you are not sure what you are doing. If you have a lot of Bitcoin, you should just use the suggested fee in Electrum because you are wealthy enough!

To save more fees, take a look at this website:
https://btc.com/stats/unconfirmed-tx

Then, you should see something like this:

Current best transaction fees
40 Satoshis/byte | 0.0004 BTC/KB

We need the 1st number, not the 2nd number. The reason is explained in the 1st website.

So, how much is Satoshi in Bitcoin?

1 Satoshi = 0.00000001 BTC
The eighth number after the decimal places.

40 Satoshis/byte = 0.00000040 BTC, 55% cheaper than the previous website! In the previous website, it lists 0.0000009 BTC/byte, which is 0.00000090, 90 Satoshis. Using 40 Satoshis to calculate the fee, 0.00000040 x 226 = 0.00009040 BTC!! 53% cheaper than the idiot proof Electrum fee. It is around $0.53336 in USD!

Cheaper Price, How Long?

I have multiple wallets and therefore cheaper fees let me save more. Well, it is always good to test it with a very small transaction. I tested with 0.0001 BTC, using this 0.00009040 BTC fee. The result is surprising.

ryo-btc-tx-fee-01.jpg

In less than 10 minutes, my transaction has been processed. How wonderful... paying a fee for economic class and enjoy the first class experience!

Fee that is too low

Fee too low at this moment is about 30 Satoshis per byte. It would results in transaction delay and no one is going to process your transaction. You cannot cancel it as well. It will cause you inconvenient, but will probably not causing lost coin. You could solve this issue by the followings.

ryo-replaceable-by-fee-03.jpg
Electrum - Fee too low (my 2nd transaction @.@) Replaceable / Increase Fee

First, if you are using Electrum and have turned on Replaceable By Fee, you can pay more fee after you send the transactions.

Another method is to use Transaction Accelerator. There are two providers. BTC.com's service is expensive that I don't think you will use it. The one from ViaBTC is basically free, but have limitation. Check this out:
https://pool.viabtc.com/tools/txaccelerator

If your transaction have not been processed in 2 weeks, your coin will probably reappear in your wallet. Search Transaction Reappearance for details.

You can also try CPFP Child Pays For Parent. You will need to search for it because I thinkn it is too complicated for this story.

In fact, 40 Satoshis in my example here is already a very good deal, not worth saving tiny additional that could cause troubles.

Key Take Away

2 main points you need to know for savings:

  1. Make sure you use a wallet that can let you adjust fee manually, better with Replaceable By Fee feature.
  2. When you are able to adjust the fee, using the 2 websites I used above can help you safely send your transactions in lower fee.

At the time I finished writing this story, the recommended fee raised from 40 Sat to 105 Sat. It is good to wait for a bit to let the fee gets lower. I also learnt that it is cheaper to send in weekend. Use these tips to consolidate your BTC before B2X activation!~

Copyright © RyoPlasmic 2017. All rights reserved.
本文可供傳閱及引用,唯必須提及出處(本頁)。禁止未經授權出版複制至任何牟利刊物及網站。

ryo-tipme-banner-03-650.png
Not a Steemit user? You can motivate me by other Cryptocurrencies!
喜歡我的文章但沒有Steemit戶口?你可以用其他加密幣鼓勵我。謝謝🙏

Sort:  

useful..thc

welcome ^_^

I've been using 1-2 sat/byte and then going to sleep. It goes through, and since I was basically transferring between myself, not a big deal. Or via a trusted friend. Takes like 6 hours hahaha... I also was curious and set 0 fee once. Those just don't work. The next day I couldn't find my unconfirmed transaction on the network.

Of course, doing this with other recipients is not good.

Do you need a segwit address to claim Bitcoin gold?

My 23 Sat transaction is not getting through for like 20 hours now. I use this fee simply because I know I can increase fee. I wanted to try lower if it gets through easily but not. Now the lowest suggested fee jump up from 40 to 163 @.@

I can imagine using CPFP will be getting a lot more expensive than using 40 Sat at the very beginning =.=

No, SegWit is not related. Just get the PKey and you are good.
I mentioned SegWit because the story involve fee calculation, so SegWit is related.

Oh wow... looking at bitcoin fees now, transaction pool has increased substantially. So it really might take awhile, and low fee really might be starved out :(