Bitcoin Forum
May 05, 2024, 10:29:04 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is it possible to create a simple smart contract using bitcoin-cli?  (Read 184 times)
oshirowanen (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 10


View Profile
May 06, 2018, 07:12:31 PM
 #1

I have an interest in smart contracts.  For example, something simple like "bitcoin in a specific address cannot be spent until 2019-01-01".

How do I go about creating this using bitcoin-cli?

I already know how to create simple raw transactions and simple multisig raw transactions, but I can't seem to figure out how to create simple smart contracts, specifically timelocks.
1714904944
Hero Member
*
Offline Offline

Posts: 1714904944

View Profile Personal Message (Offline)

Ignore
1714904944
Reply with quote  #2

1714904944
Report to moderator
"If you don't want people to know you're a scumbag then don't be a scumbag." -- margaritahuyan
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
RGBKey
Hero Member
*****
Offline Offline

Activity: 854
Merit: 658


rgbkey.github.io/pgp.txt


View Profile WWW
May 06, 2018, 08:21:37 PM
Merited by ABCbits (2)
 #2

Bitcoin doesn't really have "smart contracts" per se. It does have a scripting system though, which is generally how timelock transactions are created.

It looks like what you want is possible through the CreateRawTransaction RPC method available through bitcoin-cli. Just scroll down to Parameter #3—locktime for details on how to use it.

It's possible there's an easier way to do it, but this is the first thing that I saw looking through the API docs.
Membrana.io
Member
**
Offline Offline

Activity: 217
Merit: 10

Trust management of Digital Assets


View Profile WWW
May 07, 2018, 10:06:42 AM
 #3

Bitcoin doesn't really have "smart contracts" per se. It does have a scripting system though, which is generally how timelock transactions are created.

It looks like what you want is possible through the CreateRawTransaction RPC method available through bitcoin-cli. Just scroll down to Parameter #3—locktime for details on how to use it.

It's possible there's an easier way to do it, but this is the first thing that I saw looking through the API docs.
So many people wan to use btc in smart-contracts, but i know from that forum, that it is impossible....
Smart contracts it is only Ethereum, or something else?

▷▷▷ MEMBRANA PLATFORM ◁◁◁
⧮ Trust management of Digital Assets ⧮
⟥     membrana.io     ⟤
veleten
Legendary
*
Offline Offline

Activity: 2016
Merit: 1106



View Profile
May 07, 2018, 04:17:22 PM
Last edit: May 08, 2018, 08:31:25 AM by veleten
 #4

Bitcoin doesn't really have "smart contracts" per se. It does have a scripting system though, which is generally how timelock transactions are created.

It looks like what you want is possible through the CreateRawTransaction RPC method available through bitcoin-cli. Just scroll down to Parameter #3—locktime for details on how to use it.

It's possible there's an easier way to do it, but this is the first thing that I saw looking through the API docs.
So many people wan to use btc in smart-contracts, but i know from that forum, that it is impossible....
Smart contracts it is only Ethereum, or something else?


many other cryptocurrencies are smart contract friendly
for example:1. EOS asynchronous smart contracts,their declared aim,by the way, is to be able to process hundreds of thousands if not millions of transactions per second
2.Qtum -POS smart contracts,able to run both Eth and BTC applications
mostly large business oriented
3.ADA -the self proclaimed "ETH killer",next generation smart contract platform,potentially issuing their own credit card too
took the market by the storm and keeps gaining momentum and capitalisation

speaking of bitcoin+smart contracts:
particl.io is managing funds in  their trustless escrow ,using smart contracts
https://bitcoinmagazine.com/articles/yes-bitcoin-can-do-smart-contracts-and-particl-demonstrates-how/
think there are much more examples,but to use bitcoin blockchain for smart contracts is like if you are hammering nails with a screwdriver-technologically possible,but really unneccessary and awkward

          ▄▄████▄▄
      ▄▄███▀    ▀███▄▄
   ▄████████▄▄▄▄████████▄
  ▀██████████████████████▀
▐█▄▄ ▀▀████▀    ▀████▀▀ ▄▄██
▐█████▄▄ ▀██▄▄▄▄██▀ ▄▄██▀  █
▐██ ▀████▄▄ ▀██▀ ▄▄████  ▄██
▐██  ███████▄  ▄████████████
▐██  █▌▐█ ▀██  ██████▀  ████
▐██  █▌▐█  ██  █████  ▄█████
 ███▄ ▌▐█  ██  ████████████▀
  ▀▀████▄ ▄██  ██▀  ████▀▀
      ▀▀█████  █  ▄██▀▀
         ▀▀██  ██▀▀
.WINDICE.████
██
██
██
██
██
██
██
██
██
██
██
██
████
      ▄████████▀
     ▄████████
    ▄███████▀
   ▄███████▀
  ▄█████████████
 ▄████████████▀
▄███████████▀
     █████▀
    ████▀
   ████
  ███▀
 ██▀
█▀

██
██
██
██
██
██
██
██
██
██
██
██
     ▄▄█████▄   ▄▄▄▄
    ██████████▄███████▄
  ▄████████████████████▌
 ████████████████████████
▐████████████████████████▌
 ▀██████████████████████▀
     ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
     ▄█     ▄█     ▄█
   ▄██▌   ▄██▌   ▄██▌
   ▀▀▀    ▀▀▀    ▀▀▀
       ▄█     ▄█
     ▄██▌   ▄██▌
     ▀▀▀    ▀▀▀

██
██
██
██
██
██
██
██
██
██
██
██
                   ▄█▄
                 ▄█████▄
                █████████▄
       ▄       ██ ████████▌
     ▄███▄    ▐█▌▐█████████
   ▄███████▄   ██ ▀███████▀
 ▄███████████▄  ▀██▄▄████▀
▐█ ▄███████████    ▀▀▀▀
█ █████████████▌      ▄
█▄▀████████████▌    ▄███▄
▐█▄▀███████████    ▐█▐███▌
 ▀██▄▄▀▀█████▀      ▀█▄█▀
   ▀▀▀███▀▀▀
████
  ██
  ██
  ██
  ██
  ██
  ██
  ██
  ██
  ██
  ██
  ██
  ██
████


▄▄████████▄▄
▄████████████████▄
▄████████████████████▄
███████████████▀▀  █████
████████████▀▀      ██████
▐████████▀▀   ▄▄     ██████▌
▐████▀▀    ▄█▀▀     ███████▌
▐████████ █▀        ███████▌
████████ █ ▄███▄   ███████
████████████████▄▄██████
▀████████████████████▀
▀████████████████▀
▀▀████████▀▀
iePlay NoweiI
I
I
I
[/t
liverock
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
May 08, 2018, 05:00:51 AM
 #5

The bitcoin network does not support Smart Contracts.
Try Ethereum.
QTUM has an additional abstract layer that is compatible to both Bitcoin and Ethereum.
arunchain
Copper Member
Newbie
*
Offline Offline

Activity: 107
Merit: 0


View Profile
May 09, 2018, 06:24:03 AM
 #6

Well now a days Bitcoin also supports smart contracts, not directly but definitely

Rest, ping me on Telegram: @arunsachdeva for further better and smooth communication
pebwindkraft
Sr. Member
****
Offline Offline

Activity: 257
Merit: 343


View Profile
May 09, 2018, 06:59:43 PM
 #7

too many people throw their Blabla statements "bitcoin has no smart contracts" - this is simply not true. Counter question would be how these people understand smart contracts, and usually they confuse this with a "turing complete" language. I did a summary of smart contracts with some links here:
https://bitcointalk.org/index.php?topic=2204938.msg23664225#msg23664225

Anyhow, I posted an answer to your request on bitcoin.stackexchange.
I try to show the steps at the command line, starting easy with a simple secret and an OP_IF/ELSE/ENDIF statement:
https://bitcoin.stackexchange.com/questions/74753/
r1s2g3
Sr. Member
****
Offline Offline

Activity: 742
Merit: 395


I am alive but in hibernation.


View Profile
May 12, 2018, 09:50:40 PM
 #8

I have an interest in smart contracts.  For example, something simple like "bitcoin in a specific address cannot be spent until 2019-01-01".

How do I go about creating this using bitcoin-cli?

I already know how to create simple raw transactions and simple multisig raw transactions, but I can't seem to figure out how to create simple smart contracts, specifically timelocks.

I think the example you are giving is implemented by timelocks.
AFIAK the smart contracts on bitcoin can be done using rootstock (RSK). It is open source platform and RSK work as bitcoin sidechain.
You can get more information about them in their site https://www.rsk.co/

I am alive
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!