-
Notifications
You must be signed in to change notification settings - Fork 655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chapter 7, Exercise 4: Confused on the Solution #249
Comments
How can we get fees in there? I've broadcasted the last transaction but it's having difficulty confirming. See this bitcoin testnet transaction: https://live.blockcypher.com/btc-testnet/tx/2946d9b34eb63575898fc881ec0e157154f9afd24ed3d371f83616f097c9043e/ No fees. Would be nice to get them in there. I'll play around with it and post updates here. |
UPDATE: I've been able to resolve the FALSE output. Let's look at the "priv" variable. I changed |
The fees are not explicitly set in a transaction. They must be implicitly set based on this formula: Just reduce the target_amount or change_amount in your code to automatically include a fee. I calculated it by doing this:
This is a rather generous fee. Apparently I overpaid by 912%! |
@alexbarron Thanks so much for sharing this! I'm just about wrapped up with Ch 12 and Ch 13. Once I wrap those up, I'll revisit Ch 4 and implement this again. Cheers! |
Hello all, My code: from ecc import PrivateKey I created secret as Notes: |
@asteryeyo @vvronskyFX
|
i meant the serialized txn length not length of its hash |
some one apparently has 345 tBTC. Looks like you have the wrong index. prev_index has to be a 0 not 1 |
I'm working through this exercise and it's been some time. I want to move forwards to Ch 8 but I really want to get this solution to work.
First thing that stands out here is the the instruction to "Create a testnet transaction that sends 60% of a single UTXO to
mwJn1YPMq7y5F8J3LkC5Hxg9PHyZ5K4cFv
The remaining amount minus fees should go back to your own change address. This should be a one-input, two-output transaction."However, in the solution, the
target_address
is'miKegze5FQNCnGw6PKyqUbYUeBa4x2hFeM'
Next is we need to include a fee in there but I don't see how I can set up a fee.
Next is the fact that we want 60% of the UTXO to be sent to the target address. I just put in a
target_amount
of0.0002
All in all, i get a Hex code but when i run
>>> print(tx_obj.sign_input(0, priv))
I get aFALSE
output.Here's the solution screenshot:
Here's my code within Exercise 4:
I couldn't find any solution online. Has anyone passed this exercise here?
The text was updated successfully, but these errors were encountered: