Giter Site home page Giter Site logo

Comments (7)

afk11 avatar afk11 commented on July 18, 2024

I would start at this: https://github.com/Bit-Wasp/bitcoin-lib-php/blob/master/examples/raw_transaction.php get the information about the transaction, then create/sign it.

Then do:
$rpc = new JsonRpcClient(array("url"=>"bitcoinrpc:[email protected]:port")); $sentTxid = $rpc->sendrawtransaction($transactionHex);
BTW odds are if your transaction is rejected (error code -25? but no message) you had passed a tx with an 'insanely high fee'. You can override this check by doing sendrawtransaction($transactionHex, true) I think..

bitcoin-cli help will probably help here, all the RPC functions are as described on that page.

from bitcoin-lib-php.

coingeek avatar coingeek commented on July 18, 2024

thanks for reply,
I need to know, how to use this library with my own altcoin,
what the parameters i should change,

from bitcoin-lib-php.

coingeek avatar coingeek commented on July 18, 2024

thanks, it works,
but there is another issue,
my balance: 5 coin.
when i create transaction to send for example .5 coin.
the system take fees = 4.5 the rest of my balance??
how to resolve the transaction fees problem.

from bitcoin-lib-php.

rubensayshi avatar rubensayshi commented on July 18, 2024

@coingeek you need to add a 'change output' yourself sending the other 4.5 coin back to your own address or to a new address of yourself

from bitcoin-lib-php.

afk11 avatar afk11 commented on July 18, 2024

Yeah you need to be explicit about the amounts that you're moving.

When you make a transaction, there is actually nothing in the tx that restricts it to a network. so to answer what parameters you need to change, just be sure you explicitly set your version bytes address/p2sh, and if you're creating a coin please stick to the convention of the private key being AddressVersion + 128. There is a reason it's done that way in bitcoin, and this library depends on that to derive the private key's WIF.

from bitcoin-lib-php.

coingeek avatar coingeek commented on July 18, 2024

I Generate the same public key from my private key using your library, so i think it is ok,
but the problem when i generate the tx, it, the network report it as (error -22),

from bitcoin-lib-php.

afk11 avatar afk11 commented on July 18, 2024

I'm going to close this, think the problems are mainly due to using an older altcoin.

from bitcoin-lib-php.

Related Issues (20)

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.