Bitcoin Forum
May 01, 2024, 03:17:04 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Writing/Running scripts by pressing buttons in a friendly GUI  (Read 304 times)
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
November 24, 2019, 10:54:52 AM
Merited by ABCbits (11), xandry (5), NotATether (5), Heisenberg_Hunter (2), nc50lc (1), o_e_l_e_o (1), TechPriest (1)
 #1

I'm always a fan of simplifying things and building GUIs and ever since I saw the Miniscript project I wanted to make that happen. Since I recently resumed working on one of my oldest projects (Bitcoin Transaction Tool) I decided to add it as a new feature to that project, for writing and running scripts at the same time.

It can be found under Tools > Script builder (or press F3). It currently supports all OP codes except the disabled ones (for obvious reasons) and *checksig OPs (since to support them I had to copy about 6000 lines of code into this project) and 2 locktime related OPs and CodeSeparator (because I haven't had time to understand how they work!). OPs are also categorized and can be filtered by using the ComboBox on top for ease of finding them.
Writing the script will also run it, the result of it is shown in a text box and the "box" at the bottom right is a list representing the "stack".

I plan on working on it and add more more features such as adding pre-defined script that only need filling up the data part. But before that I wanted to get some feedback about what you think about something like this, how can I improve it,...

Here is a preview:

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
1714576624
Hero Member
*
Offline Offline

Posts: 1714576624

View Profile Personal Message (Offline)

Ignore
1714576624
Reply with quote  #2

1714576624
Report to moderator
1714576624
Hero Member
*
Offline Offline

Posts: 1714576624

View Profile Personal Message (Offline)

Ignore
1714576624
Reply with quote  #2

1714576624
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
MixMAx123
Full Member
***
Offline Offline

Activity: 161
Merit: 168


View Profile
November 24, 2019, 11:38:44 AM
 #2

That can be very useful. I will test it as soon as it gets published.
What are the "obvious" reasons for disabling some scripts?
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
November 24, 2019, 11:46:04 AM
 #3

That can be very useful. I will test it as soon as it gets published.
It is already on GitHub https://github.com/Coding-Enthusiast/BitcoinTransactionTool
Do you mean publishing the compiled binaries?

Quote
What are the "obvious" reasons for disabling some scripts?
You have to look at the buttons that are disabled for it to become obvious. These are a bunch of OP codes (such as OP_CAT, OP_Multiply,...) that were removed/disabled a long time ago. Since their names still exist in the source code and documentation, I also have them here as disabled buttons.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
MixMAx123
Full Member
***
Offline Offline

Activity: 161
Merit: 168


View Profile
November 24, 2019, 11:53:41 AM
 #4

Yes, I mean a compiled version as .exe, or is that unusual?
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
November 25, 2019, 04:06:15 AM
 #5

One should not really download and run .exe and since until now nobody had requested compiled version I've never thought about it. In any case I published it using ClickOnce, more info can be found here: https://github.com/Coding-Enthusiast/BitcoinTransactionTool/releases/tag/0.10.0.0

I've tried migrating to Avalonia (a multi platform GUI) but it lacks a lot of functionality specially when it comes to lists, so for the time being this project will remain only for windows. I'll try looking into other alternatives to migrate to .net core entirely which would make publishing and compiling easier too.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
MixMAx123
Full Member
***
Offline Offline

Activity: 161
Merit: 168


View Profile
November 25, 2019, 09:50:00 PM
 #6

I created a Tx with it:

"0100000001902dbe4ae9a20b85f53cb6813396e6aae272ee4e3b699e8c2498d2ce8f5833ee00000 00000ffffffff01c0270900000000001976a91415dee4a950952a3a5aa198543e37d310b6b7402f 88ac00000000"

Just how do I get the now signed?

No, I hope you understand the joke :-)

I played around with it. Works very well.
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
November 26, 2019, 07:39:12 AM
 #7

No, I hope you understand the joke :-)
I played around with it. Works very well.

Of course I recognize my own UTXO anywhere!
Try checking the script window and play around with that too and let me know what you think. I'll try to add more to it this week.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
November 28, 2019, 08:55:37 AM
Merited by ABCbits (1)
 #8

I tried it and works without any problem on Windows 10. It doesn't work on Wine (default configuration) though.
I did some search and it seems like Wine has some known bugs related to WPF (GUI that is used in this project). I won't spend any time on fixing this because there is a much better way of solving the issue and that would be using a cross-platform GUI so that you don't need Wine, you simply run it as you run any other application in another OS (Windows, Linux, Mac,...).
Currently there are a couple of them that I'm aware of. The one that I feel comfortable with (also used by Wsabi wallet) is called Avalonia, but since it is in beta, it lacks a lot of functionality or to do certain things you have to bend over backwards (like the grid-like lists where you enter addresses and the list containing UTXOs with categorization and headers).
The migration is in my "roadmap" which would make it easy to run it under any other OS without needing anything else. Meanwhile if someone is familiar with Xaml and Avalonia feel free to contribute...

I've heard https://www.monodevelop.com/ allows you to create/port C# and .NET software into multiple OS.
You probably already know about it though.
That is an IDE (development environment, ie. where you write code and compile), what is needed here is a GUI that is a graphical user interface that doesn't require windows APIs (like WPF does) to run.


I've released a new version and added description to each button in script writer window explaining what they do. Also the QR window now lets you choose the encoding you want to use (eg. Electrum uses Base43 to encode raw unsigned transactions).
https://github.com/Coding-Enthusiast/BitcoinTransactionTool/releases/tag/0.10.1.0

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
TechPriest
Sr. Member
****
Offline Offline

Activity: 377
Merit: 282


Finis coronat opus


View Profile
November 29, 2019, 10:12:02 AM
 #9

Quote
What are the "obvious" reasons for disabling some scripts?
You have to look at the buttons that are disabled for it to become obvious. These are a bunch of OP codes (such as OP_CAT, OP_Multiply,...) that were removed/disabled a long time ago. Since their names still exist in the source code and documentation, I also have them here as disabled buttons.

Hello, and why is disabled OP_CHECKLOCKTIMEVERIFY and OP_CHECKSEQUENCEVERIFY? The second one is very useful for creating bitcoin-testament smart conract, for example.
I will be appreciated for your answer.

In science we trust!
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
November 29, 2019, 12:38:23 PM
 #10

Hello, and why is disabled OP_CHECKLOCKTIMEVERIFY and OP_CHECKSEQUENCEVERIFY? The second one is very useful for creating bitcoin-testament smart conract, for example.

It is because I am not sure how to implement these two as an IOperation. In the near future I will add these OPs and also eventually will release my Cryptocurrency.Net library which would also mean additional features including signing, verification and communication with nodes.

In this topic I was hoping for some ideas on how to improve the user interface. For instance how would you like to create such smart contracts?

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
TechPriest
Sr. Member
****
Offline Offline

Activity: 377
Merit: 282


Finis coronat opus


View Profile
November 29, 2019, 01:39:56 PM
 #11

Hello, and why is disabled OP_CHECKLOCKTIMEVERIFY and OP_CHECKSEQUENCEVERIFY? The second one is very useful for creating bitcoin-testament smart conract, for example.

It is because I am not sure how to implement these two as an IOperation.

Understood. Maybe it will be enough to ad them and they will return only "true" doesn't matter what block height or time have been pushed to stack?

It's sound logical, for me.

User interface is enough friendly, at least for me.

In science we trust!
AltcoinBuilder
Copper Member
Jr. Member
*
Offline Offline

Activity: 85
Merit: 5


View Profile WWW
November 30, 2019, 10:25:34 AM
 #12

I'm always a fan of simplifying things and building GUIs and ever since I saw the Miniscript project I wanted to make that happen. Since I recently resumed working on one of my oldest projects (Bitcoin Transaction Tool) I decided to add it as a new feature to that project, for writing and running scripts at the same time.

It can be found under Tools > Script builder (or press F3). It currently supports all OP codes except the disabled ones (for obvious reasons) and *checksig OPs (since to support them I had to copy about 6000 lines of code into this project) and 2 locktime related OPs and CodeSeparator (because I haven't had time to understand how they work!). OPs are also categorized and can be filtered by using the ComboBox on top for ease of finding them.
Writing the script will also run it, the result of it is shown in a text box and the "box" at the bottom right is a list representing the "stack".

I plan on working on it and add more more features such as adding pre-defined script that only need filling up the data part. But before that I wanted to get some feedback about what you think about something like this, how can I improve it,...

Here is a preview:

nice. I suggest you use dropdown and a RUN button for OP section  Smiley
MixMAx123
Full Member
***
Offline Offline

Activity: 161
Merit: 168


View Profile
October 01, 2021, 08:36:07 PM
 #13

Your tool is great. I work with it :-)
Please, please, I urgently need it in the testnet!
In the test network you work much more with such things.
It would be great, if it would go in the testnet too.
NotATether
Legendary
*
Offline Offline

Activity: 1582
Merit: 6718


bitcoincleanup.com / bitmixlist.org


View Profile WWW
October 02, 2021, 08:08:39 AM
Merited by Coding Enthusiast (1)
 #14

I did some search and it seems like Wine has some known bugs related to WPF (GUI that is used in this project). I won't spend any time on fixing this because there is a much better way of solving the issue and that would be using a cross-platform GUI so that you don't need Wine, you simply run it as you run any other application in another OS (Windows, Linux, Mac,...).

I can port this to Electron/NodeJS where it will run on any platform without the need for emulators (like Wine) or VMs. The best part is I can even deploy it as a web app.

^^ yes I see the thread creation date.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
October 02, 2021, 10:45:40 AM
 #15

I can port this to Electron/NodeJS where it will run on any platform without the need for emulators (like Wine) or VMs. The best part is I can even deploy it as a web app.
This project is old and kind of obsolete, so I never got around to fixing its bugs and adding the missing parts. However migration of this project is one of those items in my very long to-do list. I recently finished the transaction verification part but haven't started working on the "script playground" part. The migration fixes the bugs and will cover every script that exists in Bitcoin protocol and the software can run on any operating system.
Here is an issue to track this #2.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
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!