Code Monkey home page Code Monkey logo

bitcoinide's People

Contributors

adamjimenez avatar buildersbrewery avatar c9developer avatar cadorn avatar dangoor avatar danyapostfactum avatar dfelder avatar fjakobs avatar gjtorikian avatar gozala avatar h3rb avatar janjongboom avatar jcheng5 avatar joewalker avatar jviereck avatar lennartcl avatar matthewkastor avatar mattpardee avatar mihaisucan avatar mikedeboer avatar mostafaeweda avatar nightwing avatar rgriffith avatar rksm avatar sergi avatar siminchen avatar stephentangcook avatar wcandillon avatar yotamsagiv avatar zefhemel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitcoinide's Issues

Stack visualizer

A library that supports two functions: push and pop. It is supposed to display the stack onto the page.

Tab Autocompletion

Added snippets to script-snippets, but given Ace's extremely sensitive tab completion...

Snippets currently consist of:
commands with OP_ removed (upper and lower case)
first three letters of substring after OP_ (if they are unique)
Symbols for arithmetic (+, /, etc)

OP_NOTIF without OP_IF marked invalid

E.g.:

OP_1 OP_NOTIF OP_3 OP_ENDIF

is marked as invalid, but I think it is allowed, e.g. with btcdeb:

./btcdeb '[OP_1 OP_NOTIF OP_3 OP_ENDIF]'

seems valid.

WIth OP_IF it is valid in both this project and btcdeb:

OP_1 OP_IF OP_2 OP_NOTIF OP_3 OP_ENDIF

OP_SIZE not working

Example script: aa OP_SIZE 1 OP_EQUAL seems to reset after executing OP_SIZE instead of pushing 1 to the stack. Similarly aaaa OP_SIZE 1 OP_EQUAL does not report script failure, it just resets.

Syntax Highlighting

Added keywords to script_highlighting_rules.js, but need to find where ctrl+space completion is resulting in lower case keywords

op_hash160 misimplemented

Consider the script 74686973697361736563726574 op_hash160.
Answer expected: 0x835ca4a6a1c2baaaf63bf33c777aff2fc681b017
Answer returned: 0xa69008fd5d7297bed5b71fea578a770e150b2f92

Expected behaviour confirmed at https://www.indicrypto.com/bitcointools/tool/pubkey-to-hash, https://bitcoinprices.org/public-key-to-hash/ and by running through the current master at https://github.com/kallewoof/btcdeb.

The error derives from mishandling the preimages as ascii instead of binary.
In PHP the hash() function returns ascii formed as hexadecimal. Thus:

php > echo hash('ripemd160', hash('sha256', '74686973697361736563726574'));
a69008fd5d7297bed5b71fea578a770e150b2f92

A correct implementation converts the preimages to binary first:

function hexStringToByteString($hexString){
  $len=strlen($hexString);
  $byteString="";
  for ($i=0;$i<$len;$i=$i+2){
    $charnum=hexdec(substr($hexString,$i,2));
    $byteString.=chr($charnum);
  }
  return $byteString;
}

function op_hashop160($preimage) {
  $preimage1 = hexStringToByteString($preimage);    
  $hash1 = hash('sha256', $preimage1);    
  $preimage2 = hexStringToByteString($hash1);    
  $hash2 = hash('ripemd160', $preimage2);
  return $hash2;
}

php > echo op_hashop160('74686973697361736563726574');
835ca4a6a1c2baaaf63bf33c777aff2fc681b017

Thanks!

Add bitcoin as a topic to this repository

Hello,

This repository is listed on the Awesome Bitcoin list, which is a collection of useful Bitcoin projects. However, it seems that the 'bitcoin' topic is missing from this repository's topics.

Adding the 'bitcoin' topic will help users discover your project more easily and recognize its relevance to the Bitcoin ecosystem. To add the topic, please follow these steps:

  1. Navigate to the main page of the repository.
  2. Click on the gear icon next to "About" on the right side of the page.
  3. In the "Topics" section, type 'bitcoin' and press Enter.
  4. Click "Save changes."

Thank you for your attention and for contributing to the Bitcoin community!

OP_SHA1

1234
OP_SHA1

= not working

Fails to validate valid tx

When I paste the SigScript + Locking Script for some transactions, it fails to correctly do the hash160 operation, for some reason.

Examples I found:

Complete assembly:

483045022100a9926f2321a157989b453cbcc0b5f8addf64e081968f71140f11e13cd572e8e20220247868777cd462619af082379b6f28cd7660114aaddce31f9ad095054fbe419c01210272e9341c439e9de05ce2e31d0e7daedd7402c9e27c07e6951ec0038422d9f22a76a9147ab6ee8c168f32077c1cc83facb49a91d7ee5dae88ac

Generated hash160 is 089C63588D48F0BC16E13BD616D9F2F104E77AEC and it should be 7AB6EE8C168F32077C1CC83FACB49A91D7EE5DAE instead.

  • P2SH btc testnet: same tx as above but second output
160014edd6180f7362763160c4a6b2aad6021cdf68f376a914ca21182b9eca3c99175dd89ce548b72db3244db087
483045022100d357c35cb990ce20e0b55f623cfdd0285d88b05a50d381c4d3f38d60fbfd1f01022031cfd7a5052a044d8b6db661ddbe1d42cd33993dfefb4cf08242b6d37e7dc880012102de7aa418220884ff2cfc17d53c4740306626304ec29547b2ea7db1f83cfd592676a914c404ac615993ac8c7b91a06283ba8c82e8e9098488ac

I don't have a clue why this is not working properly, maybe I am missing something? I don't think I am because the ASM code looks just fine.

op_invert breaks

Hi

When I try to run a script with OP_Invert, the IDE fails.

How to reproduce: run script "f op_invert"

Output in console:

F
undefined
OP_INVERT
131
numbsys: 3

(in interpreter.js:363:8)
ReferenceError: NULL is not defined
nextStep https://siminchen.github.io/bitcoinIDE/build/script_interpreter/interpreter.js:363
nextStep https://siminchen.github.io/bitcoinIDE/build/debugger.js:115
runFromBeginning https://siminchen.github.io/bitcoinIDE/build/debugger.js:100
https://siminchen.github.io/bitcoinIDE/build/editor.js:24
jQuery 2
dispatch
handle

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.