Differences/similarities of âBitcoin scriptâ and âEthereum smart contractâ?
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
Can we compare Bitcoin script
and Ethereum smart contract
?
And if yes,
What are differences/similarities of Bitcoin script and Ethereum smart contract in sense of functionality, architecture and how to interact with blockchain?
Does Bitcoin script run on-chain (similar to Ethereum smart contracts) or they run off-chain?
bitcoin terminology
add a comment |Â
up vote
4
down vote
favorite
Can we compare Bitcoin script
and Ethereum smart contract
?
And if yes,
What are differences/similarities of Bitcoin script and Ethereum smart contract in sense of functionality, architecture and how to interact with blockchain?
Does Bitcoin script run on-chain (similar to Ethereum smart contracts) or they run off-chain?
bitcoin terminology
2
As far as I've understood, the biggest difference is that Ethereum's engine is Turing-complete while Bitcoin's is not. Someone else will hopefully elaborate further.
â Lauri Peltonen
Aug 29 at 8:54
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
Can we compare Bitcoin script
and Ethereum smart contract
?
And if yes,
What are differences/similarities of Bitcoin script and Ethereum smart contract in sense of functionality, architecture and how to interact with blockchain?
Does Bitcoin script run on-chain (similar to Ethereum smart contracts) or they run off-chain?
bitcoin terminology
Can we compare Bitcoin script
and Ethereum smart contract
?
And if yes,
What are differences/similarities of Bitcoin script and Ethereum smart contract in sense of functionality, architecture and how to interact with blockchain?
Does Bitcoin script run on-chain (similar to Ethereum smart contracts) or they run off-chain?
bitcoin terminology
bitcoin terminology
asked Aug 29 at 8:52
sas
592210
592210
2
As far as I've understood, the biggest difference is that Ethereum's engine is Turing-complete while Bitcoin's is not. Someone else will hopefully elaborate further.
â Lauri Peltonen
Aug 29 at 8:54
add a comment |Â
2
As far as I've understood, the biggest difference is that Ethereum's engine is Turing-complete while Bitcoin's is not. Someone else will hopefully elaborate further.
â Lauri Peltonen
Aug 29 at 8:54
2
2
As far as I've understood, the biggest difference is that Ethereum's engine is Turing-complete while Bitcoin's is not. Someone else will hopefully elaborate further.
â Lauri Peltonen
Aug 29 at 8:54
As far as I've understood, the biggest difference is that Ethereum's engine is Turing-complete while Bitcoin's is not. Someone else will hopefully elaborate further.
â Lauri Peltonen
Aug 29 at 8:54
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
5
down vote
There are a couple of differences between Bitcoin scripts and Ethereum smart contracts.
USE
BITCOIN
In bitcoin the transaction have a different format from Ethereum:
A transaction typically references previous transaction outputs as new transaction inputs and dedicates all input Bitcoin values to new outputs.
So a transaction is formed by one or more transaction input (i.e., the output of previous transactions) and one or more transaction output.
The transaction outputs specify a locking script (e.g. "only the user with the private key corresponding to address 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2 can unlock this script") that defines the condition to spend the output. Whenever the transaction output is used as input in a new transaction, it must contain an unlocking script that "solves" the locking script. Those script are specified with the bitcoin script.
So, the scripts are used in Bitcoin to validate the transaction, therefore they should be run on chain, i.e. by each full node in the network.
ETHEREUM
The transactions do not reference previous transactions, because Ethereum stores directly the world-state (In bitcoin the state corresponds to the list of unspent transaction outputs (UTXO)).
In Ethreum a transaction may trigger the execution of a smart-contract if the receiver of the message call is a contract account or it may create a contract that persists on the world state.
In Ethereum the smart-contracts can be used to write applications on top of Ethereum.
Similarity/Differences
Both the execution environments of Ethereum smart contracts and Bitcoin scripts are stack-based and deterministic.
The main difference between bitcoin scripts and Ethereum smart contracts is the Turing completeness: bitcoin scripts do not have loops and neither recursion and have a language that is less expressive than a DFA (Deterministic Finite Automaton), as reported here, while the Ethereum Virtual Machine (EVM) is Turing complete (if we associate a gas price equals to 0).
Another major difference is the fact that the Bitcoin Script does not have a notion of state (as reported here) and all the information needed is contained in the locking and unlocking scripts. Whereas Ethereum smart contracts have contract storage that can influence the behavior of the program.
Moreover, bitcoin programs are part of the respective transactions, so, when with pruning some transactions are forgotten, also the corresponding scripts are forgotten. In Ethereum the smart contract code are persistent on the state and can be canceled only if the SELFDESTRUCT
opcode is explicitly called during the execution of the smart contract.
And bitcoin script is run on-chain (like smart contract) ? Or they run similar to something like Javascript in web3.js? Thanks
â sas
Aug 29 at 11:19
1
Yes, bitcoin script is run on-chain so that everyone can verify it was run correctly
â Henk
Aug 29 at 11:30
Hi, please see my edit, I added a premise about bitcoin's and ethereum's transaction format. Let me know if the edited version is better than the previous one, otherwise I will revert the changes.
â Briomkez
Aug 29 at 15:22
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
There are a couple of differences between Bitcoin scripts and Ethereum smart contracts.
USE
BITCOIN
In bitcoin the transaction have a different format from Ethereum:
A transaction typically references previous transaction outputs as new transaction inputs and dedicates all input Bitcoin values to new outputs.
So a transaction is formed by one or more transaction input (i.e., the output of previous transactions) and one or more transaction output.
The transaction outputs specify a locking script (e.g. "only the user with the private key corresponding to address 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2 can unlock this script") that defines the condition to spend the output. Whenever the transaction output is used as input in a new transaction, it must contain an unlocking script that "solves" the locking script. Those script are specified with the bitcoin script.
So, the scripts are used in Bitcoin to validate the transaction, therefore they should be run on chain, i.e. by each full node in the network.
ETHEREUM
The transactions do not reference previous transactions, because Ethereum stores directly the world-state (In bitcoin the state corresponds to the list of unspent transaction outputs (UTXO)).
In Ethreum a transaction may trigger the execution of a smart-contract if the receiver of the message call is a contract account or it may create a contract that persists on the world state.
In Ethereum the smart-contracts can be used to write applications on top of Ethereum.
Similarity/Differences
Both the execution environments of Ethereum smart contracts and Bitcoin scripts are stack-based and deterministic.
The main difference between bitcoin scripts and Ethereum smart contracts is the Turing completeness: bitcoin scripts do not have loops and neither recursion and have a language that is less expressive than a DFA (Deterministic Finite Automaton), as reported here, while the Ethereum Virtual Machine (EVM) is Turing complete (if we associate a gas price equals to 0).
Another major difference is the fact that the Bitcoin Script does not have a notion of state (as reported here) and all the information needed is contained in the locking and unlocking scripts. Whereas Ethereum smart contracts have contract storage that can influence the behavior of the program.
Moreover, bitcoin programs are part of the respective transactions, so, when with pruning some transactions are forgotten, also the corresponding scripts are forgotten. In Ethereum the smart contract code are persistent on the state and can be canceled only if the SELFDESTRUCT
opcode is explicitly called during the execution of the smart contract.
And bitcoin script is run on-chain (like smart contract) ? Or they run similar to something like Javascript in web3.js? Thanks
â sas
Aug 29 at 11:19
1
Yes, bitcoin script is run on-chain so that everyone can verify it was run correctly
â Henk
Aug 29 at 11:30
Hi, please see my edit, I added a premise about bitcoin's and ethereum's transaction format. Let me know if the edited version is better than the previous one, otherwise I will revert the changes.
â Briomkez
Aug 29 at 15:22
add a comment |Â
up vote
5
down vote
There are a couple of differences between Bitcoin scripts and Ethereum smart contracts.
USE
BITCOIN
In bitcoin the transaction have a different format from Ethereum:
A transaction typically references previous transaction outputs as new transaction inputs and dedicates all input Bitcoin values to new outputs.
So a transaction is formed by one or more transaction input (i.e., the output of previous transactions) and one or more transaction output.
The transaction outputs specify a locking script (e.g. "only the user with the private key corresponding to address 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2 can unlock this script") that defines the condition to spend the output. Whenever the transaction output is used as input in a new transaction, it must contain an unlocking script that "solves" the locking script. Those script are specified with the bitcoin script.
So, the scripts are used in Bitcoin to validate the transaction, therefore they should be run on chain, i.e. by each full node in the network.
ETHEREUM
The transactions do not reference previous transactions, because Ethereum stores directly the world-state (In bitcoin the state corresponds to the list of unspent transaction outputs (UTXO)).
In Ethreum a transaction may trigger the execution of a smart-contract if the receiver of the message call is a contract account or it may create a contract that persists on the world state.
In Ethereum the smart-contracts can be used to write applications on top of Ethereum.
Similarity/Differences
Both the execution environments of Ethereum smart contracts and Bitcoin scripts are stack-based and deterministic.
The main difference between bitcoin scripts and Ethereum smart contracts is the Turing completeness: bitcoin scripts do not have loops and neither recursion and have a language that is less expressive than a DFA (Deterministic Finite Automaton), as reported here, while the Ethereum Virtual Machine (EVM) is Turing complete (if we associate a gas price equals to 0).
Another major difference is the fact that the Bitcoin Script does not have a notion of state (as reported here) and all the information needed is contained in the locking and unlocking scripts. Whereas Ethereum smart contracts have contract storage that can influence the behavior of the program.
Moreover, bitcoin programs are part of the respective transactions, so, when with pruning some transactions are forgotten, also the corresponding scripts are forgotten. In Ethereum the smart contract code are persistent on the state and can be canceled only if the SELFDESTRUCT
opcode is explicitly called during the execution of the smart contract.
And bitcoin script is run on-chain (like smart contract) ? Or they run similar to something like Javascript in web3.js? Thanks
â sas
Aug 29 at 11:19
1
Yes, bitcoin script is run on-chain so that everyone can verify it was run correctly
â Henk
Aug 29 at 11:30
Hi, please see my edit, I added a premise about bitcoin's and ethereum's transaction format. Let me know if the edited version is better than the previous one, otherwise I will revert the changes.
â Briomkez
Aug 29 at 15:22
add a comment |Â
up vote
5
down vote
up vote
5
down vote
There are a couple of differences between Bitcoin scripts and Ethereum smart contracts.
USE
BITCOIN
In bitcoin the transaction have a different format from Ethereum:
A transaction typically references previous transaction outputs as new transaction inputs and dedicates all input Bitcoin values to new outputs.
So a transaction is formed by one or more transaction input (i.e., the output of previous transactions) and one or more transaction output.
The transaction outputs specify a locking script (e.g. "only the user with the private key corresponding to address 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2 can unlock this script") that defines the condition to spend the output. Whenever the transaction output is used as input in a new transaction, it must contain an unlocking script that "solves" the locking script. Those script are specified with the bitcoin script.
So, the scripts are used in Bitcoin to validate the transaction, therefore they should be run on chain, i.e. by each full node in the network.
ETHEREUM
The transactions do not reference previous transactions, because Ethereum stores directly the world-state (In bitcoin the state corresponds to the list of unspent transaction outputs (UTXO)).
In Ethreum a transaction may trigger the execution of a smart-contract if the receiver of the message call is a contract account or it may create a contract that persists on the world state.
In Ethereum the smart-contracts can be used to write applications on top of Ethereum.
Similarity/Differences
Both the execution environments of Ethereum smart contracts and Bitcoin scripts are stack-based and deterministic.
The main difference between bitcoin scripts and Ethereum smart contracts is the Turing completeness: bitcoin scripts do not have loops and neither recursion and have a language that is less expressive than a DFA (Deterministic Finite Automaton), as reported here, while the Ethereum Virtual Machine (EVM) is Turing complete (if we associate a gas price equals to 0).
Another major difference is the fact that the Bitcoin Script does not have a notion of state (as reported here) and all the information needed is contained in the locking and unlocking scripts. Whereas Ethereum smart contracts have contract storage that can influence the behavior of the program.
Moreover, bitcoin programs are part of the respective transactions, so, when with pruning some transactions are forgotten, also the corresponding scripts are forgotten. In Ethereum the smart contract code are persistent on the state and can be canceled only if the SELFDESTRUCT
opcode is explicitly called during the execution of the smart contract.
There are a couple of differences between Bitcoin scripts and Ethereum smart contracts.
USE
BITCOIN
In bitcoin the transaction have a different format from Ethereum:
A transaction typically references previous transaction outputs as new transaction inputs and dedicates all input Bitcoin values to new outputs.
So a transaction is formed by one or more transaction input (i.e., the output of previous transactions) and one or more transaction output.
The transaction outputs specify a locking script (e.g. "only the user with the private key corresponding to address 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2 can unlock this script") that defines the condition to spend the output. Whenever the transaction output is used as input in a new transaction, it must contain an unlocking script that "solves" the locking script. Those script are specified with the bitcoin script.
So, the scripts are used in Bitcoin to validate the transaction, therefore they should be run on chain, i.e. by each full node in the network.
ETHEREUM
The transactions do not reference previous transactions, because Ethereum stores directly the world-state (In bitcoin the state corresponds to the list of unspent transaction outputs (UTXO)).
In Ethreum a transaction may trigger the execution of a smart-contract if the receiver of the message call is a contract account or it may create a contract that persists on the world state.
In Ethereum the smart-contracts can be used to write applications on top of Ethereum.
Similarity/Differences
Both the execution environments of Ethereum smart contracts and Bitcoin scripts are stack-based and deterministic.
The main difference between bitcoin scripts and Ethereum smart contracts is the Turing completeness: bitcoin scripts do not have loops and neither recursion and have a language that is less expressive than a DFA (Deterministic Finite Automaton), as reported here, while the Ethereum Virtual Machine (EVM) is Turing complete (if we associate a gas price equals to 0).
Another major difference is the fact that the Bitcoin Script does not have a notion of state (as reported here) and all the information needed is contained in the locking and unlocking scripts. Whereas Ethereum smart contracts have contract storage that can influence the behavior of the program.
Moreover, bitcoin programs are part of the respective transactions, so, when with pruning some transactions are forgotten, also the corresponding scripts are forgotten. In Ethereum the smart contract code are persistent on the state and can be canceled only if the SELFDESTRUCT
opcode is explicitly called during the execution of the smart contract.
edited Aug 30 at 11:23
answered Aug 29 at 10:25
Briomkez
516122
516122
And bitcoin script is run on-chain (like smart contract) ? Or they run similar to something like Javascript in web3.js? Thanks
â sas
Aug 29 at 11:19
1
Yes, bitcoin script is run on-chain so that everyone can verify it was run correctly
â Henk
Aug 29 at 11:30
Hi, please see my edit, I added a premise about bitcoin's and ethereum's transaction format. Let me know if the edited version is better than the previous one, otherwise I will revert the changes.
â Briomkez
Aug 29 at 15:22
add a comment |Â
And bitcoin script is run on-chain (like smart contract) ? Or they run similar to something like Javascript in web3.js? Thanks
â sas
Aug 29 at 11:19
1
Yes, bitcoin script is run on-chain so that everyone can verify it was run correctly
â Henk
Aug 29 at 11:30
Hi, please see my edit, I added a premise about bitcoin's and ethereum's transaction format. Let me know if the edited version is better than the previous one, otherwise I will revert the changes.
â Briomkez
Aug 29 at 15:22
And bitcoin script is run on-chain (like smart contract) ? Or they run similar to something like Javascript in web3.js? Thanks
â sas
Aug 29 at 11:19
And bitcoin script is run on-chain (like smart contract) ? Or they run similar to something like Javascript in web3.js? Thanks
â sas
Aug 29 at 11:19
1
1
Yes, bitcoin script is run on-chain so that everyone can verify it was run correctly
â Henk
Aug 29 at 11:30
Yes, bitcoin script is run on-chain so that everyone can verify it was run correctly
â Henk
Aug 29 at 11:30
Hi, please see my edit, I added a premise about bitcoin's and ethereum's transaction format. Let me know if the edited version is better than the previous one, otherwise I will revert the changes.
â Briomkez
Aug 29 at 15:22
Hi, please see my edit, I added a premise about bitcoin's and ethereum's transaction format. Let me know if the edited version is better than the previous one, otherwise I will revert the changes.
â Briomkez
Aug 29 at 15:22
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fethereum.stackexchange.com%2fquestions%2f57660%2fdifferences-similarities-of-bitcoin-script-and-ethereum-smart-contract%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
As far as I've understood, the biggest difference is that Ethereum's engine is Turing-complete while Bitcoin's is not. Someone else will hopefully elaborate further.
â Lauri Peltonen
Aug 29 at 8:54