Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Slock

Basic description with a little bit of technical detail.
by

Christoph Jentzsch

on 1 December 2016

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Slock

PROBLEM
your property
How to rent/sell/share it?
payment
organization
matchmaking
security
...
SOLUTION
User
UNDER THE HOOD
MEET THE TEAM
Ethereum
User
Smart Contract
Smart lock connected to ethereum blockchain
Owner
set deposit
set price per time unit
open/close (restricted)
pays deposit (sets him as current user)
open / reopen
close
smart lock
bluetooth
z-wave
contract Etherlock {
event Open();
event Close();

function Etherlock(uint _deposit, uint _price, uint _timeBlock) {
owner = msg.sender;
isOpen = 0;
deposit = _deposit;
price = _price;
if (_timeBlock == 0){
timeBlock = 1;
}
else{
timeBlock = _timeBlock;
}
openTime = block.timestamp;
user = msg.sender;
}

function setDeposit(uint _deposit) {
if (msg.sender != owner) return;
deposit = _deposit;
}

function setPrice(uint _price) {
if (msg.sender != owner) return;
price = _price;
}

function setTimeBlock(uint _timeBlock) {
if (msg.sender != owner) return;
timeBlock = _timeBlock;
}

// return cost in wei
function costs() returns (uint ret) {
return price * ((block.timestamp - openTime) + timeBlock) / timeBlock;
}

function open() {
if (msg.sender == owner || msg.sender == user) { // reopen
isOpen += 1;
Open();
return;
}
if (isOpen > 0 || msg.value < deposit){
msg.sender.send(msg.value); // give money back
}
else {
isOpen += 1;
Open();
openTime = block.timestamp;
user = msg.sender;
}
}

function close() {
if (isOpen == 0) return;
if (msg.sender == owner && user == owner) {isOpen = 0; Close(); return;}
if (msg.sender == user){
uint cost = costs();
if (cost > deposit){
owner.send(deposit);
}
else{
user.send(deposit - cost);
owner.send(cost);
}
isOpen = 0;
user = owner;
Close();
}
}

function closedByOwner() {
if (msg.sender != owner){
return;
}
uint cost = price * (block.timestamp - openTime);
if (costs() > deposit){
owner.send(deposit);
isOpen = 0;
user = owner;
}
}

address owner;
uint deposit;
uint price;
address user;
uint isOpen;
uint openTime;
uint closeTime;
uint timeBlock;
}

A lock that can be opened by paying money
Owner
pays deposit
sets deposit and price
returns deposit - costs
receive costs
?
Christoph Jentzsch
Simon Jentzsch
used only ~5% of the time
source code of smart contract
open/close
Full transcript