Git Product home page Git Product logo

ayms / bitcoin-transactions Goto Github PK

View Code? Open in Web Editor NEW
111.0 14.0 43.0 2 MB

Javascript implementation of the Bitcoin protocol for any Bitcoin based coins, on server and inside browsers, discover and move/manage your coins by yourself: Bitcoin transactions made simple for standard or multisig wallets, segwit and bech32 are supported, create and send by your own your Bitcoin, Bitcoin Cash, Zcash, Litecoin, DOGE, Dash, etc transactions, manage your keys and do not disclose them to dubious wallets software

Home Page: https://peersm.com/wallet

JavaScript 38.15% HTML 61.85%
claim coins bch btg bcd sbtc bitcoin wallet fork multisig-wallets

bitcoin-transactions's People

Contributors

ayms 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

bitcoin-transactions's Issues

MultiSig wallet BTG transaction error

Hi,

thank you for this great script. I am using it to get my BTG out of Multisig Electrum wallet.

I managed to create 3 successful transactions, 3 more to be done. Unfortunately, all remaining 3 get rejected when sending them to the network.

The error I get when trying to broadcast the body via https://btgexplorer.com/tx/send is:

16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation). Code:-26

When I send them with the script, it gets rejected too.

One of the tranasctions:

node tx.js BTG create prevtx=57b3cadfdb1ed2c24404db6b8b96afaa4b8ce2f7ef64836a5f9245fd32a
51df5 prevaddr=3GauZViffpjJxZnNjw8WYS4NRuegkxdKvX prevamount=0.02477516 previndex=1 privkey=[key1]-[key2]-[redeem]-2of3 addr=GeLviuVRCnzFD2PvTRUPJPwjaCjzwg5CDc fees=0.00001

Let me know what info would you need to inspect the problem, thank you for your help and time.

Ondrej

Feature request: Coin fork scanner

Since you've already done the hard work of supporting so many coins, it would be neat to provide a BTC address containing coins and then scan them all at once to see what coins are available to be claimed. Like this site, but I think bitcoin-transactions already supports more coins: https://findmycoins.ninja/

How to use with an Electrum 2FA wallet

A long time ago I created an Electrum 2FA wallet and I have come to regret that decision. That out of the way how can I use this tool to get forked funds from my Electrum 2FA wallets?

For example I've tried creating a BTG transaction but always get the following error:

------------- End Check - deserialize
------------- Check - verify
Using BIP143 signing
Verifying signature for ...
********* - Bad transaction

Test BTC

Volunteers welcome to test the tool for Bitcoin Core

node tx.js BTC <command> <params>

Question about parameters

https://github.com/BTCPrivate/BitcoinPrivate/issues/122#issuecomment-371390794

Ayms, thanks for sharing to your tool. I'm still stuck with this multi-sig ZCL wallet that I can't import private keys from into BTCP electrum wallet. I tried your tx.js script, but there are a few variables that I don't understand, mainly previndex. Please help me to understand:

node tx.js BTCP create `
prevtx=(is this the transaction ID from the previous address (below on the next line)? Need clarification please)
prevaddr=(the address where ZCL would have been sent from prior to this address (probably chronological?))
prevamount= (I assume it would be the amount of the last transaction [prevaddr=] from the line above)
previndex=(I have no clue. Can't find on any block explorer. need major clarification)
privkey= (I assume the private key of the address (below on the next line?)
addr=(the address where my ZCL balance was before the snapshot?)
fees= (info found on block explorer or electrum wallet details)
amount= (info found on block explorer or electrum wallet details)

Thank you immensely for any clarity you can offer.

Did I just lost my BTG ?

Ok, I've attempted to use your tool but something doesn't seems fine to me and I think I've lost everything.
Basically I got a Ledger Nano S, installed the BTG application and got an address to receive the sum "ALbDT4o2aCVFsVhMfmXbJJ6NSBugAY1n35"

then following your "easy" guide I tried to move my fund from this old transaction

https://blockchain.info/tx/56714ec2e79e29154643306c4960462fba68292a292e8bbe076ab050cd774a25

address 1GRvDoGj77RTgZtZ2Y5nAaFJ6YCTKTPFnV index 26

node tx.js BTG create prevtx=56714ec2e79e29154643306c4960462fba68292a292e8bbe076ab050cd774a25 prevaddr=1GRvDoGj77RTgZtZ2Y5nAaFJ6YCTKTPFnV prevamount=0.594 previndex=26 privkey=privkey addr=ALbDT4o2aCVFsVhMfmXbJJ6NSBugAY1n35 fees=0.00001001

https://btgexp.com/tx/8c76ce917dc9f278d71befbaee817eac9d7225e729e15db16bb986f144769551

and looking at the transaction dump I didn't realise my addr was different not just the same but with a different encoding.

So now I'm here asking, are they lost ? thanks

Implement multiple inputs

Most likely people will like to merge multiple inputs to a single output referenced by only one transaction

Erro create transaction testnet

I am using the following command

node tx.js BTC create prevtx=7063d3b9b5b295c8467047023d9daa3c09876a2a505e092725fce2f38385184e prevaddr=mxuJGtqst8dU2DMPNjciz9VWWHRRps7dwv prevamount=0.113628 privkey=tprv8ZgxMBicQKsPduXaaGVR64VQjHwWDL9NsgJirL1JZKN2zPdGBPnedVXGQhsuvF3K1Ydba9FoZj8nAQHx5SQS9qtD4Gwm4T64i5N2N3RZnES addr=msAka8AGvxRZbDrTHSkhjh6Eu5THuad7Fp amount=0.003

Return erro!

Version BTC create Destination address 0.003 Warning !!!! You are sending the funds to a P2SH address, make sure that you control it, especially if it's a BIP141 segwit address --- With your network fees the advised amount is: undefined false Something is wrong with your numbers, please check them with the testamount command

What is the configuration for BTC testnet?

Make it easy for the user, not hard

Thanks for this tool, but why did you make it harder for the user than it needs to be? This stuff is complicated enough already. Some thoughts below:

Why make the user calculate amount+dev fees+network fees?
To make a user friendly command-line tool you have to think about what the user wants to do:

  1. Spend specific amount of coins from a specific address
  2. Decide their network fee

The program should do the rest. Don't make the user be the computer, when the computer should be doing work for the user.

Therefore the UI should be:

node tx.js BTG create .... amount=<amount to spend> fee=<satoshis per byte>

The tool should calculate the rest itself. Don't make the user calculate things that the computer can do by itself. Or am I missing something? Thanks!!

Test Zcash

Volunteers welcome to test the tool for Zcash

node tx.js ZEC <command> <params>

Tutorial to claim/move coins

Apparently it's not easy for people to retrieve the parameters to use the tool, especially they don't get that they have to find them and run the command for each transaction sending coins to the address they want to spend

If someone wants to do a video tuto for this, from installation to the commands

Document is not Defined Error

-I am trying to use this tool but cannot get past a document is not defined error with nodejs. Cannot create a wallet or build a transaction. When I do node tx.js createwallet <my 64 char secret> I get:

/home/user/tx/bitcoin-transactions-Ayms/tx.js:33
if (document===undefined) {

ReferenceError: document is not defined
at start (/home/user/tx/bitcoin-transactions-Ayms/tx.js:33:3)
at Object. (/home/user/tx/bitcoin-transactions-Ayms/tx.js:133:4)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3

What should I do?

TX decode failed. Code:-22

I'm trying to create a Bitcoin Private BTCD transaction.

When I try to send the transaction using https://explorer.btcprivate.org/tx/send I get the error above.

error

UTXO information available ere https://explorer.btcprivate.org/address/b1H4VhwWAoVGMqnXM8oqsKK2WzpMGkbRamm

I run the following

node tx.js BTCP create prevtx=db832d5b046eb2a297d2f3044c22a891d9c4adb9806396e39e1ec2cf531c0375 \ prevaddr=b1H4VhwWAoVGMqnXM8oqsKK2WzpMGkbRamm \ prevamount=0.005 previndex=0 \ privkey=REMOVED b19nP23vNEyWiyz6B9G5hFnt7w12RAPbsU9 fees=0.0000030

I get the following output from tx.js

Version BTCP
Destination address b19nP23vNEyWiyz6B9G5hFnt7w12RAPbsU9
--- Prevamount is small, min dev fees of 17000 apply - amount should be 0.00482700
--- Previous amount is: 0.00500000
--- Amount to spend is: 0.00482700
--- Network fees are: 0.00000300
--- Dev fees are: 0.00017000
true
Using standard signing
Address corresponding to private key is b1H4VhwWAoVGMqnXM8oqsKK2WzpMGkbRamm
----- Transaction hash: 9657fbb131ad4c41519fe231833ed6697dcdb8f906e508179a7e7ec4de03f9c5
Transaction body:
020000000175031c53cfc21e9ee3966380b9adc4d991a8224c04f3d297a2b26e045b2d83db000000006a4730440220157fdca183bc7001fd7ac064706454cea8a120d65e17dced976b036b09447b6a022078bff8b4f280e91afee6ffa429f6ed0f9645b49b7d9499b6b734263338316637412103e131d6f9e9f83cfa18de2e89887cc4c829ab99c230bc884c22ddb6ffab19e121ffffffff028b5d0700000000001976a9143a48bfebcdc52c7b3831eab75a1955e58744c7e388ac68420000000000001976a9145b79a9d29a34f2f284ecdd33009ffa5e0252b68988ac00000000
Complete transaction:
a8eaa2cd747800000000000000000000e10000009657fbb1020000000175031c53cfc21e9ee3966380b9adc4d991a8224c04f3d297a2b26e045b2d83db000000006a4730440220157fdca183bc7001fd7ac064706454cea8a120d65e17dced976b036b09447b6a022078bff8b4f280e91afee6ffa429f6ed0f9645b49b7d9499b6b734263338316637412103e131d6f9e9f83cfa18de2e89887cc4c829ab99c230bc884c22ddb6ffab19e121ffffffff028b5d0700000000001976a9143a48bfebcdc52c7b3831eab75a1955e58744c7e388ac68420000000000001976a9145b79a9d29a34f2f284ecdd33009ffa5e0252b68988ac00000000
Size 249 bytes
Network Fees: 301 - 1.21 satoshis/byte
Dev Fees: 17000
------------- Check - deserialize
Tx {
input:
[ { hash: 'db832d5b046eb2a297d2f3044c22a891d9c4adb9806396e39e1ec2cf531c0375',
n: 0,
scriptSigLen: 106,
scriptSig: [Object],
script: [Object],
nSequence: } ],
output:
[ { nValue: 482699,
scriptPubkeyLen: <Buffer 19>,
scriptPubkey: <Buffer 76 a9 14 3a 48 bf eb cd c5 2c 7b 38 31 ea b7 5a 19 55 e5 87 44 c7 e3 88 ac>,
address: 'b19nP23vNEyWiyz6B9G5hFnt7w12RAPbsU9',
type: 'p2pkh' },
{ nValue: 17000,
scriptPubkeyLen: <Buffer 19>,
scriptPubkey: <Buffer 76 a9 14 5b 79 a9 d2 9a 34 f2 f2 84 ec dd 33 00 9f fa 5e 02 52 b6 89 88 ac>,
address: 'b1CosuxqSfN3uL8KyubTcHGDm4iVmCruQ7C',
type: 'p2pkh' } ],
s: 0,
nVersion: <Buffer 02 00 00 00>,
nbinput: 1,
nboutput: 2,
nLockTime: <Buffer 00 00 00 00> }
------------- End Check - deserialize
------------- Check - verify
Using standard signing
----- Transaction verified
----- Transaction hash: 9657fbb131ad4c41519fe231833ed6697dcdb8f906e508179a7e7ec4de03f9c5
------------- End Check - verify

Test BCH

Volunteers welcome to test the tool for Bitcoin Cash

node tx.js BCH <command> <params>

Does't work with my BTG account

Hii

I have this transaction id 2fc6aff69c9707b264a1a01b6ba4dac69da497854dfb7ba67000fa9afcc8a3a2 https://btgexp.com/tx/2fc6aff69c9707b264a1a01b6ba4dac69da497854dfb7ba67000fa9afcc8a3a2

And this is my command line
node tx.js BTG create prevtx=2fc6aff69c9707b264a1a01b6ba4dac69da497854dfb7ba67000fa9afcc8a3a2 prevaddr=GMx7vEPtYZvtS6AW7JEeFG18WCEDx2sZ9u prevamount=1.02668204 previndex=2 privkey=privkey addr=GMx7vEPtYZvtS6AW7JEeFG18WCEDx2sZ9u amount=0.0005

Then i got response body, and start the request
node tx.js BTG send e1476d44747800000000000000000000e200000094cd8b200200000001a2a3c8fc9afa0070a67bfb4d8597a49dc6daa46b1ba0a164b207979cf6afc62f020000006b483045022100f071a26b42106143f08648fc0332c57fd99c76c66061fbebcbe682a484c22b650220488eba44b9c95f55fb03ae2f90289051adc4924b80b5c88a4674062f007d3d2e412103328ba6c70c404497a663505914704a7b695331569d729745baa1f1cdcbf2d359ffffffff0250c30000000000001976a9142d0c99a1ff56f5856131016b5ade5b13e209885988ac34210000000000001976a9145b79a9d29a34f2f284ecdd33009ffa5e0252b68988ac00000000 79.124.17.202

But nothing happen, my transaction still have the same confirmation number

Thankyou

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.