assembly
assembly
Signing offline transactions  
Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Ardor Client: Ardor 2.2.2

Author Topic: Signing offline transactions  (Read 211 times)

ahatolkar-grepruby

  • Newbie
  • *
  • Karma: +1/-0
  • Offline Offline
  • Posts: 5
    • View Profile
Signing offline transactions
« on: November 14, 2018, 07:31:47 am »

Hello everyone,

I am creating an wallet for ARDOR. I am already running a local ARDOR node and using http://localhost:27876/test as my guide for APIs.
I can see that one can use 'sendMoney' endpoint to send a transaction object (that includes publicKey instead of secretPhrase). Now ARDOR node would return unsignedTransactionBytes that we need to sign on the client side. I would like to know "how to sign" these unsignedTransactionBytes (in a browser where user has signed-in using secret phrase) so that its possible to send those transactionBytes to 'boradcastTransaction' API endpoint.

Thanks!
Logged

Riker

  • Core Dev
  • Hero Member
  • *****
  • Karma: +439/-42
  • Offline Offline
  • Posts: 1789
    • View Profile
Re: Signing offline transactions
« Reply #1 on: November 15, 2018, 08:53:27 am »

There are several options:

Javascript:
1. The node js module provided with Ardor (https://ardordocs.jelurida.com/Node_JS_module)
2. Another node js module maintained by mrv777

Java:
3. Use the API callers, see https://ardorforum.org/ardor-software-releases/ardor-v2-1-1e/ looks for "callers"
Logged
NXT Core Dev
Account: NXT-HBFW-X8TE-WXPW-DZFAG
Public Key: D8311651 Key fingerprint: 0560 443B 035C EE08 0EC0  D2DD 275E 94A7 D831 1651

ahatolkar-grepruby

  • Newbie
  • *
  • Karma: +1/-0
  • Offline Offline
  • Posts: 5
    • View Profile
Re: Signing offline transactions
« Reply #2 on: November 15, 2018, 12:11:32 pm »

Hi Riker,

Thanks for the links. I went through node js module provided by ARDOR folks. Yes, I need the same functionality as in that blog post. I followed that doc. So, I went and read the README file and followed the steps and looked at the code as well, since I have to write my wallet functionality around it. But as given in html/www/js/sample/send.money.js file, we still have to give our secretPhrase to send money api. I was wondering if it is possible to send public key to send money api and upon receiving the unsigned transaction bytes, we sign those bytes and send the transaction using broadcast transaction api. If this is possible, then I would like to know how to sign those unsigned transaction bytes.
As an example, we can do something like following js code in NXT:
"unsignedTransactionBytes.substr(0, 192) + signature + unsignedTransactionBytes.substr(320)" where signature is made by using unsignedTransactionBytes from secret phrase (using some more function calls that use elliptic curve cryptography).

Thanks!
Logged
 

elective-stereophonic
elective-stereophonic
assembly
assembly