Hey there, human — the robots need you! Vote for IEEE’s Robots Guide in the Webby Awards.

Close bar

How Smart Contracts Work

Blockchain technology could run a flight-insurance business without any employees

1 min read
Illustration: Greg Mably
Illustration: Greg Mably

special report icon

Smart contracts are software programs that live on a blockchain and form the basis of many of the new blockchain applications and schemes. They are essentially automated systems that can provide services in exchange for cryptocurrency. However, because blockchains are not good for storing large amounts of data nor for querying the state of the outside world, they need services that exist off the blockchain to do those things for them. In this example, an automated flight-insurance smart contract uses an “oracle” to look up data about flight delays.

  • imgAll illustrations: Greg Mably

    Step 1

    A passenger requests flight insurance by sending ethers to a smart contract—an application that exists on the Ethereum blockchain—along with her flight information.

  • img

    Step 2

    The smart contract sends a request to an “oracle”— a service that exists outside the blockchain—to verify the flight details and gather historical information about that route.

  • img

    Step 3

    The smart contract then uses that information to determine if the offered premium is adequate. If the smart contract accepts the premium, it then asks the oracle to report on the status of the flight in question.

  • img

    Step 4

    The oracle uses information from RealTimeFlightData to report the status of the flight to the smart contract.

  • img

    Step 5

    If the flight is delayed, the contract pays the passenger. If the flight is on time, the contract pays itself.

See “Blockchains: How They Work and Why They’ll Change the World.”

This article is for IEEE members only. Join IEEE to access our full archive.

Join the world’s largest professional organization devoted to engineering and applied sciences and get access to all of Spectrum’s articles, podcasts, and special reports. Learn more →

If you're already an IEEE member, please sign in to continue reading.

Membership includes:

  • Get unlimited access to IEEE Spectrum content
  • Follow your favorite topics to create a personalized feed of IEEE Spectrum content
  • Save Spectrum articles to read later
  • Network with other technology professionals
  • Establish a professional profile
  • Create a group to share and collaborate on projects
  • Discover IEEE events and activities
  • Join and participate in discussions