Hi there.
When I call rippled submit method there is a deprecated field in result json with message
Signing support in the 'submit' command has been deprecated and will be removed in a future version of the server. Please migrate to a standalone signing tool.
Which tools can I use to sign transactions manually?
When I call sign method there's also deprecated warning.
I use PHP and I couldn't find any ripple api implementations (as I understand there's only one implementation for JS).
Or where can I find signing algorithm description to implement it by myself?
@lo00l: the algorithms used are pretty standard: either secp256k1 (same as Bitcoin) or Ed25519. I suspect that there are PHP implementations for both. However, I don't believe there's any PHP implementation that can properly serialize a transaction into a blob for signing.
We will need to figure out what implementing that would entail. It might be interesting to leverage http://www.php-cpp.com/ to add such support.
Calling C++ from e.g. Python (especially modern C++ with templates, callbacks and whatnot) is not exactly an enjoyable experience.
While https://github.com/ripple/rippled/tree/develop/src/ripple/protocol looks a bit scary at first, the (de-)serialization code isn't that complex. There are a few gotchas, but nothing major.
If you want to supply an official external library to be used through FFIs in different other languages, I'd recommend taking a look at either C (if oldschool cool is your thing) or Rust (it's what the cool kids seem to be into these days). php-cpp also goes this route btw., by dropping to extern "C" syntax: http://www.php-cpp.com/documentation/functions
I agree, @MarkusTeufelberger.
I'm working on documenting the serialization format a little better so that it's more straightforward to implement in more languages. With any luck, this can lead to some more implementations in other languages.
This is not quite to the point of implementing signing yet, but the info for serializing transactions is now published here: https://developers.ripple.com/serialization.html
Signing involves deriving private and public keys from a 128-bit seed, making sure the SigningPubKey field is added to the transaction before serializing it, then doing standard ECDSA or Ed25519 things on that blob, and finally adding the signature to the transaction in the Signature field and re-serializing (since the APIs mostly only accept signed transactions in the binary format). Multi-signing is only slightly more complicated. I haven't figured out the key derivation part yet, so that's probably the major missing piece at the moment.
I use https://github.com/rubblelabs/ripple, write a go file export the function I need, then
build with -buildmode=c-shared flag, output a standard shared object binary file (.so) exposing Go functions as a C-style APIs, then other language can call through FFI.
But the .so file size is over 10Mb.
Did anyone make a PHP signing tool or something that can be run on Windows?
@lo00l @nbougalis @mDuo13 @yxxyun @MarkusTeufelberger
Sorry for calling you out but I don't know when the deprecated method will go away and I need a method that works on Windows (PHP will work). So does any of you know a signing tool that can be run on Windows?
https://github.com/yxxyun/xrpsign-ffi-example
here is the ffi example @msraoa
I just wrote my own wrapper in Python for the stuff I need. You can let rippled serialize things and just implement signing by the way, so I don't really see what a "PHP signing tool" (especially with Windows support?!) would bring to the table other than just taking a serialized blob and signing it? Should be likely possible with even a simple usage example for your cryptographic library of choice.
Serialization... well that's a different story, but as I said until you actually need to do everything locally, you can just let rippled do the serialization from/to JSON. Would be nice to have something like https://github.com/ripple/ripple-binary-codec in a language that can be actually used (and in a library that is actually used by rippled so there's no mismatch), but even there I guess you can find something to call out to Javascript (or just write everything in JS, I guess that runs on Windows too?) from PHP. Implementing everything should be about a week of work or so, depending on how familiar you are with serialization in your language of choice and how well you can read the existing implementations in Go, JS or C++ or the documentation.
You can use ripple-lib through Node.js. Here's Microsoft's guide for Node.js on Windows.
@intelliot can you take a look at this ticket to see if there is any tooling we can consider contributing?
For the record, I did end up writing key derivation code in Python.
There's also the "Xpring" library that @thejohnfreeman wrote, published here: https://pypi.org/project/xpring/
Most helpful comment
This is not quite to the point of implementing signing yet, but the info for serializing transactions is now published here: https://developers.ripple.com/serialization.html
Signing involves deriving private and public keys from a 128-bit seed, making sure the
SigningPubKeyfield is added to the transaction before serializing it, then doing standard ECDSA or Ed25519 things on that blob, and finally adding the signature to the transaction in theSignaturefield and re-serializing (since the APIs mostly only accept signed transactions in the binary format). Multi-signing is only slightly more complicated. I haven't figured out the key derivation part yet, so that's probably the major missing piece at the moment.