Skip to content

What is a smart contract?

This page explains the handful of ideas you need before building a contract. No programming or blockchain knowledge required.

Signum is a blockchain: a record of who owns what and who sent what to whom, kept by many computers around the world at once. No company runs it, and nobody can quietly change what has been written into it.

The record grows in blocks. Roughly every four minutes a new block is added, holding everything that happened since the last one.

To take part you need an account. An account has an id (an address like S-…) and a balance in SIGNA, Signum’s currency. You control your account with a passphrase, a set of secret words. Whoever knows the passphrase controls the account, so it never belongs in a website or a chat.

A wallet keeps your passphrase and signs on your behalf. SmartC Studio works with XT Wallet, a browser extension.

When you send SIGNA to someone, you create a transaction: from you, to them, this amount. A transaction can also carry a message, a short piece of text or data. Every transaction costs a small fee, which goes to the network.

A smart contract is a program that lives on the blockchain in an account of its own. It has a balance, like any account, but no one holds its passphrase. Only its code decides what it does.

A contract wakes up when a transaction arrives. It reads who sent it, how much, and what the message says, does what its code says (remember something, send SIGNA somewhere) and goes back to sleep. Running the code costs a little SIGNA, which every transaction pays for with its activation amount.

Because the code is on the blockchain, everyone can check what a contract will do, and nobody can change it afterwards, not even the person who wrote it. That’s what makes contracts trustworthy, and why testing before you publish matters so much.

Signum has two networks:

  • Mainnet, where SIGNA have real value;
  • Testnet, a copy for trying things out, where SIGNA are free and worth nothing.

You’ll build and test in the Studio, deploy to Testnet to try your contract for real, and only then go to Mainnet.

Contracts on Signum are written in SmartC, a programming language similar to C. SmartC Studio is the place to write them: it checks your code, runs tests, simulates the blockchain so you can watch your contract work, and publishes it when you’re ready.

You don’t need more theory to start. Try the quick start: it walks through a finished example. When you want to know why contracts work the way they do, read Signum & AT concepts.