{
  "description": "mnd8t action digest, digest_version 1. sha256 over the canonical JSON of the fixed key set. See docs/evidence-receipts.md.",
  "digest_version": "1",
  "valid": [
    {
      "name": "full payment: £5,000 to Supplier A from Account X for Invoice 123",
      "input": {
        "action_type": "PAYMENT",
        "financial_account_id": "fac_account_x",
        "asset": "GBP",
        "amount_minor": 500000,
        "counterparty": "supplier_a",
        "destination": "GB29NWBK60161331926819",
        "purpose": "invoice_payment",
        "external_reference": "INV-123"
      },
      "canonical": "{\"action_type\":\"PAYMENT\",\"amount_minor\":500000,\"asset\":\"GBP\",\"counterparty\":\"supplier_a\",\"destination\":\"GB29NWBK60161331926819\",\"digest_version\":\"1\",\"external_reference\":\"INV-123\",\"financial_account_id\":\"fac_account_x\",\"purpose\":\"invoice_payment\"}",
      "action_hash": "sha256:ec79aa1b6322822f8a30a04216e7323b4952d41db35483a03d7f9cdc61590313"
    },
    {
      "name": "same action, keys in a different order",
      "input": {
        "external_reference": "INV-123",
        "purpose": "invoice_payment",
        "destination": "GB29NWBK60161331926819",
        "counterparty": "supplier_a",
        "amount_minor": 500000,
        "asset": "GBP",
        "financial_account_id": "fac_account_x",
        "action_type": "PAYMENT"
      },
      "canonical": "{\"action_type\":\"PAYMENT\",\"amount_minor\":500000,\"asset\":\"GBP\",\"counterparty\":\"supplier_a\",\"destination\":\"GB29NWBK60161331926819\",\"digest_version\":\"1\",\"external_reference\":\"INV-123\",\"financial_account_id\":\"fac_account_x\",\"purpose\":\"invoice_payment\"}",
      "action_hash": "sha256:ec79aa1b6322822f8a30a04216e7323b4952d41db35483a03d7f9cdc61590313"
    },
    {
      "name": "optional fields omitted are hashed as null",
      "input": {
        "action_type": "TRANSFER",
        "asset": "USDC",
        "amount_minor": 84000
      },
      "canonical": "{\"action_type\":\"TRANSFER\",\"amount_minor\":84000,\"asset\":\"USDC\",\"counterparty\":null,\"destination\":null,\"digest_version\":\"1\",\"external_reference\":null,\"financial_account_id\":null,\"purpose\":null}",
      "action_hash": "sha256:be3b399ffa41846b0bf37aaa45f6a943590f1bcef94dcafa987b0b85020d54f2"
    },
    {
      "name": "optional fields given as null hash the same as omitted",
      "input": {
        "action_type": "TRANSFER",
        "asset": "USDC",
        "amount_minor": 84000,
        "financial_account_id": null,
        "counterparty": null,
        "destination": null,
        "purpose": null,
        "external_reference": null
      },
      "canonical": "{\"action_type\":\"TRANSFER\",\"amount_minor\":84000,\"asset\":\"USDC\",\"counterparty\":null,\"destination\":null,\"digest_version\":\"1\",\"external_reference\":null,\"financial_account_id\":null,\"purpose\":null}",
      "action_hash": "sha256:be3b399ffa41846b0bf37aaa45f6a943590f1bcef94dcafa987b0b85020d54f2"
    },
    {
      "name": "amount changed: £5,500",
      "input": {
        "action_type": "PAYMENT",
        "financial_account_id": "fac_account_x",
        "asset": "GBP",
        "amount_minor": 550000,
        "counterparty": "supplier_a",
        "destination": "GB29NWBK60161331926819",
        "purpose": "invoice_payment",
        "external_reference": "INV-123"
      },
      "canonical": "{\"action_type\":\"PAYMENT\",\"amount_minor\":550000,\"asset\":\"GBP\",\"counterparty\":\"supplier_a\",\"destination\":\"GB29NWBK60161331926819\",\"digest_version\":\"1\",\"external_reference\":\"INV-123\",\"financial_account_id\":\"fac_account_x\",\"purpose\":\"invoice_payment\"}",
      "action_hash": "sha256:039ff8634e62dfe28d0a80a070d40550e528daeddf8858ab21c534607b19adc7"
    },
    {
      "name": "counterparty changed: Supplier B",
      "input": {
        "action_type": "PAYMENT",
        "financial_account_id": "fac_account_x",
        "asset": "GBP",
        "amount_minor": 500000,
        "counterparty": "supplier_b",
        "destination": "GB29NWBK60161331926819",
        "purpose": "invoice_payment",
        "external_reference": "INV-123"
      },
      "canonical": "{\"action_type\":\"PAYMENT\",\"amount_minor\":500000,\"asset\":\"GBP\",\"counterparty\":\"supplier_b\",\"destination\":\"GB29NWBK60161331926819\",\"digest_version\":\"1\",\"external_reference\":\"INV-123\",\"financial_account_id\":\"fac_account_x\",\"purpose\":\"invoice_payment\"}",
      "action_hash": "sha256:fe2398eeafc6c27623619f618d68f548ed27ee9dbd41e7bb53966b7b985e1825"
    },
    {
      "name": "case is significant: asset 'gbp' is not 'GBP'",
      "input": {
        "action_type": "PAYMENT",
        "financial_account_id": "fac_account_x",
        "asset": "gbp",
        "amount_minor": 500000,
        "counterparty": "supplier_a",
        "destination": "GB29NWBK60161331926819",
        "purpose": "invoice_payment",
        "external_reference": "INV-123"
      },
      "canonical": "{\"action_type\":\"PAYMENT\",\"amount_minor\":500000,\"asset\":\"gbp\",\"counterparty\":\"supplier_a\",\"destination\":\"GB29NWBK60161331926819\",\"digest_version\":\"1\",\"external_reference\":\"INV-123\",\"financial_account_id\":\"fac_account_x\",\"purpose\":\"invoice_payment\"}",
      "action_hash": "sha256:a948daa54431b081b290de45efd27f3a3012341a9064ba17a09478fee8c194fc"
    },
    {
      "name": "no Unicode normalisation: precomposed é",
      "input": {
        "action_type": "PAYMENT",
        "financial_account_id": "fac_account_x",
        "asset": "GBP",
        "amount_minor": 500000,
        "counterparty": "supplier_a",
        "destination": "GB29NWBK60161331926819",
        "purpose": "café",
        "external_reference": "INV-123"
      },
      "canonical": "{\"action_type\":\"PAYMENT\",\"amount_minor\":500000,\"asset\":\"GBP\",\"counterparty\":\"supplier_a\",\"destination\":\"GB29NWBK60161331926819\",\"digest_version\":\"1\",\"external_reference\":\"INV-123\",\"financial_account_id\":\"fac_account_x\",\"purpose\":\"café\"}",
      "action_hash": "sha256:4b3f106c0acd5965d23107c95a154464a70020f1b5be736edbc368e18e8b9975"
    },
    {
      "name": "no Unicode normalisation: e + combining acute",
      "input": {
        "action_type": "PAYMENT",
        "financial_account_id": "fac_account_x",
        "asset": "GBP",
        "amount_minor": 500000,
        "counterparty": "supplier_a",
        "destination": "GB29NWBK60161331926819",
        "purpose": "café",
        "external_reference": "INV-123"
      },
      "canonical": "{\"action_type\":\"PAYMENT\",\"amount_minor\":500000,\"asset\":\"GBP\",\"counterparty\":\"supplier_a\",\"destination\":\"GB29NWBK60161331926819\",\"digest_version\":\"1\",\"external_reference\":\"INV-123\",\"financial_account_id\":\"fac_account_x\",\"purpose\":\"café\"}",
      "action_hash": "sha256:940634f32a09bae56bc994fe04b0b556010f8876195f1527beec28a1b339abb3"
    },
    {
      "name": "empty string is not null",
      "input": {
        "action_type": "PAYMENT",
        "financial_account_id": "fac_account_x",
        "asset": "GBP",
        "amount_minor": 500000,
        "counterparty": "supplier_a",
        "destination": "GB29NWBK60161331926819",
        "purpose": "invoice_payment",
        "external_reference": ""
      },
      "canonical": "{\"action_type\":\"PAYMENT\",\"amount_minor\":500000,\"asset\":\"GBP\",\"counterparty\":\"supplier_a\",\"destination\":\"GB29NWBK60161331926819\",\"digest_version\":\"1\",\"external_reference\":\"\",\"financial_account_id\":\"fac_account_x\",\"purpose\":\"invoice_payment\"}",
      "action_hash": "sha256:a2f47d3d16ebb7a173ce36879a278711673aa74ad600110e5e0fd9eff11ec120"
    }
  ],
  "invalid": [
    {
      "name": "decimal amount",
      "input": {
        "action_type": "PAYMENT",
        "financial_account_id": "fac_account_x",
        "asset": "GBP",
        "amount_minor": 5000.5,
        "counterparty": "supplier_a",
        "destination": "GB29NWBK60161331926819",
        "purpose": "invoice_payment",
        "external_reference": "INV-123"
      }
    },
    {
      "name": "negative amount",
      "input": {
        "action_type": "PAYMENT",
        "financial_account_id": "fac_account_x",
        "asset": "GBP",
        "amount_minor": -1,
        "counterparty": "supplier_a",
        "destination": "GB29NWBK60161331926819",
        "purpose": "invoice_payment",
        "external_reference": "INV-123"
      }
    },
    {
      "name": "amount as a string",
      "input": {
        "action_type": "PAYMENT",
        "financial_account_id": "fac_account_x",
        "asset": "GBP",
        "amount_minor": "500000",
        "counterparty": "supplier_a",
        "destination": "GB29NWBK60161331926819",
        "purpose": "invoice_payment",
        "external_reference": "INV-123"
      }
    },
    {
      "name": "missing asset",
      "input": {
        "action_type": "PAYMENT",
        "financial_account_id": "fac_account_x",
        "amount_minor": 500000,
        "counterparty": "supplier_a",
        "destination": "GB29NWBK60161331926819",
        "purpose": "invoice_payment",
        "external_reference": "INV-123"
      }
    },
    {
      "name": "missing action_type",
      "input": {
        "action_type": "",
        "financial_account_id": "fac_account_x",
        "asset": "GBP",
        "amount_minor": 500000,
        "counterparty": "supplier_a",
        "destination": "GB29NWBK60161331926819",
        "purpose": "invoice_payment",
        "external_reference": "INV-123"
      }
    },
    {
      "name": "non-string counterparty",
      "input": {
        "action_type": "PAYMENT",
        "financial_account_id": "fac_account_x",
        "asset": "GBP",
        "amount_minor": 500000,
        "counterparty": 123,
        "destination": "GB29NWBK60161331926819",
        "purpose": "invoice_payment",
        "external_reference": "INV-123"
      }
    }
  ]
}
