A warrant canary is a method by which a communications service provider aims to inform its users that the provider has not been served with a secret government subpoena.
Source: Wikipedia
In general, it can be used to spawn a public notification on some event in cases where the user is not allowed to do so, either because of law enforcements or for some other reason.
It can also be used to prove that the owner of a canary was alive at a given time.
Because blockchain transactions are irreversible and smart contract's state can be inspected at any time.
Even if you choose to host your own canary in form of, for example, weekly-updatable PGP-signed message, you should take care of it's availability, and no matter how much you pay for a hosting service, the server may go down, creating uncertainity. Blockchain eliminates that problem.
To control canary's operation, two-level permission system is used, which divides all users in two groups: owners and confidants.
Owners can:
- update canary
- add owners
- remove owners
- add confidants
- remove confidants
Confidants can:
- update canary
All the users, also including all the people aside (who have no permissions at all) can trigger CanaryDied
event if the canary was not updated by the time set at aliveUntil
.
Fired on canary updates.
Fired on update interval changes. Fields are: event triggering initiator, old value, new value.
Fired only after canary's death. Arguments are: event triggering initiator, time of death, last update.
Constructor of the contract. Arguments are: update interval (in seconds) and description of the canary.
Update the canary (has effect only if called by owners or confidants).
Set update interval.
Get probable death time.
Fire CanaryDied
event if the canary is dead.
Add new owner. Can be called by owners only.
Remove existing owner. Can be called by owners only.
Add new confidant. Can be called by owners only.
Remove existing confidant. Can be called by owners only.
Permits execution iff canary is alive.
Permits execution only if msg.sender
is owner.
Permits execution if msg.sender
is owner or confidant.
WTFPL