mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 19:55:54 +00:00
channel_authorize: new Ed25519 support
This commit is contained in:
@@ -17,8 +17,9 @@ An example of the request format:
|
|||||||
"id": "channel_authorize_example_id1",
|
"id": "channel_authorize_example_id1",
|
||||||
"command": "channel_authorize",
|
"command": "channel_authorize",
|
||||||
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
|
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
|
||||||
"secret": "s████████████████████████████",
|
"seed": "s████████████████████████████",
|
||||||
"amount": "1000000"
|
"key_type": "secp256k1",
|
||||||
|
"amount": "1000000",
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -32,7 +33,8 @@ Content-Type: application/json
|
|||||||
"method": "channel_authorize",
|
"method": "channel_authorize",
|
||||||
"params": [{
|
"params": [{
|
||||||
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
|
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
|
||||||
"secret": "s████████████████████████████",
|
"seed": "s████████████████████████████",
|
||||||
|
"key_type": "secp256k1",
|
||||||
"amount": "1000000"
|
"amount": "1000000"
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
@@ -41,8 +43,8 @@ Content-Type: application/json
|
|||||||
*Commandline*
|
*Commandline*
|
||||||
|
|
||||||
```
|
```
|
||||||
#Syntax: channel_authorize <private_key> <channel_id> <drops>
|
#Syntax: channel_authorize <private_key> [<key_type>] <channel_id> <drops>
|
||||||
rippled channel_authorize s████████████████████████████ 5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3 1000000
|
rippled channel_authorize s████████████████████████████ secp256k1 5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3 1000000
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- MULTICODE_BLOCK_END -->
|
<!-- MULTICODE_BLOCK_END -->
|
||||||
@@ -52,10 +54,16 @@ The request includes the following parameters:
|
|||||||
| Field | Type | Description |
|
| Field | Type | Description |
|
||||||
|-------|------|-------------|
|
|-------|------|-------------|
|
||||||
| `channel_id` | String | The unique ID of the payment channel to use.
|
| `channel_id` | String | The unique ID of the payment channel to use.
|
||||||
| `secret` | String | The secret key to use to sign the claim. This must be the same key pair as the public key specified in the channel. |
|
| `secret` | String | _(Optional)_ The secret key to use to sign the claim. This must be the same key pair as the public key specified in the channel. Cannot be used with `seed`, `seed_hex`, or `passphrase`. [Updated in: rippled 1.4.0][] |
|
||||||
|
| `seed` | String | _(Optional)_ The secret seed to use to sign the claim. This must be the same key pair as the public key specified in the channel. Must be in the XRP Ledger's [base58][] format. If provided, you must also specify the `key_type`. Cannot be used with `secret`, `seed_hex`, or `passphrase`. [New in: rippled 1.4.0][] |
|
||||||
|
| `seed_hex` | String | _(Optional)_ The secret seed to use to sign the claim. This must be the same key pair as the public key specified in the channel. Must be in hexadecimal format. If provided, you must also specify the `key_type`. Cannot be used with `secret`, `seed`, or `passphrase`. [New in: rippled 1.4.0][] |
|
||||||
|
| `passphrase` | String | _(Optional)_ A string passphrase to use to sign the claim. This must be the same key pair as the public key specified in the channel. The [key derived from this passphrase](cryptographic-keys.html#key-derivation) must match the public key specified in the channel. If provided, you must also specify the `key_type`. Cannot be used with `secret`, `seed`, or `seed_hex`. [New in: rippled 1.4.0][] |
|
||||||
|
| `key_type` | String | _(Optional)_ The [signing algorithm](cryptographic-keys.html#signing-algorithms) of the cryptographic key pair provided. Valid types are `secp256k1` or `ed25519`. The default is `secp256k1`. [New in: rippled 1.4.0][] |
|
||||||
| `amount` | String | Cumulative amount of XRP, in drops, to authorize. If the destination has already received a lesser amount of XRP from this channel, the signature created by this method can be redeemed for the difference. |
|
| `amount` | String | Cumulative amount of XRP, in drops, to authorize. If the destination has already received a lesser amount of XRP from this channel, the signature created by this method can be redeemed for the difference. |
|
||||||
|
|
||||||
**Note:** You cannot use Ed25519 keys to sign claims with this method. This is a known bug (RIPD-1474).
|
The request **must** specify exactly one of `secret`, `seed`, `seed_hex`, or `passphrase`.
|
||||||
|
|
||||||
|
**Warning:** Do not send secret keys to untrusted servers or through unsecured network connections. (This includes the `secret`, `seed`, `seed_hex`, or `passphrase` fields of this request.) You should only use this method on a secure, encrypted network connection to a server you run or fully trust with your funds. Otherwise, eavesdroppers could use your secret key to sign claims and take all the money from this payment channel and anything else using the same key pair. See [Set Up Secure Signing](set-up-secure-signing.html) for instructions.
|
||||||
|
|
||||||
## Response Format
|
## Response Format
|
||||||
|
|
||||||
@@ -110,6 +118,7 @@ The response follows the [standard format][], with a successful result containin
|
|||||||
## Possible Errors
|
## Possible Errors
|
||||||
|
|
||||||
* Any of the [universal error types][].
|
* Any of the [universal error types][].
|
||||||
|
* `badKeyType` - The `key_type` parameter in the request is not a valid key type. (Valid types are `secp256k1` or `ed25519`.) [New in: rippled 1.4.0][]
|
||||||
* `badSeed` - The `secret` in the request is not a valid secret key.
|
* `badSeed` - The `secret` in the request is not a valid secret key.
|
||||||
* `channelAmtMalformed` - The `amount` in the request is not a valid [XRP amount][XRP, in drops].
|
* `channelAmtMalformed` - The `amount` in the request is not a valid [XRP amount][XRP, in drops].
|
||||||
* `channelMalformed` - The `channel_id` in the request is not a valid Channel ID. The Channel ID should be a 256-bit (64-character) hexadecimal string.
|
* `channelMalformed` - The `channel_id` in the request is not a valid Channel ID. The Channel ID should be a 256-bit (64-character) hexadecimal string.
|
||||||
|
|||||||
Reference in New Issue
Block a user