AFK-AlignedFamKernel / afk_monorepo

AFK: Aligned Fam Kernel - Monorepo
https://afk-community.xyz
MIT License
15 stars 33 forks source link

Solidity Namespace contract DualVM between Kakarot & Cairo #45

Closed MSghais closed 1 month ago

MSghais commented 2 months ago

DualVM Kakarot to Cairo for the contract for Namespace of Nostr.

https://github.com/AFK-AlignedFamKernel/afk_monorepo/blob/main/onchain/solidity_contracts/src/nostr/Namespace.sol

Call Namespace Cairo contracts to:

Check out the Cairo contract here: https://github.com/AFK-AlignedFamKernel/afk_monorepo/blob/main/onchain/cairo/src/social/namespace.cairo

ooochoche commented 2 months ago

@MSghais I am yet to get a issue, please assign this to me

ooochoche commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a smart contract developer and i can tackle this issue if assigned to me

How I plan on tackling this issue

I'd approach this issue by:

ETA - 2days

PoulavBhowmick03 commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm Poulav Bhowmick, a software engineer at Invisible Studios with a robust background in TypeScript, Rust, Solidity Cairo, fullstack development and blockchain technology. My experience includes building robust applications, optimizing functionalities and blockchain integration. I have actively participated in events and open source contributions, enhancing my capability to tackle real-world tech challenges. My projects can be viewed on my GitHub Profile and OnlyDust Profile. Plus I´m active member of Starknet community🇷.

How I plan on tackling this issue

To approach this problem of creating a DualVM Namespace contract in Solidity that interacts with the Cairo contract, I would take the following steps:

Set up cross-chain communication:

Implement a mechanism to communicate with the Starknet network from Ethereum. This typically involves using a bridge or oracle service. Look into existing solutions like Starknet's messaging bridge or third-party cross-chain communication protocols.

Define the contract structure:

Create the Solidity contract with the basic structure you've outlined. Add necessary state variables to store relevant information.

Implement the getter function:

For getNostrAddressByStarknetAddress, make a cross-chain call to the Cairo contract to fetch the Nostr address. Handle the asynchronous nature of cross-chain communication, possibly using a callback mechanism.

Implement the linking function:

For linkNostrAddress, create a function that initiates a cross-chain transaction to the Cairo contract. Ensure proper signature verification and authorization on both chains.

Add necessary helper functions and events:

Implement helper functions for encoding/decoding data between Ethereum and Starknet. Add events to log important actions for off-chain monitoring.

Implement access control:

Add role-based access control for admin functions, similar to the Cairo contract.

Error handling and input validation:

Implement robust error handling for both local and cross-chain operations. Validate inputs on the Solidity side before initiating cross-chain calls.

ETA- 2 days

GoSTEAN commented 2 months ago

@MSghais Can I work on this? Applying via OnlyDust Platform

Background and How It Can Be Leveraged:

With a strong background in Solidity and experience with Cairo smart contracts, I can effectively integrate the functionality of Nostr addresses with Starknet and EVM addresses. My knowledge of cross-chain communication and contract interactions will help ensure a seamless connection between these different systems.

Approach to the Problem:

  1. Review the Existing Contracts:

    • Analyze the Namespace.sol Solidity contract and the namespace.cairo Cairo contract to understand their existing functionalities and how they handle Nostr and Starknet/EVM addresses.
  2. Design the DualVM Interaction:

    • Plan how the Solidity contract will interact with the Cairo contract to retrieve and link Nostr addresses. This includes identifying the necessary functions and ensuring the contracts can communicate effectively.
  3. Implement Contract Calls:

    • Modify the Namespace.sol contract to include functions for calling the Cairo contract. These functions will retrieve the Nostr address associated with a Starknet address and link a Nostr address to a Starknet/EVM address.
  4. Test the Integration:

    • Conduct tests to ensure the Solidity and Cairo contracts communicate correctly, with successful retrieval and linking of addresses. This will involve deploying the contracts in a test environment and simulating user interactions.
  5. Optimize and Finalize:

    • Review the code for any optimizations, ensuring that the interaction between the two contracts is efficient and secure. Make final adjustments based on testing feedback before deploying to the main network.
onlydustapp[bot] commented 2 months ago

Hi @GoSTEAN! Maintainers during the ODHack # 7.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

ShantelPeters commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have experience in integrating smart contracts across different blockchains, including Starknet and Ethereum, and working with Cairo for developing smart contracts. I can leverage this experience to implement a DualVM contract for Namespace integration between Nostr and Starknet, ensuring smooth interaction and data linking between Cairo and Solidity contracts.

How I plan on tackling this issue

To approach this problem, I would:

  1. Analyze the Solidity Contract: Review the Namespace.sol contract to understand its functionality for linking Nostr addresses.

  2. Implement DualVM Interface: Create a DualVM contract that bridges the functionality of the Solidity and Cairo contracts. This involves:

    • Implementing functions to query the Nostr address of a Starknet address.
    • Adding logic to link a Nostr address with Starknet/EVM addresses.
  3. Integrate Cairo Contracts:

    • Implement interactions with the Cairo contract namespace.cairo to fetch and link addresses.
  4. Testing and Validation: Ensure thorough testing to verify correct linking and data retrieval between the contracts.

ScottyDavies commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

As an experienced blockchain developer, I have a strong background in implementing various decentralized applications, including cross-chain integrations. I'm well-versed in Solidity and Cairo, having worked extensively with both languages to build robust smart contracts.

How I plan on tackling this issue

I would approach this issue with following steps

Understand the Namespace Contract Functionality: First, I would closely study the Namespace contract in both Solidity and Cairo to understand the available functions and their purpose. This includes understanding how the Nostr address is linked to the Starknet/EVM address and how the data is stored and retrieved. Implement Client-side Interaction: Based on the contract's functionality, I would implement the necessary client-side logic to interact with the Namespace contract. This would involve: Providing an interface for users to enter their Starknet/EVM address and retrieve the associated Nostr address. Allowing users to link their Nostr address to their Starknet/EVM address. Handling the necessary wallet connections, transaction signing, and error handling. Optimize User Experience: To provide a smooth user experience, I would focus on the following: Implement user-friendly form validation and error messaging to guide the user through the process. Provide clear instructions and explanations to help users understand the purpose and benefits of the Namespace feature. Ensure the UI is responsive and accessible, adapting well to different screen sizes and user interactions. Implement Cross-chain Functionality: Since the Namespace feature involves both Starknet and EVM-based chains, I would need to ensure seamless cross-chain communication and interactions. This may involve: Developing a robust error handling and fallback system to handle potential chain-specific issues. Providing clear visual cues and status updates to the user during cross-chain operations. Exploring potential solutions for improving the overall user experience, such as batching transactions or providing estimated gas costs. Integrate with Existing Platforms: Depending on the project's requirements, I may need to integrate the Namespace feature with existing platforms or applications, such as Nostr clients or decentralized social media platforms. This would involve ensuring a seamless integration experience for users and potentially developing additional client-side components. Collaborate with the Blockchain Team: Throughout the development process, I would work closely with the blockchain team responsible for the Namespace contracts. This collaboration would involve: Aligning on the expected contract behavior and edge cases. Providing feedback and suggestions for contract improvements or enhancements. Coordinating integration testing and deployment strategies.

onlydustapp[bot] commented 2 months ago

Hi @GoSTEAN! Maintainers during the ODHack # 7.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

EmmanuelAR commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Heyyyy @0xandee can i work on this??? I’m Emmanuel Software Dev from Dojo coding and Costa Rica

How I plan on tackling this issue

I will.. 1.⁠ ⁠Review the Contract: Understand the logic and functions the contracts 2.⁠ ⁠Write Tests: •⁠ ⁠Go to openedition/tests and create a test file for the contracts •⁠ ⁠Write test cases that cover all functions, including normal operation, edge cases, and failure scenarios. 3.⁠ ⁠Run Tests: •⁠ ⁠Use the scarb test command to run all the tests. 4.⁠ ⁠Debug: •⁠ ⁠If any tests fail, review and adjust the test cases or contract as needed, then rerun until all tests pass. 5.⁠ ⁠Final Steps: •⁠ ⁠Ensure everything is documented and submit your work.

Ugo-X commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a Full Stack blockchain Developer with expertise in Next.js, Nest.js, TypeScript, JavaScript, React, Node.js, Three.js, and Solidity. My journey with OnlyDust hackathons began at Edition 1, and I've since made 47 contributions across 11 projects. With my extensive experience on the OnlyDust platform (profile: https://app.onlydust.com/u/Ugo-X), I've honed my skills in delivering quality solutions under pressure. I bring a unique blend of technical proficiency and user-focused design to every project, whether it's crafting immersive 3D experiences or developing smart contracts. My track record shows I can adapt quickly and contribute effectively to diverse challenges. As we surf through Edition 7, I'm excited to leverage my skills and hackathon experience to push the boundaries of blockchain development. I'm confident in my ability to tackle new challenges and drive innovation in this space.

How I plan on tackling this issue

I will approach solving this issue in the following steps:

  1. Implement the DualVM architecture:

    • Set up a bridge contract on Ethereum that can communicate with the Starknet contract.
    • Implement message passing between Ethereum and Starknet using the Starknet messaging protocol.
  2. Develop the Ethereum-side Namespace contract:

    • Create functions to mirror the Cairo contract's functionality.
    • Implement getNostrAddressByStarknetAddress to query the Starknet contract.
    • Implement linkNostrAddress to send a linking request to the Starknet contract.
  3. Modify the Starknet-side Namespace contract:

    • Add functions to handle messages from Ethereum.
    • Implement logic to process linking requests from Ethereum.
    • Ensure proper access control for cross-chain operations.
  4. Implement data consistency:

    • Set up a mechanism to keep Nostr-Starknet-Ethereum address mappings consistent across both chains.
    • Implement proper error handling and rollback mechanisms for failed cross-chain operations.
  5. Testing and verification:

    • Develop comprehensive test suites for both Solidity and Cairo contracts.
    • Set up integration tests to verify cross-chain functionality.
    • Perform security audits on both contracts and the messaging system.

This approach will create a DualVM system where the Ethereum contract acts as a front-end for interacting with the Starknet Namespace contract, allowing seamless integration of Nostr, Starknet, and Ethereum addresses.

Tentatively i can deliver this in 4 days.

JorgeOehrens commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have experience working with both Solidity and Cairo, and I’ve developed smart contracts on Ethereum and Starknet. My skills include integrating cross-chain functionalities and linking addresses across different blockchain environments. This background positions me well to implement a solution that connects Nostr addresses with Starknet/EVM addresses, ensuring seamless interaction between Solidity and Cairo contracts.

How I plan on tackling this issue

First, go through the Namespace.sol Solidity contract and the namespace.cairo Cairo contract to understand their features and data structures, how they operate in their respective environments. With these understandings at hand, devise an integration strategy between the two contracts. Outline how one can invoke a Cairo contract from the Solidity environment and vice versa, how one could make use of the interoperability features of Starknet to help Ethereum communicate with it.

Next, following the integration plan, begin to implement the calling contract. This is modification of the Solidity contract, so it adds functionality that enables the calling of the Cairo contract for getting the Nostr address with regard to a given Starknet address. Add the functionality in the Solidity contract for calling the Cairo contract about linking a Nostr address to a respective Starknet/EVM address. This could also involve adding functionality that communicates with the Cairo contract and might include any data conversions or formatting if necessary.

Second, test to make sure everything works as expected. That will involve checking that calls to the contract execute correctly, data is returned, and it's all properly linked; edge cases and possible errors are handled. The solution should perform reliably across a range of varied scenarios.

Finally, document the whole integration process, design decisions taken, implementation details, and problems encountered. Tests the updated contracts rigorously on appropriate networks and deploy them, ensuring that the solution is properly documented for future reference and follow-up maintenance. This would ensure the effective integration of Solidity and Cairo contracts so that Nostr addresses would be able to interact with Starknet/EVM addresses in a seamless manner.

kunalrosaili05 commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm a blockchain developer with 3 years of freelancing experience. I can do this

How I plan on tackling this issue

Here’s the approach

Interoperability: I'll ensure that the Solidity contract can interact with the Cairo contract, possibly via cross-chain messaging between Ethereum and Starknet.

Function Calls: I'll implement functions in the Solidity contract that call the relevant Cairo contract functions, such as retrieving and linking Nostr addresses

Bridges or Messaging Protocols: I'm gonna use cross-chain bridges or messaging protocols to facilitate communication between the Solidity contract on EVM and the Cairo contract on Starknet

MSghais commented 1 month ago

This issue is already in WIP, please apply to #82