I Just Wrote a Stellar Smart Contract

“A smart contract is a set of promises, specified in digital form, including protocols within which the parties perform on these promises.”

The Problem

Ethereum != Right Choice

npm install -g truffle
cd ~/smartContract
truffle init
A Stellar Smart Contract… Da Fuq?

Stellar Smart Contracts… Yes I Just Wrote That

IF HOUSE BUILT --> pay Bob, Charlie, Diego
ELSE --> pay Bob, Charlie

PROBLEM:

Consider the user A who seeks to pay B,C,D for a service. If the service succeeds, B,C, and D are paid. If the service fails, only B and C are paid. B is a trusted party, capable of determining whether the service succeeds or fails.

SETUP:

A
balance: 9 XLM
sequence #: 3
A constructs two transactions:TX A:
Sequence #4
Pay B 3 XLM
pay C 3 XLM
Pay D 3 XLM
TX B:
Sequence #4
Pay B 3 XLM
pay C 3 XLM
A signs both these transactions and gives them to B.

EXECUTION:

IF SUCCESS: B broadcasts TX A
ELSE : B broadcasts TX B

So Is This a Smart Contract?

“A smart contract is a set of promises, specified in digital form, including protocols within which the parties perform on these promises.”

So What, Who Cares?

--

--

--

Lumenaut. Mule. Software Engineer.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Team MAK x Kommunitas

Superfluid Community Call #9

Markets are a Distraction. Cradles Just Keeps on Building

iBG Finance

ZZZ/USDT Will be Available on CoinTiger at 18:00 on August 26th, 2020

Euler Tools is All-in-one platform to discover & explore blockchain content

Its coinbase time

Electric Capital Newsletter: №3 — March 2019

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rob Durst

Rob Durst

Lumenaut. Mule. Software Engineer.

More from Medium

BTC.com statement on starting ETC mining service

DMe Weekly Update

DMe Landing Page

AIOW #11 DEVELOPMENT UPDATE

Million Token Use Cases - What can I do with it?