diff --git a/docs/index.md b/docs/index.md index 7887eaba..3707ae9b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -534,7 +534,7 @@ amount | [value](#value) | Amount of XRP for sender to escrow. destination | [address](#ripple-address) | Address to receive escrowed XRP. allowCancelAfter | date-time string | *Optional* If present, the escrow may be cancelled after this time. allowExecuteAfter | date-time string | *Optional* If present, the escrow can not be executed before this time. -condition | string | *Optional* If present, fulfillment is required upon execution. +condition | string | *Optional* A hex value representing a [PREIMAGE-SHA-256 crypto-condition](https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#section-8.1). If present, `fulfillment` is required upon execution. destinationTag | integer | *Optional* Destination tag. memos | [memos](#transaction-memos) | *Optional* Array of memos to attach to the transaction. sourceTag | integer | *Optional* Source tag. @@ -580,8 +580,8 @@ Name | Type | Description ---- | ---- | ----------- owner | [address](#ripple-address) | The address of the owner of the escrow to execute. escrowSequence | [sequence](#account-sequence-number) | The [account sequence number](#account-sequence-number) of the [Escrow Creation](#escrow-creation) transaction for the escrow to execute. -condition | string | *Optional* The original `condition` from the escrow creation transaction. This is sha256 hash of `fulfillment` string. It is replicated here so that the relatively expensive hashing operation can be delegated to a server without ledger history and the server with ledger history only has to do a quick comparison of the old condition with the new condition. -fulfillment | string | *Optional* A value that produces the condition when hashed. It must be 32 charaters long and contain only 8-bit characters. +condition | string | *Optional* A hex value representing a [PREIMAGE-SHA-256 crypto-condition](https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#section-8.1). This must match the original `condition` from the escrow creation transaction. +fulfillment | string | *Optional* A hex value representing the [PREIMAGE-SHA-256 crypto-condition](https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#section-8.1) fulfillment for `condition`. memos | [memos](#transaction-memos) | *Optional* Array of memos to attach to the transaction. ### Example diff --git a/src/common/schemas/specifications/escrow-creation.json b/src/common/schemas/specifications/escrow-creation.json index 7580946d..e78112d5 100644 --- a/src/common/schemas/specifications/escrow-creation.json +++ b/src/common/schemas/specifications/escrow-creation.json @@ -15,7 +15,7 @@ "memos": {"$ref": "memos"}, "condition": { "type": "string", - "description": "If present, fulfillment is required upon execution.", + "description": "A hex value representing a [PREIMAGE-SHA-256 crypto-condition](https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#section-8.1). If present, `fulfillment` is required upon execution.", "pattern": "^[A-F0-9]{0,256}$" }, "allowCancelAfter": { diff --git a/src/common/schemas/specifications/escrow-execution.json b/src/common/schemas/specifications/escrow-execution.json index db08248b..18e72e06 100644 --- a/src/common/schemas/specifications/escrow-execution.json +++ b/src/common/schemas/specifications/escrow-execution.json @@ -15,12 +15,12 @@ }, "condition": { "type": "string", - "description": "The original `condition` from the escrow creation transaction. This is sha256 hash of `fulfillment` string. It is replicated here so that the relatively expensive hashing operation can be delegated to a server without ledger history and the server with ledger history only has to do a quick comparison of the old condition with the new condition.", + "description": "A hex value representing a [PREIMAGE-SHA-256 crypto-condition](https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#section-8.1). This must match the original `condition` from the escrow creation transaction.", "pattern": "^[A-F0-9]{0,256}$" }, "fulfillment": { "type": "string", - "description": "A value that produces the condition when hashed. It must be 32 charaters long and contain only 8-bit characters.", + "description": "A hex value representing the [PREIMAGE-SHA-256 crypto-condition](https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#section-8.1) fulfillment for `condition`.", "pattern": "^[A-F0-9]+$" } }, diff --git a/test/fixtures/requests/prepare-escrow-creation-full.json b/test/fixtures/requests/prepare-escrow-creation-full.json index 1decf8ef..3c20b454 100644 --- a/test/fixtures/requests/prepare-escrow-creation-full.json +++ b/test/fixtures/requests/prepare-escrow-creation-full.json @@ -1,7 +1,7 @@ { "destination": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", "amount": "0.01", - "condition": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4", + "condition": "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100", "allowExecuteAfter": "2014-09-24T21:21:50.000Z", "memos": [ { diff --git a/test/fixtures/responses/get-transaction-escrow-create.json b/test/fixtures/responses/get-transaction-escrow-create.json index f0c37051..e8e97954 100644 --- a/test/fixtures/responses/get-transaction-escrow-create.json +++ b/test/fixtures/responses/get-transaction-escrow-create.json @@ -13,7 +13,7 @@ "data": "mema data" } ], - "condition": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4", + "condition": "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100", "allowCancelAfter": "2015-11-16T06:53:42.000Z", "allowExecuteAfter": "2015-11-16T06:47:42.000Z", "destinationTag": 2, diff --git a/test/fixtures/responses/prepare-escrow-creation-full.json b/test/fixtures/responses/prepare-escrow-creation-full.json index 34e5f487..0050d793 100644 --- a/test/fixtures/responses/prepare-escrow-creation-full.json +++ b/test/fixtures/responses/prepare-escrow-creation-full.json @@ -1,5 +1,5 @@ { - "txJSON": "{\"TransactionType\":\"EscrowCreate\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Destination\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"Amount\":\"10000\",\"Condition\":\"8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4\",\"FinishAfter\":464908910,\"SourceTag\":1,\"DestinationTag\":2,\"Memos\":[{\"Memo\":{\"MemoData\":\"7465787465642064617461\",\"MemoType\":\"74657374\"}}],\"Flags\":2147483648,\"LastLedgerSequence\":8819954,\"Fee\":\"12\",\"Sequence\":23}", + "txJSON": "{\"TransactionType\":\"EscrowCreate\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Destination\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"Amount\":\"10000\",\"Condition\":\"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\"FinishAfter\":464908910,\"SourceTag\":1,\"DestinationTag\":2,\"Memos\":[{\"Memo\":{\"MemoData\":\"7465787465642064617461\",\"MemoType\":\"74657374\"}}],\"Flags\":2147483648,\"LastLedgerSequence\":8819954,\"Fee\":\"12\",\"Sequence\":23}", "instructions": { "fee": "0.000012", "sequence": 23, diff --git a/test/fixtures/rippled/tx/escrow-creation-iou.json b/test/fixtures/rippled/tx/escrow-creation-iou.json index a6dc941b..e1df31ec 100644 --- a/test/fixtures/rippled/tx/escrow-creation-iou.json +++ b/test/fixtures/rippled/tx/escrow-creation-iou.json @@ -6,7 +6,7 @@ "CancelAfter": 500972022, "Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw", "DestinationTag": 2, - "Condition": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4", + "Condition": "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100", "Fee": "12", "FinishAfter": 500971662, "Flags": 2147483648, @@ -41,7 +41,7 @@ "CancelAfter": 500972022, "Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw", "DestinationTag": 2, - "Condition": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4", + "Condition": "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100", "FinishAfter": 500971662, "SourceTag": 1 } diff --git a/test/fixtures/rippled/tx/escrow-creation.json b/test/fixtures/rippled/tx/escrow-creation.json index 54bcdd60..2101ddaf 100644 --- a/test/fixtures/rippled/tx/escrow-creation.json +++ b/test/fixtures/rippled/tx/escrow-creation.json @@ -6,7 +6,7 @@ "CancelAfter": 500972022, "Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw", "DestinationTag": 2, - "Condition": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4", + "Condition": "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100", "Fee": "12", "FinishAfter": 500971662, "Flags": 2147483648, @@ -41,7 +41,7 @@ "CancelAfter": 500972022, "Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw", "DestinationTag": 2, - "Condition": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4", + "Condition": "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100", "FinishAfter": 500971662, "SourceTag": 1 }