Bitcoin Forum

Bitcoin => Project Development => Topic started by: jiamijiang on November 21, 2021, 09:07:12 AM



Title: A simple and fun Build Your Own BTC Transaction application.
Post by: jiamijiang on November 21, 2021, 09:07:12 AM
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.


Title: Re: A simple and fun Build Your Own BTC Transaction application.
Post by: SFR10 on November 21, 2021, 03:03:02 PM
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 (https://bitcointalk.org/index.php?topic=5258038.0)".
    - 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] :)


Title: Re: A simple and fun Build Your Own BTC Transaction application.
Post by: BlackHatCoiner on November 21, 2021, 10:01:11 PM
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


Title: Re: A simple and fun Build Your Own BTC Transaction application.
Post by: jiamijiang on November 22, 2021, 02:39:02 AM
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 (https://bitcointalk.org/index.php?topic=5258038.0)".
    - 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] :)

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]


Title: Re: A simple and fun Build Your Own BTC Transaction application.
Post by: BlackHatCoiner on November 22, 2021, 08:14:03 PM
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.


Title: Re: A simple and fun Build Your Own BTC Transaction application.
Post by: jiamijiang on November 23, 2021, 02:57:20 PM
Thanks all for the explanations


Title: Re: A simple and fun Build Your Own BTC Transaction application.
Post by: pooya87 on November 24, 2021, 03:58:59 AM
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.


Title: Re: A simple and fun Build Your Own BTC Transaction application.
Post by: jiamijiang on December 08, 2021, 01:50:56 PM
Thanks for the feedback, I'll look into that.