# Logs

L1 to L2 Transactions represent the transfer of assets or data from the Layer 1 (L1) blockchain (typically Ethereum mainnet) to the Layer 2 (L2) blockchain. These transactions are crucial for users to move their assets to the L2 network, enabling faster and cheaper transactions while maintaining the security guarantees of the L1 network.

## ETL data class

| Column Name           | Data Type | Note |
| --------------------- | --------- | ---- |
| index                 | int       |      |
| l1\_block\_number     | int       |      |
| l1\_block\_timestamp  | timestamp |      |
| l1\_block\_hash       | str       |      |
| l1\_transaction\_hash | str       |      |
| l1\_from\_address     | str       |      |
| l1\_to\_address       | str       |      |
| l2\_block\_number     | int       |      |
| l2\_block\_timestamp  | timestamp |      |
| l2\_block\_hash       | str       |      |
| l2\_transaction\_hash | str       |      |
| l2\_from\_address     | str       |      |
| l2\_to\_address       | str       |      |
| amount                | decimal   |      |
| from\_address         | str       |      |
| to\_address           | str       |      |
| l1\_token\_address    | str       |      |
| l2\_token\_address    | str       |      |
| extra\_info           | json      |      |
| \_type                | int       |      |
| deposit\_hash         | str       |      |

Examples

```json
{
  "index": 218,
  "l1_block_number": 18126236,
  "l1_block_timestamp": "2023-09-13T00:36:23.000Z",
  "l1_block_hash": null,
  "l1_transaction_hash": "0xca4f846d51cac9cf70369b01818fc1af0221dbd5dd8e011fdb00c7a161ee3027",
  "l1_from_address": "0xa5f146cbd3ee13f482315dd0f873c2bfbbc5f2c4",
  "l1_to_address": "0x3b95bc951ee0f553ba487327278cac44f29715e5",
  "l2_block_number": 37037,
  "l2_block_timestamp": "2023-09-13T00:38:49.000Z",
  "l2_block_hash": null,
  "l2_transaction_hash": "0xbfb147979b46b4caf21c7f7851eac6191dfdd4bf59e78c274c0e461752e9a65e",
  "l2_from_address": "0x746ca609680c55c3bdd0b3627b4c5db21b13d421",
  "l2_to_address": "0x4200000000000000000000000000000000000007",
  "amount": 5000000000000000,
  "from_address": "0xa5f146cbd3ee13f482315dd0f873c2bfbbc5f2c4",
  "to_address": "0xa5f146cbd3ee13f482315dd0f873c2bfbbc5f2c4",
  "l1_token_address": "0x0000000000000000000000000000000000000000",
  "l2_token_address": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead1111",
  "extra_info": {
    "sender": "0x3b95bc951ee0f553ba487327278cac44f29715e5",
    "target": "0x4200000000000000000000000000000000000010",
    "gas_limit": 200000,
    "tx_origin": "0x746ca609680c55c3bdd0b3627b4c5db21b13d421"
  },
  "_type": null,
  "deposit_hash": null
}
```

```csv
218,18126236,2023-09-13T00:36:23.000Z,,0xca4f846d51cac9cf70369b01818fc1af0221dbd5dd8e011fdb00c7a161ee3027,0xa5f146cbd3ee13f482315dd0f873c2bfbbc5f2c4,0x3b95bc951ee0f553ba487327278cac44f29715e5,37037,2023-09-13T00:38:49.000Z,,0xbfb147979b46b4caf21c7f7851eac6191dfdd4bf59e78c274c0e461752e9a65e,0x746ca609680c55c3bdd0b3627b4c5db21b13d421,0x4200000000000000000000000000000000000007,5000000000000000,0xa5f146cbd3ee13f482315dd0f873c2bfbbc5f2c4,0xa5f146cbd3ee13f482315dd0f873c2bfbbc5f2c4,0x0000000000000000000000000000000000000000,0xdeaddeaddeaddeaddeaddeaddeaddeaddead1111,"{""sender"": ""0x3b95bc951ee0f553ba487327278cac44f29715e5"", ""target"": ""0x4200000000000000000000000000000000000010"", ""gas_limit"": 200000, ""tx_origin"": ""0x746ca609680c55c3bdd0b3627b4c5db21b13d421""}",,,
```

## Model in the Database

| Column Name           | Data Type   | Note |
| --------------------- | ----------- | ---- |
| index                 | bigint      |      |
| l1\_block\_number     | bigint      |      |
| l1\_block\_timestamp  | timestamp   |      |
| l1\_block\_hash       | varchar(66) |      |
| l1\_transaction\_hash | varchar(66) |      |
| l1\_from\_address     | varchar(42) |      |
| l1\_to\_address       | varchar(42) |      |
| l2\_block\_number     | bigint      |      |
| l2\_block\_timestamp  | timestamp   |      |
| l2\_block\_hash       | varchar(66) |      |
| l2\_transaction\_hash | varchar(66) |      |
| l2\_from\_address     | varchar(42) |      |
| l2\_to\_address       | varchar(42) |      |
| amount                | numeric(78) |      |
| from\_address         | varchar(42) |      |
| to\_address           | varchar(42) |      |
| l1\_token\_address    | varchar(42) |      |
| l2\_token\_address    | varchar(42) |      |
| extra\_info           | jsonb       |      |
| \_type                | integer     |      |
| deposit\_hash         | varchar     |      |

```json
{
  "index": 218,
  "l1_block_number": 18126236,
  "l1_block_timestamp": "2023-09-13 00:36:23.000000",
  "l1_block_hash": null,
  "l1_transaction_hash": "0xca4f846d51cac9cf70369b01818fc1af0221dbd5dd8e011fdb00c7a161ee3027",
  "l1_from_address": "0xa5f146cbd3ee13f482315dd0f873c2bfbbc5f2c4",
  "l1_to_address": "0x3b95bc951ee0f553ba487327278cac44f29715e5",
  "l2_block_number": 37037,
  "l2_block_timestamp": "2023-09-13 00:38:49.000000",
  "l2_block_hash": null,
  "l2_transaction_hash": "0xbfb147979b46b4caf21c7f7851eac6191dfdd4bf59e78c274c0e461752e9a65e",
  "l2_from_address": "0x746ca609680c55c3bdd0b3627b4c5db21b13d421",
  "l2_to_address": "0x4200000000000000000000000000000000000007",
  "amount": 5000000000000000,
  "from_address": "0xa5f146cbd3ee13f482315dd0f873c2bfbbc5f2c4",
  "to_address": "0xa5f146cbd3ee13f482315dd0f873c2bfbbc5f2c4",
  "l1_token_address": "0x0000000000000000000000000000000000000000",
  "l2_token_address": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead1111",
  "extra_info": {
    "sender": "0x3b95bc951ee0f553ba487327278cac44f29715e5",
    "target": "0x4200000000000000000000000000000000000010",
    "gas_limit": 200000,
    "tx_origin": "0x746ca609680c55c3bdd0b3627b4c5db21b13d421"
  },
  "_type": null,
  "deposit_hash": null
}
```

```csv
218,18126236,2023-09-13 00:36:23.000000,,0xca4f846d51cac9cf70369b01818fc1af0221dbd5dd8e011fdb00c7a161ee3027,0xa5f146cbd3ee13f482315dd0f873c2bfbbc5f2c4,0x3b95bc951ee0f553ba487327278cac44f29715e5,37037,2023-09-13 00:38:49.000000,,0xbfb147979b46b4caf21c7f7851eac6191dfdd4bf59e78c274c0e461752e9a65e,0x746ca609680c55c3bdd0b3627b4c5db21b13d421,0x4200000000000000000000000000000000000007,5000000000000000,0xa5f146cbd3ee13f482315dd0f873c2bfbbc5f2c4,0xa5f146cbd3ee13f482315dd0f873c2bfbbc5f2c4,0x0000000000000000000000000000000000000000,0xdeaddeaddeaddeaddeaddeaddeaddeaddead1111,"{""sender"": ""0x3b95bc951ee0f553ba487327278cac44f29715e5"", ""target"": ""0x4200000000000000000000000000000000000010"", ""gas_limit"": 200000, ""tx_origin"": ""0x746ca609680c55c3bdd0b3627b4c5db21b13d421""}",,,
```
