# How can they attack?

There are four soldier squads planning to attack a town from the north, south, east, and west at the same time.

They are in their positions; now they just need to know when to attack. One of the squads sends a courier went to tell the other squads when to attack. The problem is, he might die. So all the squads need to know exactly when to attack together so no squad will attack without the other. But then they need to know that all the other squads actually got this message, and the man didn't died, and so on.

How can they attack?

• I modified the tags; not sure how I feel about their relevance. Feel free to change. Jul 5, 2020 at 23:05

This is known as the Two Generals' Problem.

Tom Scott made a video on this topic in 2019. He suggests solving this problem by making use of an idempotency key.

Otherwise, it is impossible because the generals would be led to an infinite regress of recieving and transmitting acknowledgement.

– pgp1
Jul 5, 2020 at 12:31
• So wanna give me a green tick?? lol Jul 5, 2020 at 12:32
• Idempotency actually refers to the sending of request multiple times but receiving it only once. Be sure that you cannot guarantee that plan of attack will always be successful. Jul 5, 2020 at 12:33
• Also if it is right, make sure to remove cipher tag Jul 5, 2020 at 12:39
• This feels like a bit of a strange answer to mark as a community wiki... Jul 5, 2020 at 23:03