Saltar la navegación

3.2.5.2. Session: Implementing Smart Contract

Level: High

Designing Smart Contract (30 minutes)

  • Begin the session with a brief recap of the conclusions from the previous session.
  • Present to students various real-world scenarios like property rental, supply chain management, and entertainment rights distribution. Ask students to quickly jot down how a smart contract might be beneficial in that scenario.
  • Divide students into groups and hand each group a detailed business process scenario, e.g., "A decentralized online marketplace where sellers and buyers transact.” Allow a few minutes for each group to read and understand their given scenario.
  • Instruct groups to brainstorm conceptual ideas for a smart contract that could be implemented for the given scenario.
  • Provide guiding questions to facilitate brainstorming, such as:
    • "What would be the key components or phases of your smart contract?”
    • "How will the contract verify that conditions are met?”
    • "What could be potential challenges in implementing this contract?”
    • "How would the blockchain validate and execute your smart contract?”
  • Encourage a free flow of ideas, emphasizing that there are no right or wrong answers at this stage. It's all about exploration.

Implementing Smart Contract (30 minutes)

  • In this phase guide students in structuring their brainstormed ideas from the previous phase into a cohesive smart contract prototype using diagrams, flowcharts, and narratives.
  • Highlight that this phase will not involve actual coding but will focus on the logical and functional design of the smart contract.
  • Ask groups of students to represent their concepts of smart contracts. Encourage each group to start by identifying and listing down the main entities in their scenario (e.g., buyer, seller, product).
  • Guide them to then detail the relations between these entities and the actions or triggers that would initiate the smart contract.
  • Ask groups to define the contract's lifecycle, from initiation to completion, ensuring they consider any potential challenges or interruptions to the process. Remind students of the state-machine perspective of blockchain from the first session. Ask them to denote different states their smart contract might have within their flowcharts. For instance, in a property rental scenario, states might include "Pending Payment," "Payment Confirmed," "Lease Active," etc. Highlight the importance of variables within their smart contract that would track these states.
  • Promote the importance of considering all possible situations or exceptions that could arise in the real-world application of their contract, and ensure that students think of extreme cases.

Testing Smart Contract (30 minutes)

  • Start by emphasizing the importance of testing in the design process. Explain that in the context of smart contracts, testing can mean both code execution and logical validation of the contract's design.
  • Inform students that while they won’t be executing code, this phase is about testing their design logic, flow, and possible real-world applicability.
  • Each group gets a set time (depending on the number of groups) to present their smart contract prototype.
  • Groups should explain their business scenario, describe the entities involved, show the flow of their contract, and articulate the states and conditions. Encourage them to specifically highlight any challenges they anticipate or innovative solutions they've proposed.
  • After each presentation, open the floor for feedback. But to maintain structure and avoid overwhelming the presenting group, employ the "I Like, I Wish, I Wonder" feedback format.
    • I Like: Something positive about the prototype. 
    • I Wish: A constructive suggestion for improvement.
    • I Wonder: A question about the prototype or a potential scenario that might not have been considered.
  • Encourage each student or group to provide at least one piece of feedback using this format.
  • After a few presentations, interject with a hypothetical extreme event or edge case (e.g., "What if two conflicting transactions are submitted almost simultaneously?"). This serves to challenge students to think about the robustness of their smart contract designs and how they might handle unexpected situations.
  • Conclude the testing phase by highlighting some of the standout ideas or common challenges observed during the presentations. Encourage students to reflect on the feedback received and think about how they might refine their prototypes further, given more time.

Creado con eXeLearning (Ventana nueva)