Pages:
Author

Topic: Hashmal - Transaction Script IDE (alpha) (Read 9137 times)

member
Activity: 64
Merit: 20
January 06, 2016, 12:22:25 PM
#29
By inclusion I just ment on how the entire path from op_code creation to block inclusion by a miner would look. But I guess there also needs to be a limit to how much you can keep expanding it, without ending up with a full copy of Bitcoin Smiley

Yeah, I see what you mean.

OP_CHECKLOCKTIMEVERIFY is implemented for the Clams blockchain in branch develop. It will take a little more effort to get it implemented for Bitcoin. The way I've implemented it is such that you can specify data about the block that a script is in via a new tab, "Block", of the Stack Evaluator. In the following screenshot, I've set "Block height" to 800000.

sr. member
Activity: 381
Merit: 255
December 31, 2015, 10:24:07 AM
#28
By inclusion I just ment on how the entire path from op_code creation to block inclusion by a miner would look. But I guess there also needs to be a limit to how much you can keep expanding it, without ending up with a full copy of Bitcoin Smiley
member
Activity: 64
Merit: 20
December 30, 2015, 11:17:37 PM
#27
There is a similar tool written in Javascript for Forth here: http://skilldrick.github.io/easyforth/

What would be interesting you implement is a mock miner that can be configured. This way we can test the more exotic op_codes and understand how they would behave from a inclusion point of view in the blocks. Do you have support for BIP65 already?

Seems pretty cool. About the mock miner: That could potentially be a useful plugin. I'm not sure exactly what you mean by an "inclusion point of view" though.

BIP65 support isn't implemented. I've been putting it off in hopes that somebody else would implement it in python-bitcoinlib. Tongue But the underlying script evaluation API in python-bitcoinlib will take some changes to support including block height and/or block time in the evaluation, so I guess other people have the same idea that I do. Ultimately I'll implement it regardless, since I need to put in a way to override opcode behavior based on what chainparams are active. For example, a blockchain like CLAMS uses a different CHECKLOCKTIMEVERIFY implementation than Bitcoin does.
sr. member
Activity: 381
Merit: 255
December 30, 2015, 06:47:23 AM
#26
There is a similar tool written in Javascript for Forth here: http://skilldrick.github.io/easyforth/

What would be interesting you implement is a mock miner that can be configured. This way we can test the more exotic op_codes and understand how they would behave from a inclusion point of view in the blocks. Do you have support for BIP65 already?
member
Activity: 64
Merit: 20
December 29, 2015, 12:10:22 PM
#25
Alright, so I've done a lot on Hashmal since I last posted here. It really grew from a "Transaction Script IDE" to a full-fledged toolbox for cryptocurrency development. You can deserialize transactions/blocks, encode/decode addresses, etc. There's an entire plugin system. I've tried to keep the Github Wiki up-to-date with the all the plugins that Hashmal comes with.

Here's a short list of what the new plugins that Hashmal includes do:
  • Deserialize transactions/blocks
  • Encode/Decode addresses
  • Retrieve blockchain data from block explorers or via RPC
  • Create transactions from scratch

I'm currently working on a large refactor of the Stack Evaluator. Here is how it looks now (apologies for the big image):



The issue I'm currently dealing with is displaying the contents of an inner script (as in Pay-To-Script-Hash scriptSigs) in human-readable form. When I have issues like that solved, I'll merge it into the master branch.

--
edit: For your viewing pleasure, here are a couple of examples with the latest changes:

7 7 7:



string literal:

member
Activity: 64
Merit: 20
September 23, 2015, 01:57:26 PM
#24
I am also getting an error on osx 10.10

Traceback (most recent call last):
  File "./hashmal", line 17, in
    gui.main()
  File "/Users/bbuenz/Programmierung/CryptoWorkspace/hashmal/hashmal_lib/__init__.py", line 14, in main
    self.main_window = HashmalMain(self.app)
  File "/Users/bbuenz/Programmierung/CryptoWorkspace/hashmal/hashmal_lib/main_window.py", line 38, in __init__
    self.dock_handler.do_default_layout()
  File "/Users/bbuenz/Programmierung/CryptoWorkspace/hashmal/hashmal_lib/dock_handler.py", line 90, in do_default_layout
    self.dock_widgets['Variables'].setVisible(True)
KeyError: 'Variables'

Did you run setup.py?
newbie
Activity: 5
Merit: 0
September 21, 2015, 07:22:52 PM
#23
I am also getting an error on osx 10.10

Traceback (most recent call last):
  File "./hashmal", line 17, in
    gui.main()
  File "/Users/bbuenz/Programmierung/CryptoWorkspace/hashmal/hashmal_lib/__init__.py", line 14, in main
    self.main_window = HashmalMain(self.app)
  File "/Users/bbuenz/Programmierung/CryptoWorkspace/hashmal/hashmal_lib/main_window.py", line 38, in __init__
    self.dock_handler.do_default_layout()
  File "/Users/bbuenz/Programmierung/CryptoWorkspace/hashmal/hashmal_lib/dock_handler.py", line 90, in do_default_layout
    self.dock_widgets['Variables'].setVisible(True)
KeyError: 'Variables'
member
Activity: 64
Merit: 20
September 19, 2015, 09:02:14 AM
#22
Alright, there's now a plugin system. I'm looking for ideas for plugins, so if you have any, please post them. Note that plugin basically refers to one or more tools in the form of dock widgets, which are detachable widgets. The purpose of plugins is to provide extra functionality when you have a certain requirement installed.

The proof-of-concept plugin that I'm working on is Pycoin, which provides a GUI for pycoin.

Also, there's a "chainparams" system that allows you to specify the format of transactions. For example, in Peercoin and its forks, transactions have a timestamp field after their version field. By selecting the Peercoin chainparams preset, you can deserialize Peercoin transactions, and even set the timestamp for a transaction in the Transaction Builder tool.

Anyway, ideas for useful plugins are welcome! Smiley
member
Activity: 64
Merit: 20
September 05, 2015, 02:11:48 PM
#21
Getting closer to a real 0.2.0a release. I've written about and uploaded screenshots of tools on the Github Wiki.

There won't be a changelog until after 0.2.0a since so many things are changing. Here are some key recent changes:

  • Variables can be substituted into a transaction (see Variables tool documentation on Github wiki).
  • Variables can be saved to the config file.
  • Some stack log messages are now better (e.g. grammatically improved).

If you'd like to try Hashmal but don't know where you would start, check out the Example Scripts page.
member
Activity: 64
Merit: 20
September 04, 2015, 02:15:55 PM
#20
I'm having difficulty getting it to run. Here's what I'm getting after installing from git on OSX Yosemite.

Code:
$ hashmal
Traceback (most recent call last):
  File "/usr/local/bin/hashmal", line 13, in
    import hashmal_lib
  File "/usr/local/lib/python2.7/site-packages/hashmal_lib/__init__.py", line 5, in
    from main_window import HashmalMain
  File "/usr/local/lib/python2.7/site-packages/hashmal_lib/main_window.py", line 8, in
    from dock_handler import DockHandler
  File "/usr/local/lib/python2.7/site-packages/hashmal_lib/dock_handler.py", line 4, in
    from docks.addr_encoder import AddrEncoder
  File "/usr/local/lib/python2.7/site-packages/hashmal_lib/docks/__init__.py", line 6, in
    import tx_deserializer
ImportError: No module named tx_deserializer

My bad. I hadn't included that file in the list of modules in setup.py. Fixed now.
hero member
Activity: 496
Merit: 500
September 04, 2015, 01:59:02 PM
#19
I'm having difficulty getting it to run. Here's what I'm getting after installing from git on OSX Yosemite.

Code:
$ hashmal
Traceback (most recent call last):
  File "/usr/local/bin/hashmal", line 13, in
    import hashmal_lib
  File "/usr/local/lib/python2.7/site-packages/hashmal_lib/__init__.py", line 5, in
    from main_window import HashmalMain
  File "/usr/local/lib/python2.7/site-packages/hashmal_lib/main_window.py", line 8, in
    from dock_handler import DockHandler
  File "/usr/local/lib/python2.7/site-packages/hashmal_lib/dock_handler.py", line 4, in
    from docks.addr_encoder import AddrEncoder
  File "/usr/local/lib/python2.7/site-packages/hashmal_lib/docks/__init__.py", line 6, in
    import tx_deserializer
ImportError: No module named tx_deserializer
member
Activity: 64
Merit: 20
September 03, 2015, 08:05:35 PM
#18
Any chance of porting this to Javascript?

Not really, no. The whole thing was designed with Python in mind.

Anyway, there are now some basic usage docs here. I've also put in a basic Transaction Deserializer tool which can be upgraded with the functionality talked about earlier in the thread at a later time.

The most significant update is that you can now specify a "spending transaction" in the Stack Evaluator, and select one of its inputs. That input's scriptSig will be pushed to the stack before your script starts. "OP_CHECKSIG" and "OP_CHECKSIGVERIFY" should work now.

Pretty soon I'll have to start incrementing the version number and providing changelogs.
sr. member
Activity: 287
Merit: 250
September 03, 2015, 04:03:17 PM
#17
Any chance of porting this to Javascript?
member
Activity: 64
Merit: 20
September 03, 2015, 01:46:05 PM
#16
Thanks for the feedback. Repo transferred to its new home. We're now in #hashmal on freenode.
legendary
Activity: 1484
Merit: 1007
spreadcoin.info
September 03, 2015, 11:40:26 AM
#15
exactly the tool I need right now. Thanks!
donator
Activity: 2352
Merit: 1060
between a rock and a block!
September 03, 2015, 10:24:25 AM
#14
Great tool!! It's very useful, wish it was made sooner Smiley
member
Activity: 64
Merit: 20
September 03, 2015, 06:34:46 AM
#13
Very nice, thank you!

Should there be a list of the Python dependencies somewhere, like a requirements file?


Yeah, there's a requirements.txt now.

Python isn't so bad at all, Electrum is also written in Python and works. ;-) However the Windows version of Electrum is nicely compiled to the one executable file. Do you plan the same?

When it's a little more mature, definitely.
hero member
Activity: 734
Merit: 507
September 03, 2015, 05:58:48 AM
#12
Python isn't so bad at all, Electrum is also written in Python and works. ;-) However the Windows version of Electrum is nicely compiled to the one executable file. Do you plan the same?
sr. member
Activity: 294
Merit: 260
September 03, 2015, 05:06:16 AM
#11
Very nice, thank you!

Should there be a list of the Python dependencies somewhere, like a requirements file?
newbie
Activity: 21
Merit: 0
September 03, 2015, 04:47:00 AM
#10
Wow. Pretty awesome contribution op.

If this were only available 2 years go... Damn Cheesy
Pages:
Jump to: