🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)

🔧 Programmierung 🕛 kürzlich 9 Min Lesezeit
0

Implement WitnessCalc in native apps Pt.1

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

In this short guide we will roughly implement generated witnesscalc .cpp files from circom in react-native app.



I'll do it in



And finally, we will use




  • configure path in your .bashrc or .zshrc config file
    Image description






  • clone


  • follow readme "preparation" to install necessary deps




Now let's take a look at src folder:






  1. create witnesscalc_auth.cpp and witnesscalc_auth.h files under src folder





You could check all the same files, their content is exact same, except the name, so we have done like so.




  1. now add these files to ./CMakeLists.txt





as before, you should notice, that this code is the same as code above in this file, so we just copied them and changed name



And these steps should be done for every .cpp & .dat files you will add.



in this case you can use



in root ./CMakeLists.txt file





and also except src/witnesscalc.h, it’s necessary too



Now you can run these commands to compile your executable files




CODE
./build_gmp.sh android // only once
make android // every time u want to compile new wtns calcs






The result:



to turn it on.




We will implement our generated file in for that.



so let's start




CODE
npx create-react-native-library@latest wtnscalcs










this is what we see after scaffolding our module, and to modify the code, it’s would be better to open via android-studio



we ARE NOT going to open this android folder, but should open a root android folder, this one:





here is our module, and by modifying it, our code in ./modules/[module]/android folder will be changed too



so what we see now:





and the cmake structure which points to our CMakeLists.txt, which is register our future cpp file with logic





and then .h file for it








Now, let’s back to our "frontend perspective" e.g IDE or editor where your react-native project are, and take a look in to spec file in module, which responsible to register our module with native code and define top-level interface



By defining methods in this "Spec" interface







And by exposing method from index.tsx we will be able to call method from module as a regular npm-pkg














Nice, now let's jump straight in to hard mode:



let's define what we need:

1) first of all, at the very top level we have "inputs" which witness calculator will accept in the future

2) we need to send these inputs to our native module, pass it to .so file

3) execute and return bytes, it should be the same as circom compiles .wtns file, but we will keep file content in ram, instead of file





Now, let's write this implementation code, and leave it empty for a while





and paste there our auth.dat file






  1. get back to "Frontend perspective", create lib folder under modules/android directory and paste there a .so file








CODE
cmake_minimum_required(VERSION 3.4.1)
project(RnWtnscalcs)

set (CMAKE_VERBOSE_MAKEFILE ON)
set (CMAKE_CXX_STANDARD 14)

add_library(rn-wtnscalcs SHARED
../cpp/rn-wtnscalcs.cpp
cpp-adapter.cpp
)

# Specifies a path to native header files.
include_directories(
../cpp
)

link_directories(lib)

add_library(auth SHARED IMPORTED)
set_target_properties(auth PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/lib/libwitnesscalc_auth.so)

target_link_libraries(rn-wtnscalcs
android
auth)







what we have done:




  1. We linked directories where we've placed our .so file

  2. Registered our .so file as library

  3. And finally ‘target_link_libraries’ will compile it for us in one executable file, which we can call in runtime



After these steps we will be able to execute .so file in runtime



let's write the code to call it:







these steps will create binded function in our rn-wtnscalcs.cpp file, but let’s move it to cpp-adapter.cpp





and use it in implemented function in our module.kt file, which we have leaved empty:








Part 2 (ios)

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
3 Quellen
GPT-6 Astra Release Today? OpenAI’s Next Major AI Model Is Almost Here
1 Quelle
Apple accuses OpenAI of destroying evidence as trade-secrets fight intensifies
1 Quelle
Major AI platforms go down in unprecedented simultaneous outage
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Implement WitnessCalc in native apps Pt.1

Thematisch verwandte Begriffe: Implement, WitnessCalc, native, apps · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...