siminchen / bitcoinide Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
A library that supports two functions: push and pop. It is supposed to display the stack onto the page.
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)
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
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.
Added keywords to script_highlighting_rules.js, but need to find where ctrl+space completion is resulting in lower case keywords
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!
as title.
Or am I the only one who cannot access it? (I'm in Taiwan)
http://www.cs.princeton.edu/~tongbinw/bitcoinIDE/build/editor.html
Forbidden
You don't have permission to access /~tongbinw/bitcoinIDE/build/editor.html on this server.
Apache/2.2.15 (Red Hat) Server at www.cs.princeton.edu Port 80
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:
Thank you for your attention and for contributing to the Bitcoin community!
1234
OP_SHA1
= not working
Had a few bugs reported; see:
https://twitter.com/grgiupaul/status/1002578263988981760
and https://twitter.com/grgiupaul/status/1002581114014306305
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.
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.
Event driven button that calls the interpreter
OP_CHECKSIG always returns 01 (TRUE).
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.