A "packet on the blockchain" is called a block.
In order for a transaction to be included, it must be a valid transaction. This means it must consume outputs created by previous transactions, and those outputs must have some value associated with them. A Bitcoin transaction can include arbitrary data, however this is not advised as it harms the network.
i would add to that, miners take care of that job, veryfying if transaction is valid and can be added to blockchain