> For the complete documentation index, see [llms.txt](https://vanetchain.gitbook.io/vanetchain/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vanetchain.gitbook.io/vanetchain/documentation/blockchain-for-vanet.md).

# Blockchain for VANET

To solve the message trust problem in VANET we will try to implement a blockchain for VANET.The event messages at bitcoin network are the cryptocurrency transactions. For our VANET network, the messages are the event messages that occur at VANET.These are, accident information, traffic jam, road conditions like rainy, ice etc.... A node sends the event information at a location (for example: accidents at location x.) to the chain. The node must have a location certificate. Firstly, the node gets its location certificate by a secure transaction  by communicating with a central Vanet node like RSU. By getting the location certificate , the node gets in the blockchain.

After joining the chain, the node will download all the blockchain, that consists of all the event messages that was distributed from all the nodes in the chain. The vehicle that encounters the event, will broadcast the event message to the chain.In the chain, the other vehicles will dissect message and check node location certificate firstly. If the embedded location certificate is valid, the event message will be inspected and if suitable will be added as a transaction to the current block.

The event messages consists of the following fields.

* Location: The event coordinates
* Timestamp: The event timestamp(Unix epoch time)
* Direction: The nodes direction while sending the event information(east,west,north,south)
* Location Weight: The location weight of the node calculated by location certificate and distance to the event area.
* Communication Technology: The technology used by node for message transmission(5g,lora,wifi)
* Event\_id: The id of the event (accident, traffic\_busy,parking )

By generating the event, if the data is inspected and found suitable by the other vehicles, it is added to the blockchain as a transaction. The example transactions are:

<figure><img src="/files/yyTTKnTLf7ip1FIy4fO7" alt=""><figcaption></figcaption></figure>
