Can trusted Hardware (eg. sgx + town crier) replace most smart contract usecases or are they more complementary to each other?
How does trusted hardware like town crier work?
Trusted hardware works by having hardware that is physically difficult to examine or tamper with without destroying it, able to provide an attestation that they are running a particular program, signed by a key that is in turn signed by the hardware manufacturer.
It requires trust in the hardware manufacturer that there hardware really works as advertised and that their signing key has not leaked, and also the belief that the tamper-proofing is really secure enough for the purpose it is being used for.
Although you can (if the above works correctly) be sure that the operation carried out by trusted hardware was as described, you need someone to own and operate that hardware. If, whether by accident or by design, the hardware that you expected your program to be run on becomes unavailable, you may need the ability to switch to trusted hardware owned and operated by someone else.
A promising pattern is to store data that needs to be shared by multiple parties on the blockchain, but do some of the calculations on that data with trusted hardware. This gives you the benefit of faster / cheaper operation than you could get with a blockchain, and the ability to perform interactive processes on private data. By publishing the results on the blockchain, you can maintain a common view of the results of the trusted hardware operations that will outlast the operation of that particular piece of hardware.
In the Town Crier case, the system uses a secure enclave to create a proof that a web page was sent using an HTTPS page with a particular certificate. This proof can then be sent to a smart contract on a blockchain.
The same pattern is followed by Teechan, which uses trusted hardware to create payment channels to manage the ownership of a pot of money that has been locked on the blockchain until a timeout. Funds can be unlocked on the blockchain either based on a signed message by the trusted device or, should the trusted device become unavailable, once a timeout has elapsed.