# Does choice input data get stored as part of the transaction?

**URL:** <https://forum.canton.network/t/does-choice-input-data-get-stored-as-part-of-the-transaction/1464>\
**Category:** App Development\
**Tags:** daml, ledger\
**Created:** [October 14, 2020, 4:23pm UTC](https://forum.canton.network/t/does-choice-input-data-get-stored-as-part-of-the-transaction/1464 "2020-10-14T16:23:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lashenhurst](https://avatars.discourse-cdn.com/v4/letter/l/71e660/32.png) [@lashenhurst](https://forum.canton.network/u/lashenhurst)\
**Post date:** [October 14, 2020, 4:23pm UTC](https://forum.canton.network/t/does-choice-input-data-get-stored-as-part-of-the-transaction/1464/1 "2020-10-14T16:23:37Z")

</div>

Hi all,

I’m currently looking at DAML efficiency and storage calculations, and I got around to thinking about the inputs to a choice versus the outputs.

Say, for example, I have a choice that takes in a list, and I exercise that choice with a list containing 1k elements, but the choice logic does `lookupByKey` using those elements, finding 10 contracts to be archived and updated.

Will the list with 1k entries be stored as part of the transaction, dramatically increasing the transaction size on ledger? I thought the answer would be no, but I’m getting an odd transaction size for one of my workflows so I wanted to double check. And will all 1k lookups affect the transaction size, or just the 10 that produced a result?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Stephen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stephen/32/102_2.png) [@Stephen](https://forum.canton.network/u/Stephen)\
**Post date:** [October 14, 2020, 4:50pm UTC](https://forum.canton.network/t/does-choice-input-data-get-stored-as-part-of-the-transaction/1464/2 "2020-10-14T16:50:12Z")

</div>

The entirety of every choice argument is stored as part of the transaction containing that exercise. That is the only way to be able to “validate” the transaction, meaning that an external process can take the transaction data and the DAML code and reevaluate it to confirm that the choice was carried out correctly and honestly.

The result value of a choice is also stored as part of the transaction; hypothetically a ledger client could “simply” take the arguments and reevaluate the choice code, but that is not exactly convenient, and the result is what most use cases really want.

The details of execution _are not_ stored with a transaction. Those lookups are evaluation steps; any client that cares exactly how a choice might be executed must instead take the choice arguments and reevaluate.

The usual way to refer to data indirectly in DAML is by contract key or contract ID. Either of these can be passed as a choice argument, whereupon the choice can lookup a contract already on the ledger by key or ID and retrieve it that way.

---

<div class="post-metadata">

**Author:** ![Stephen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stephen/32/102_2.png) [@Stephen](https://forum.canton.network/u/Stephen)\
**Post date:** [October 14, 2020, 5:16pm UTC](https://forum.canton.network/t/does-choice-input-data-get-stored-as-part-of-the-transaction/1464/3 "2020-10-14T17:16:51Z")

</div>

Apologies, I misinterpreted part of your post. Each lookup _will indeed_ be stored in the transaction as a [NodeLookupByKey](https://github.com/digital-asset/daml/blob/338f42f0505c1854faadbe392a6b20197d57bfd9/daml-lf/spec/transaction.rst#message-nodelookupbykey). (I had ordinary maps on the mind when reading your question, alas.)
