Bitcoin Forum
December 10, 2019, 09:17:28 AM *
News: Latest Bitcoin Core release: 0.19.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Writing/Running scripts by pressing buttons in a friendly GUI  (Read 162 times)
Coding Enthusiast
Hero Member
*****
Offline Offline

Activity: 711
Merit: 1202


Novice C♯ Coder


View Profile WWW
November 24, 2019, 10:54:52 AM
Merited by ETFbitcoin (8), xandry (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
Donation link using BIP21
Bech32 Donation link!
BitcoinTransactionTool (0.11.0):  Ann - Source Code
Watch Only Bitcoin Wallet (supporting SegWit) (3.1.0):  Ann - Source Code
SharpPusher (broadcast transactions) (0.10.0): Ann - Source Code

1575969448
Hero Member
*
Offline Offline

Posts: 1575969448

View Profile Personal Message (Offline)

Ignore
1575969448
Reply with quote  #2

1575969448
Report to moderator
1575969448
Hero Member
*
Offline Offline

Posts: 1575969448

View Profile Personal Message (Offline)

Ignore
1575969448
Reply with quote  #2

1575969448
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1575969448
Hero Member
*
Offline Offline

Posts: 1575969448

View Profile Personal Message (Offline)

Ignore
1575969448
Reply with quote  #2

1575969448
Report to moderator
1575969448
Hero Member
*
Offline Offline

Posts: 1575969448

View Profile Personal Message (Offline)

Ignore
1575969448
Reply with quote  #2

1575969448
Report to moderator
1575969448
Hero Member
*
Offline Offline

Posts: 1575969448

View Profile Personal Message (Offline)

Ignore
1575969448
Reply with quote  #2

1575969448
Report to moderator
MixMAx123
Jr. Member
*
Offline Offline

Activity: 38
Merit: 15


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
Hero Member
*****
Offline Offline

Activity: 711
Merit: 1202


Novice C♯ Coder


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
Donation link using BIP21
Bech32 Donation link!
BitcoinTransactionTool (0.11.0):  Ann - Source Code
Watch Only Bitcoin Wallet (supporting SegWit) (3.1.0):  Ann - Source Code
SharpPusher (broadcast transactions) (0.10.0): Ann - Source Code

MixMAx123
Jr. Member
*
Offline Offline

Activity: 38
Merit: 15


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

Yes, I mean a compiled version as .exe, or is that unusual?
ETFbitcoin
Legendary
*
Offline Offline

Activity: 1848
Merit: 2123

Use SegWit and enjoy lower fees.


View Profile WWW
November 24, 2019, 06:25:58 PM
 #5

Complied .exe would be great, not everyone would bother install Visual Studio (which size is a bit big) or know how to compile C# source code (even though it's not that difficult).

Coding Enthusiast
Hero Member
*****
Offline Offline

Activity: 711
Merit: 1202


Novice C♯ Coder


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

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
Donation link using BIP21
Bech32 Donation link!
BitcoinTransactionTool (0.11.0):  Ann - Source Code
Watch Only Bitcoin Wallet (supporting SegWit) (3.1.0):  Ann - Source Code
SharpPusher (broadcast transactions) (0.10.0): Ann - Source Code

MixMAx123
Jr. Member
*
Offline Offline

Activity: 38
Merit: 15


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

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
Hero Member
*****
Offline Offline

Activity: 711
Merit: 1202


Novice C♯ Coder


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

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
Donation link using BIP21
Bech32 Donation link!
BitcoinTransactionTool (0.11.0):  Ann - Source Code
Watch Only Bitcoin Wallet (supporting SegWit) (3.1.0):  Ann - Source Code
SharpPusher (broadcast transactions) (0.10.0): Ann - Source Code

ETFbitcoin
Legendary
*
Offline Offline

Activity: 1848
Merit: 2123

Use SegWit and enjoy lower fees.


View Profile WWW
November 27, 2019, 07:07:46 PM
 #9

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 tried it and works without any problem on Windows 10. It doesn't work on Wine (default configuration) though.

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.

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.

Coding Enthusiast
Hero Member
*****
Offline Offline

Activity: 711
Merit: 1202


Novice C♯ Coder


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

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
Donation link using BIP21
Bech32 Donation link!
BitcoinTransactionTool (0.11.0):  Ann - Source Code
Watch Only Bitcoin Wallet (supporting SegWit) (3.1.0):  Ann - Source Code
SharpPusher (broadcast transactions) (0.10.0): Ann - Source Code

TechPriest
Sr. Member
****
Offline Offline

Activity: 376
Merit: 269


CryptoTalk.Org - Get Paid for every Post!


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

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.

 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
CryptoTalk.org| 
MAKE POSTS AND EARN BTC!
🏆
Coding Enthusiast
Hero Member
*****
Offline Offline

Activity: 711
Merit: 1202


Novice C♯ Coder


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

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
Donation link using BIP21
Bech32 Donation link!
BitcoinTransactionTool (0.11.0):  Ann - Source Code
Watch Only Bitcoin Wallet (supporting SegWit) (3.1.0):  Ann - Source Code
SharpPusher (broadcast transactions) (0.10.0): Ann - Source Code

TechPriest
Sr. Member
****
Offline Offline

Activity: 376
Merit: 269


CryptoTalk.Org - Get Paid for every Post!


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

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.

 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
CryptoTalk.org| 
MAKE POSTS AND EARN BTC!
🏆
AltcoinBuilder
Copper Member
Jr. Member
*
Offline Offline

Activity: 71
Merit: 5


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

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

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!