# Query Processing in Blockchain Systems: Current State and Future Challenges
## 4 Object Types in Blockchains
For these queries, however, it is not relevant in which block the measurement is included, but at which time it was performed (nota bene: Due to the delayed insertion of data into the blockchain, not only the timestamp of a measurement can significantly differ from the timestamp of the block it is stored in, but also the chronological order in which measurements are captured can differ from the order within the blocks.). Thus, in the first example, the timestamp of the block is relevant, but in the second example, the timestamp of the object is relevant. For this reason, we introduce the following notion for timestamps on objects:  
**Block-Dependent. ** In this case, the object depends on the timestamp of the block it was included in. Each block has its own timestamp, i.e., the time at which it was created. Here,  
Figure 2: Two different use cases utilizing constant objects with (a) block-dependent timestamps and (b) object-dependent timestamps. the timestamp of a block acts as a global timestamp for all its payload data, superseding possible timestamp attributes of objects, thus all objects in a block have the same timestamp. **Object-Dependent. ** In this case, the object has its own timestamp attribute. Additionally, it is not relevant in which block this object was included. During query processing, the timestamps of these objects must be considered instead of the timestamp of a block. However, this entails new challenges. In a blockchain architecture, there is no guarantee that the objects are sorted by the timestamp attribute of the objects. As a result, when searching for an object with a specific timestamp, it can only be assumed that the object was created earlier than the block that includes it. Thus, the lower search bound is set by the timestamp of the object, however, no statement can be made about the upper search bound. Whether an object has a block-dependent or an object-dependent timestamp is determined by its further usage. In our e-voting example, the action is to cast a vote and this is considered to be performed once it is correctly added to the blockchain. In our health data management example, the action is a blood pressure measurement carried out by an IoT medical device, which is considered to be performed once the measurement is successfully completed. This action is completely independent of the creation of a block for a blockchain. Expandable objects are, for example, documents in land registries (see Figure 3). An expandable object consists of a genesis object (i.e., the source object) as well as modifications to the object that are scattered over numerous blocks. As a result, it has as many states (i.e., document revisions) as how many blocks exist that include fields of this object. In land registries, land documents are inserted, modified, and deleted over time. When a land document is modified, it means that fields of the document are modified, new fields are added, or existing fields are removed. The result of a modification is a new state of the expandable object. Thus, each block that include a modification of an expandable object represents a different state of this very object. A land registry advisor can query these land documents at any available state. For this, the requested state of the document has to be computed. To compute a state of an expandable object, all fields from the previous and the requested block must be combined. This is done by recursively recombining the fields from the first block that includes fields of the object until the requested state--this approach is also called _left-folding_. In our land registry example, the object first appeared in Block 10, the so-called genesis object. After that, there have been two modifications to it, namely in Block 33 and Block 89. This means that there are three states for this object, all of which can be queried. Querying its state in Block 10 is simple, since no modifications have taken place yet.