Author

Topic: Is it possible to create a simple smart contract using bitcoin-cli? (Read 198 times)

sr. member
Activity: 742
Merit: 395
I am alive but in hibernation.
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/
sr. member
Activity: 257
Merit: 343
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://bitcointalksearch.org/topic/m.23664225

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/
copper member
Activity: 107
Merit: 0
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
newbie
Activity: 1
Merit: 0
The bitcoin network does not support Smart Contracts.
Try Ethereum.
QTUM has an additional abstract layer that is compatible to both Bitcoin and Ethereum.
legendary
Activity: 2016
Merit: 1107
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
member
Activity: 217
Merit: 10
Trust management of Digital Assets
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?
hero member
Activity: 854
Merit: 658
rgbkey.github.io/pgp.txt
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.
newbie
Activity: 25
Merit: 10
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.
Jump to: