Coder Social home page Coder Social logo

cryptonerdcn / wasm-cairo Goto Github PK

View Code? Open in Web Editor NEW
53.0 53.0 12.0 5.9 MB

A suite of development tools and a WASM-Runtime environment for Cairo. All based on WebAssembly. By Caironautes, for Caironautes.

Home Page: https://wasm-cairo-landing.vercel.app/

License: Apache License 2.0

JavaScript 5.68% Cairo 2.96% Rust 83.31% Shell 8.05%

wasm-cairo's Introduction

๐Ÿ‘‹ Hello there! I'm @cryptonerdcn


๐Ÿ”ง Technologies: Rust | WASM | Cairo | Solidity.
๐Ÿš€ Currently: Developing decentralized applications&infras (such as WASM-Cairo) and contributing to open source.
๐Ÿ“š Learning: Always expanding my Blockchain & AI capabilities.
๐Ÿ’ฌ Ask me about: Anything tech! Love to chat about new technologies and frameworks.
๐Ÿ“ซ How to reach me: TW
๐ŸŒŸ Fun fact: General Cannot be.

wasm-cairo's People

Contributors

cryptonerdcn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wasm-cairo's Issues

Unable to find eth_signature from starknet

On trying to compile the code below,

use core::traits::Into;
use core::array::ArrayTrait;
use core::keccak;
use core::option::OptionTrait;
use core::starknet::SyscallResultTrait;
use starknet::{EthAddress,secp256k1::{secp256k1_new_syscall},eth_signature::public_key_point_to_eth_address};

fn proof(txn_hash: u256, final_hash: u256) {
    let public_key = secp256k1_new_syscall(0x643285cb1513659e8a634ea5d74c2180b2549edce3083e2906aa1c88c918ae4c, 0x6e0086f3d9ff7e443a9d275e0c5e14e3904dd5d4937bad9d7a8e03d6e38b9ef9).unwrap_syscall().unwrap();
    let address = public_key_point_to_eth_address(public_key);
    let mut hash_arr = ArrayTrait::<u256>::new();
    hash_arr.append(address.address.into());
    hash_arr.append(txn_hash);
    let cal_final_hash = keccak::keccak_u256s_be_inputs(hash_arr.span());
    assert(cal_final_hash == final_hash, 'Invalid final hash');
}

fn main() {
    let txn_hash = 0x1;
    let final_hash: u256 = 0xf52437fd0c9b08a5c208b7bfd82ad37120702db8e69608b03242d9d61e3cf2f1;
    proof(txn_hash, final_hash);
}

The following error is showing,

error: Identifier not found.
 --> astro.cairo:6:62
use starknet::{EthAddress,secp256k1::{secp256k1_new_syscall},eth_signature::public_key_point_to_eth_address};
                                                             ^***********^

JS -> Cairo -> JS function call

I found 2 projects as example for cairo with wasm, the astro editor and the starklings [https://app.onlydust.com/p/wasm-cairo] . Is the actual state of the cairo wasm is limited to compiling the code on the browser ? The documentation is scarce and both examples are limited. Could you help us to find [or create] an example of a simple cairo function that "talks" with the JS, like 'fn x = x + 1' ? so we can send the number 3 from JS to the cairo wasm module, and get 4 back on the JS UI.

thanks
hh

Split wasm files.

[feat]Sometimes we just need "compile" or "run", not them all.
That means we can decrease the size of the WASM package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.