sign

[Source]

The sign method takes a transaction in JSON format and a secret key, and returns a signed binary representation of the transaction. The result is always different, even when you provide the same transaction JSON and secret key. To contribute one signature to a multi-signed transaction, use the sign_for command instead.

Caution:Unless you run the rippled server yourself, you should do local signing with RippleAPI instead of using this command. An untrustworthy server could change the transaction before signing it, or use your secret key to sign additional arbitrary transactions as if they came from you.


example

- using postman, JSON


Request Format

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
    "method": "sign",
    "params": 
    [
        {
            "offline": false,
            "secret": "s████████████████████████████",
            "tx_json": 
            {
                "Account": "rHcPEQqEyui1ox85YyGCwsLRPktsebNdLU",
                "Amount" : 1,
                "Destination": "r47BF7AQxSwnyAPayUidBTL9XrMgQXFUT4",
                "TransactionType": "Payment"
            }
        }
    ]
}
cs


Response Format

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
    "result": {
        "deprecated": "This command has been deprecated and will be removed in a future version of the server. Please migrate to a standalone signing tool.",
        "status": "success",
        "tx_blob": "1200002280000000240000000561400000000000000168400000000000000A732102EB7D10A9C94CD90DE2997D9D0C227F294F944EEDD42D81415D9C2137A0DF264E7446304402207F157D783605539CB06B4303995C4D364C2910CFD04437D1820DB2E423AF1233022000E47229AAA6BE1FA857E60A5019F65F00168D4BBC32F9CA790DE118648AE3C18114B63324AE58B8B08C77F02399D632A3516386F8E18314EB7EE74406D2BF0A9F721BBFDBD0CF8B0E655FB6",
        "tx_json": {
            "Account": "rHcPEQqEyui1ox85YyGCwsLRPktsebNdLU",
            "Amount": "1",
            "Destination": "r47BF7AQxSwnyAPayUidBTL9XrMgQXFUT4",
            "Fee": "10",
            "Flags": 2147483648,
            "Sequence": 5,
            "SigningPubKey": "02EB7D10A9C94CD90DE2997D9D0C227F294F944EEDD42D81415D9C2137A0DF264E",
            "TransactionType": "Payment",
            "TxnSignature": "304402207F157D783605539CB06B4303995C4D364C2910CFD04437D1820DB2E423AF1233022000E47229AAA6BE1FA857E60A5019F65F00168D4BBC32F9CA790DE118648AE3C1",
            "hash": "18433989EBAC6A26A1A988142DD0FAE3C5D722F55670C25387F502B46867029F"
        }
    }
}
cs


※ deprecated
   - This command has been deprecated and will be removed in a future version of the server. Please migrate to a standalone signing tool.
   - 그런데, standalone signing tool을 어떻걸 써야할지 모르겠다...


XRP를 전송할 때 다른 통화와 혼동을 피하기 위해서 "Amount" : "1" 과 같이 통화를 지정하지 않고 사용한다.
- https://forum.ripple.com/viewtopic.php?f=2&t=15600


https://developers.ripple.com/payment.html

'Part 3 > ¶ blockcahin' 카테고리의 다른 글

bitcoin OP_RETURN  (0) 2018.10.01
bitcoin testnet 설치  (0) 2018.09.08
AND