Just trying to dig into this a bit. This has never happened to me, but I'm thinking about potential worst-case situations. So, if there’s a power cut right after hitting send in Trezor/Suite or Electrum, what's the deal? Can a transaction get messed up to the point where funds get stuck, or even worse, end up in the wrong spot? By stuck, I mean not just a little delay, but completely frozen? I mean, even though I always use a laptop, the router might lose power at the worst possible moment. Just curious about this.
I’d really appreciate any insights or links related to this issue.
Signing happens first, then broadcasting happens next. If your device creates an invalid transaction, then nothing happens in the event that it gets broadcasted.
I suppose it's possible your software fails to recognize you spent coins and reuses the change address in a future transaction? That doesn't seem like a really big deal though.
Is this after you confirmed in Trezor device after using "Review and Send" (in Trezor Suite) or "Pay..." (in Electrum) or not?
Because you're talking about two clients with different button names for "Send".
If before accepting it in the hardware device itself: it wont, Electrum or Trezor suite will just create an "unsigned transaction", it's useless without a signature by your Trezor it can't be broadcasted.
Specifically on Electrum, your available UTXO to spend (shown as "balance") will only be affected by it if you've accidentally clicked "Add to history" which will save it to your txn history locally, it can easily be removed via "remove" right-click menu just in case.
If after: In this case it's able to create a signed raw transaction, but it will not be broadcasted to their node since the connection is cut before it even get broadcasted.
Or since you said "after clicking send", if it made it through before the power failure since it usually takes less than a second to broadcast, it'll be sent like usual.
You don't have to keep the client open for it to get mined once broadcasted.
Ignoring the GUI workflow, there's just two possibilities: (a) Power failure before the transaction is successfully broadcast or (b) power failure after.
In case of (a) the transaction fails, the coins stay where they are. Everything is ok.
In case of (b) the transaction succeeds, will be propagated by the other nodes, eventually mined, coins moved as intended. Everything is ok.
There are edge cases where the power may fail exactly the moment the broadcast happens, down to the millisecond, causing packet loss, but that would just result in (a).
Maybe, but I believe most wallets rely on the state of the Blockchain rather than some local meta-state.
Though now that you mention it, there are cases where OPs scenario may result in loss of coins: When using non-HD wallets like with old versions of Bitcoin Core, there might be edge cases where the private key of the change address may fall victim to data loss due to the power failure.
If an interruption occurs in the middle of this transmission, the packets that have not been sent will not reach their destination. As a result, the transaction will not be registered on the blockchain because the packet must meet a standard, and if they are incomplete, it will fail, and the funds will not move from your wallet. This is not the same as a corrupt transaction due to poor implementations, which might pass the network's validation but could result in the loss of funds.
I was once doing a firmware upgrade on a hardware wallet when I lost internet access in the middle of the process, but miraculously nothing bad happened, the process continued when the connection was reestablished. I know it's not the same as what the OP is asking about, but as others have already written, nothing bad will happen if we run out of internet/electricity in the process of signing/sending the transaction - in my opinion, anyone who uses a laptop can ensure that they always have a charged battery in it, and that they have mobile internet on their mobile phone that they can connect to in case of need.
If a device has both internet connection and private keys, it would be able to both sign and broadcast a transaction on that device. Basically creating a transaction , signing it with your keys and then broadcasting it relatively happens simultaneously that's if we consider the couple of seconds it takes for each of them to happen.
Basically if the transaction was created before the black out, it's possible that when you get back online your device may still render the signed transaction valid else nothing happens.
Basically coins only leave your wallet not only when a transaction is broadcasted but when the broadcasted transaction has been confirmed.
Guys I really appreciate the responses to what I hope never happens to any of us. I have spent almost all of my "bitcoin life" for the past ten years on a laptop. In the past year I upgraded to a high end desktop but it doesn't have a battery like my laptops did. I was picturing clicking SEND on a Trezor, after reviewing the transaction, addresses, etc.... are all good to go ---- BUT then at that instant the power goes dark!
I only use HD wallets or T Suite for BTC movements. Mainly Electrum with my Trezors. As I suspected it appears even in that instance that I would eventually be whole, if not instantly upon power return. I don't know what makes me think of such things, but in reality it could happen!! Thanks for the consideration of my question!!
Can you make this clear which one exactly has an issue with immediate power failure is that the Trezor device, or are you talking about your desktop PC?
If it's in your PC, it looks like a driver issue if that's the case, I think you need to uninstall the current Trezor driver and use Zadig software to install a driver for your Trezor.
The guide how to install it can be found here: Trezor Suite doesnt see my device
Or if the issue occurs on the Trezor device itself? then possible it's a program issue try to update it's firmware first if not you might need to reflash it's firmware but this is a bit risky if you do this in a wrong way it may bricked. Check the guide below if it's a trezor one model.
- https://github.com/trezor/trezor-firmware/blob/main/docs/legacy/index.md
do your self a favor and buy this
https://www.amazon.com/dp/B0D5QSYK69?
or this one
https://www.amazon.com/GOLDENMATE-600W-Protector-Lifespan-8-Outlets/dp/B0D5QTQKDQ?
problem solved
plug the router the pc and the monitor in to it.
think of the aggravation you will save
So it was the "If after" scenario in my previous reply.
In that case, it'll either be "sent" or "not sent", not something in between where it'll go on a limbo.
In case of "not sent", even if you've saved it to the client locally on Electrum, you can simply remove it since the whole Bitcoin network doesn't know your non-broadcasted transaction.
In Trezor Suite, you can reset the app in case something like that happened (it wont), your keys are safe in your Trezor Device even if the client is reset.
If i understood you correctly, i guess you're talking about hypothetical scenario where electricity outage affect your home/apartment where you use Trezor Model T. In that case, the transaction probably won't be broadcasted since it may take few hundred millseconds or more for Trezor Model T to sign your transaction and other node/server receive your signed transaction.
Given that you only use HD wallets there's no loss of coins to worry about for the scenario that you described, since there's no limbo state, as nc50lc put it. The coins will either remain on your wallet, or be sent to the receiver, no inbetween.
It is definitely worth it for those who do their work on desktop computers, because if you are doing something very important and lose all that work due to a power outage, you will lose a lot of time and nerves to make up for it. I used to have a laptop that had a removable battery and I used to take it out and keep the computer directly on the power supply, but the model I'm using now has a built-in battery and I think that's better because it means it won't turn off just like that.
I agree that some things should be invested in, no matter how expensive and perhaps unnecessary they may seem at one point, they can very well pay off in just one moment.
I ran a universal power supply for a few years back in the day. That would be a nice addition to my system! I backup my backups but still sometimes I am performing a large file transfer or write between drives and a crash during the operation would suck. Nothing I can't recover from just a general suck!!
This of course is a learning thread for the "just in case" should such an event happen. Never has so far.
In the area where I live we get 3-5 times a year the electricity in the neighborhood flashes on and off for about 30 seconds, mostly about 10 seconds tops. Not too often but it happens. I have lived here for over a decade and never has the power been out for more than an hour. So yes a power backup would make sense and I will attend to that in the next two months. Power supplies also have the added benefit of "smoothing out" the electrical current source going to the computers and stuff. A power supply that would run my computer and router for 10-15 minutes is all I need. I will likely get a bigger one just saying! During that time I could easily perform a safe shutdown of anything critical. Good ideas. Thanks all.
Transaction processing is atomic. There is no such thing as a failed transaction because of a power failure. Either nodes have received your broadcast transaction, or they haven't. In any case, once you turn on the machine again and open your watch-only wallet on Electrum, you should be able to see the latest transaction history including whether or not the transaction was broadcast.
power failure most likely has 1 big risk if you are doing a firmware update and power goes out sometimes you get a bricked piece of gear.
I lost 1 printer that way.
I lost 2 mining control boards that way.
As for a transaction to vanish maybe it could be lost. But more likely if you were on say Binance sending it or coinbase sending it.
Not from a trezor or your own pc.
As the software interface is partially closed and unknown as it belongs to the exchange.