Bitcoin Forum
May 11, 2024, 02:44:18 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: A simple and fun Build Your Own BTC Transaction application.  (Read 172 times)
jiamijiang (OP)
Jr. Member
*
Offline Offline

Activity: 36
Merit: 27


View Profile
November 21, 2021, 09:07:12 AM
Merited by o_e_l_e_o (4), ABCbits (3), SFR10 (2), FatFork (1)
 #1

I patched together a fun application tool that serves as an educational tool for users and newcomers to understand some of the mechanics behind a bitcoin transaction. These days, bitcoin transactions are sent via a simple click of a ‘send’ button in a wallet software app. To “build” one’s own transaction, one can go a layer down from merely clicking a “send” button.

Access the Build It Yourself Bitcoin Transaction application below:

https://build-it-yourself-bitcoin.herokuapp.com/

*If you are viewing the application on a small screen, it is suggested to zoom out in the browser for better viewing experience. This responsive design is part of the future improvement considerations listed below.

The application guides a user through some simple steps on building and broadcasting out a transaction.

It’s meant to be educational, informative, simple, and fun.

Some notes to point out before starting:

1.A proper security audit has not been ran on this application, therefore it is highly advised you use a private/public key pair that you do not intend to use in the future.
2.Due to the above’s recommendation for a private/public key one-time-use, this application will only accept 1 TXIN and 1 TXOUT output transaction. In other words, 1 UTXO in and 1 UTXO out. No change address option is provided.
3.This will only support P2PKH and P2WPKH transactions.
4.If you would like to create some private/public key pairs to use during the process, you can create your own at www.rawbitcoinkeys.com (this is another educational tool that teaches how a basic legacy (P2PKH) bitcoin address is made from a private key).

If you would like to improve this tool, feel free to add a pull request to the repository here:

https://github.com/jiamijiang/build-it-yourself-bitcoin

To view some screenshots of the application, check out this link below:

https://medium.com/tuoyuanresearch/build-your-own-bitcoin-transaction-8eb6f0117d2a

Hopefully this application can help you learn some of the nuts and bolts behind a bitcoin transaction. Because you never know, one of these days, you might need to send out bitcoin transactions the raw way.
1715395458
Hero Member
*
Offline Offline

Posts: 1715395458

View Profile Personal Message (Offline)

Ignore
1715395458
Reply with quote  #2

1715395458
Report to moderator
1715395458
Hero Member
*
Offline Offline

Posts: 1715395458

View Profile Personal Message (Offline)

Ignore
1715395458
Reply with quote  #2

1715395458
Report to moderator
Bitcoin addresses contain a checksum, so it is very unlikely that mistyping an address will cause you to lose money.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715395458
Hero Member
*
Offline Offline

Posts: 1715395458

View Profile Personal Message (Offline)

Ignore
1715395458
Reply with quote  #2

1715395458
Report to moderator
SFR10
Legendary
*
Offline Offline

Activity: 2996
Merit: 3427


Crypto Swap Exchange


View Profile WWW
November 21, 2021, 03:03:02 PM
 #2

an educational tool for users and newcomers to understand some of the mechanics behind a bitcoin transaction.
I've also partially tested some of the steps and since you're mostly targeting newcomers, then you might want to translate/explain some of the words from the "read more pop-up windows" even further.

A couple of suggestions:

  • It'd be better if you could add decimal points to the values [it's a bit weird in its current state].
  • Since one of the APIs that you're using is for Blockchain.com [FKA .info], then perhaps you could redesign the UTXO page and display them like how "they used to do it before".
    - A simple separation line between each of the UTXO fields would probably do the trick as well.

Bookmarked [I'm impressed with both of your tools] Smiley

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1512
Merit: 7360


Farewell, Leo


View Profile
November 21, 2021, 10:01:11 PM
Last edit: November 22, 2021, 12:13:31 PM by BlackHatCoiner
Merited by pooya87 (2), ABCbits (1)
 #3

I also tested it out. If it's going to be simple, remove this fancy styling; it makes it look complex and in my opinion, it doesn't add anything. It may just be me, but I like to get the least css if I'm going to do a serious procedure. Carefully decorated pages about bitcoin or cryptocurrencies remind me of frauds & shitty-tokenization.

Also, it seems that I've found a bug. You can't insert burning addresses[1], possibly due to less characters. It's probably reading the addresses improperly.



[1] 1111111111111111111114oLvT2

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
jiamijiang (OP)
Jr. Member
*
Offline Offline

Activity: 36
Merit: 27


View Profile
November 22, 2021, 02:39:02 AM
Last edit: February 14, 2022, 01:45:49 PM by mprep
 #4

I checked it for a bit (until part where private key is needed) and it's cool tool. Do you have any plan to support testnet?

This is a good idea. I could add this to my list of future improvements. And testnet transactions would also make people feel safer inputting their private key.

And in general for those who were wondering, I null out the private key value after having it sign the transaction. Again, there might be other security mechanisms that I am unaware of.



an educational tool for users and newcomers to understand some of the mechanics behind a bitcoin transaction.
I've also partially tested some of the steps and since you're mostly targeting newcomers, then you might want to translate/explain some of the words from the "read more pop-up windows" even further.

A couple of suggestions:

  • It'd be better if you could add decimal points to the values [it's a bit weird in its current state].
  • Since one of the APIs that you're using is for Blockchain.com [FKA .info], then perhaps you could redesign the UTXO page and display them like how "they used to do it before".
    - A simple separation line between each of the UTXO fields would probably do the trick as well.

Bookmarked [I'm impressed with both of your tools] Smiley

Agreed. I think I could've also added in a bit more explanatory pop-up windows that guide the user through every step live.

Thanks for bookmarking!



I also tested it out. If it's going to be simple, remove this fancy styling; it makes it look complex and in my opinion, it doesn't add anything. It may just be me, but I like to get the least css if I'm going to do a serious procedure. Carefully decorates pages about bitcoin or cryptocurrencies remind me of frauds & shitty-tokenization.

Also, it seems that I've found a bug. You can't insert burning addresses[1], possibly due to less characters. It's probably reading the addresses improperly.



[1] 1111111111111111111114oLvT2

Noted. Perhaps I should go for a more modern, minimalist look next time.

In regards to burn addresses, are burn addresses the same as normal addresses in terms of format and creation? All I know of burn addresses is that they are used to "burn" bitcoins because noone has the private keys associated to that burn address.

[moderator's note: consecutive posts merged]
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1512
Merit: 7360


Farewell, Leo


View Profile
November 22, 2021, 08:14:03 PM
 #5

are burn addresses the same as normal addresses in terms of format and creation?
Burning addresses are normal addresses, but no one ever hashed a public key to get the final result. They just wrote it themselves. For instance, the above address' 160 bit hash is - 0000000000000000000000000000000000000000. No one knows the public key that once hashed with SHA256 and RIPEMD-160 gives this as a message digest, but it's indeed a valid address.

Any address' hash between - 0000000000000000000000000000000000000000 - and - ffffffffffffffffffffffffffffffffffffffff - is valid.



As for the address detection, I'll just quote myself;
So, to be able to detect an address, you have to decode it and check if it has the above requirements; if the twice hashed prefix along with the next 40 hexadecimal characters begin with the last 4 bytes of the decoded address.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
jiamijiang (OP)
Jr. Member
*
Offline Offline

Activity: 36
Merit: 27


View Profile
November 23, 2021, 02:57:20 PM
 #6

Thanks all for the explanations
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
November 24, 2021, 03:58:59 AM
 #7

Noted. Perhaps I should go for a more modern, minimalist look next time.

In regards to burn addresses, are burn addresses the same as normal addresses in terms of format and creation? All I know of burn addresses is that they are used to "burn" bitcoins because noone has the private keys associated to that burn address.
This is not about special/burn addresses. It is all about your wrong check here:
https://github.com/jiamijiang/build-it-yourself-bitcoin/blob/c15413b74b8d03629fc05a8ffc9fedad184e2d71/views/home.ejs#L49
This is not how you validate bitcoin transactions. You could do some initial first letter check but the actual check for validity must be done through decoding.
Basically you base58 or bech32 decode the string and if it was decoded successfully and the data had the appropriate length you say that it is a valid address.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
jiamijiang (OP)
Jr. Member
*
Offline Offline

Activity: 36
Merit: 27


View Profile
December 08, 2021, 01:50:56 PM
 #8

Thanks for the feedback, I'll look into that.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!