Projet Q2

in #ulille10 months ago

Le Prompt :

« Like the Bitcoin blockchain, Ethereum also allows the transfer of the virtual currency Ether. However, Ethereum is primarily used for executing user programs. How can a new user execute a program they have written on Ethereum? Describe the process in at least three
steps or more, and for each step, indicate any possible alternatives. »

Et la Réponse :

“Certainly! Here's a simplified guide to executing a program on Ethereum for a new user:

Write the Smart Contract: The first step is to write the smart contract, which is essentially the program you want to execute on the Ethereum blockchain. You can do this using various programming languages such as Solidity, Vyper, or even languages that compile to Ethereum Virtual Machine (EVM) bytecode. Alternatively, you can use existing smart contracts as templates and modify them according to your requirements.
Compile the Smart Contract: Once you have written the smart contract code, you need to compile it into bytecode that can be understood and executed by the Ethereum Virtual Machine. There are several tools and platforms available for compiling smart contracts, such as Remix IDE, Truffle Suite, or Solidity Compiler (solc). These tools help in converting your high-level code into EVM bytecode. Alternatively, you can use online services or APIs that offer smart contract compilation as a service.
Deploy the Smart Contract: After compiling the smart contract, you need to deploy it onto the Ethereum blockchain. To do this, you'll need an Ethereum wallet that supports interacting with smart contracts, such as MetaMask or MyEtherWallet. You can deploy the contract using these wallets' interfaces by providing the compiled bytecode and any required constructor parameters. This deployment process involves submitting a transaction to the Ethereum network, which requires paying a transaction fee (gas) in Ether. Once the transaction is confirmed, your smart contract will be deployed, and you'll receive a contract address that you can use to interact with it. Alternatively, you can deploy the contract programmatically using Ethereum client libraries such as Web3.js or ethers.js.
Interact with the Smart Contract: With the smart contract deployed, you can now interact with it using Ethereum transactions. This interaction can involve calling functions defined in the smart contract, which may perform various operations such as transferring tokens, updating data, or executing specific logic. You can interact with the contract using tools like Remix IDE, which provides a user-friendly interface for sending transactions to smart contracts. Alternatively, you can interact programmatically using Ethereum client libraries in your preferred programming language.
These steps provide a basic overview of how a new user can execute a program they've written on Ethereum. As they become more familiar with the Ethereum ecosystem, they may explore advanced topics such as smart contract testing, optimization, and security best practices.”

Ici comme la question est disons plus précise ChatGPT s’en sort mieux, il aurait pu évoquer le fait que Ethereum a été créé pour justement avoir un langage Turing Complet dans une blockchain pour pouvoir créer et coder n’importe quel type de contrats intelligents. La chose importante à retenir est qu’il est très utile de demander des exemples concrets à ChatGPT alors qu’il est moins bon lorsque c’est une question générale. En général ChatGPT a soi une réponse très précise sur un sujet précis demandé , soit une réponse très large sur le sujet mais il a du mal à mélanger les deux (Partir du particulier pour aller au général ou inversemet) De plus ChatGPT est assez mauvais sur les questions transversales sur ce genre de sujet les sujets environnementaux , juridiques (cf MICA), Géopolitique (Cf émeute Khazakstan suite à des coupures d’éléctricités suite à l’arrivée de grosses fermes à crypto récemment banni de Chine) et bien d’autres encore.

Sort:  

Réflexions intéressantes sur ChatGPT mais vous semblez avoir perdu de vue qu'il s'agissait d'un cours "blockchain" pas IA - ça m'aurait plus intéressé de lire des commentaires sur le sujet de la question 😄

Notamment, j'attendais que vous releviez le coût pour coder des smart contracts - en effet, un passage obligé est d'aller ... acheter du ETH (typiquement sur une bourse crypto centralisée), sinon on ne peut pas déployer un smart contract ni interagir avec lui.

Lié à ça, j'aurais attendu une mention des réseaux de test, de leur avantages et inconvénients