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.it - devcon1

Basic description of Slock.it, including the DAO
by

Christoph Jentzsch

on 28 January 2016

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Slock.it - devcon1

PROBLEM
your property
How to rent/sell/share it?
payment
organization
matching users
security
...
SOLUTION
User
UNDER THE HOOD
MEET THE TEAM
User
Smart Contract
Smart lock connected to ethereum blockchain
Owner
set deposit
set price
open/close (restricted)
pays deposit
open / reopen
close
bluetooth z-wave zigbee
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 directy opened by paying it
Owner
pays deposit
sets
deposit and price
returns
deposit - costs
receive payment
Christoph Jentzsch
Simon Jentzsch
used only ~5% of the time
source code of smart contract
open/close
BUSINESS MODEL
Stephan Tual
DAO
Service provider
Tasks:
Fund the development
Vote on major decisions
Control the funds (!)
Profitable
Smart Contract
contract SlockCrowdfunding
{

mapping (address => uint) distro; // value is amount of wei (smallest unit of ether) given in crowdsale by an individual supporter
mapping (address => uint) payedOut; // value is amount of wei already payed out to the individual supporter
uint totalWeiReceived; // total number of wei received if the crowdsale is successful, only non-zero after pay out to Slock (sum of all distro[...] )
uint withdrawn; // total amount of wei already withdrawn through supporters (sum of all payedOut[...] )
uint closingTime; // end of crowdsale
uint minValue; // minimal goal of crowdsale

//constructor - set timeframe and minimal goal initiating the crowdsale
function SlockCrowdfunding(uint _minValue, uint _closingTime) {
minValue = _minValue;
closingTime = _closingTime;
}

// contribute to the crowdsale (fallback function, called when no other function is called, no data given in transaction). It is also called when receiving money from the Slock smart contract
function()
{
if (now <= closingTime) distro[msg.sender] += msg.value;
}

// if the minimal goal was not reached, give back the money to the supporters
function refund() external
{
if (now > closingTime && this.balance < minValue && totalWeiReceived == 0 || payedOut[msg.sender] == 0 )
{
if (msg.sender.send(distro[msg.sender])) payedOut[msg.sender] = 1;
}
}
//the purpose of this function is to send all the money to Slock GmbH (The Slock Trustees) if the crowdsale is successful.
function finalize() external
{
if (now > closingTime && msg.sender == 0x510c && totalWeiReceived == 0 && this.balance >= minValue)
{
if (msg.sender.send(totalWeiReceived)) totalWeiReceived = this.balance;
}
}

// after the crowdsale is over, this function can be called to get the portion of the fees (which will be paid to this account) according to the contribution made
function receiveDividends()
{
address sender = msg.sender;
// as long as totalWeiReceived is zero (prior to finalize), myShare will always be zero since x / 0 = 0 in the EVM.
uint myShareInPercent = distro[sender] / totalWeiReceived;
uint totalDividends = this.balance + withdrawn;
uint myDividends = myShareInPercent * totalDividends - payedOut[sender];
if (myDividends != 0 && sender.send(myDividends))
{
payedOut[sender] += myDividends;
withdrawn +=myDividends;
}
}

// transfer (part of) your contribution to another address
function transfer(uint _value, address _to) external returns (bool _success)
{
receiveDividends();
address sender = msg.sender;
uint myShares = distro[msg.sender];
if (_value <= myShares){
distro[msg.sender] -= _value;
distro[_to] += _value;
uint fraction = _value / myShares;
payedOut[_to] += payedOut[msg.sender] * fraction;
payedOut[msg.sender] -= payedOut[msg.sender] * fraction;
_success = true;
}
_success = false;
}

function balanceOf(address _addr) constant returns (uint _r)
{
_r = distro[_addr];
}
}
Reward
Reward
PRODUCTS
Slock Home Server
supports:
Z-Wave
Zigbee
Bluetooth LE

Slock Power Switch
Slock Door Lock
Slock Bike Lock
Slock Pad Lock
Slock Car Lock
In Progress
(with partners)
Slock
Token
Tasks:
Produce Slocks
Marketing
Partnerships
tasks & orders
% fee of every transaction
one time deployment fee
IoT + Blockchain
Ethereum blockchain is one big open API
(Source: Industrial IP Advantage)
Vote
@slockitproject
presented by Christoph Jentzsch
Full transcript