Bitcoin Forum
May 27, 2024, 01:21:32 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Ardor Lightweight Contracts - Trustless Scenario?  (Read 109 times)
d5000 (OP)
Legendary
*
Offline Offline

Activity: 3920
Merit: 6392


Decentralization Maximalist


View Profile
August 21, 2018, 05:11:41 PM
 #1

Hi,
as some of you may know, Ardor just released its "Lightweight Contracts" feature to Testnet. Basically, they are "smart contracts that not necessarily have to be run by every node". As I understand them, they seem to have some things in common with Lisk's sidechain DAPPs.

As I read in the FAQ, their main drawback is that they are not totally trustless, because you cannot guarantee the "contract owner" really runs the contract.

So for example, if the contract is an "exchange contract" that should give you some token for ARDR (e.g. this one), then if the contract owner doesn't run the contract, you won't get the tokens (and the contract owner could steal your ARDR).

You can run the contract yourself, but AFAIK you can't achieve that the "contract owner" signs the exchange transaction without himself running it - you can only validate that the contract does what he should do according to the source code.

But what if you do the following:
- You first run the contract yourself and calculate the "expected transaction" that should result from it, based on the input from your planned transaction (in this case, the transaction that rewards you with tokens from your ARDR).
- You now issue a phased transaction ("conditional transaction") with the condition of the "expected transaction" - in the exchange case, that you receive the calculated token amount from the contract account.
- If the contract doesn't run or doesn't give you the expected token amount, the transaction expires at some block in the future.

This way, the contract owner can only spend the resulting coins when the contract owner runs the contract. So you are safe from "selective scammers" that run contracts once and then never again.

The contract owner is also safe: He can run the contract first and check that he really is able to produce the desired transaction. If not, then he simply doesn't issue the "expected transaction". So nothing happens (only that we have an useless phased transaction recorded on the blockchain, but I think that is a minor issue).

Is this scenario possible? I haven't read it in the discussions about Lightweight contracts. If not, I think it would be a nice addition, as then Lighweight Contracts would be as trustless (or almost as trustless) as Ethereum Smart Contracts (or even more, as Ethereum contracts can run out of gas).

I hope there are some Ardor folks here that could enlighten me. Otherwise I'll ask this question at Reddit.

Cheers, d5000

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
d5000 (OP)
Legendary
*
Offline Offline

Activity: 3920
Merit: 6392


Decentralization Maximalist


View Profile
August 22, 2018, 08:15:11 PM
 #2

Update: I asked the question on Stackexchange: https://bitcoin.stackexchange.com/questions/78506/ardor-lightweight-contracts-almost-trustless-way-with-new-phased-transaction

But if there is someone wanting to respond here, be welcome!

A little addition: Reading the Phased Transaction wiki page it seems that for the scenario a slightly different "phased transaction" type is needed  - one that can require parts of a transaction, like a specific amount of ARDR or tokens that has to be sent to an Ardor address.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!