Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
2d86ee6
Add initial refactored stateless executor
rubo Feb 24, 2026
fcfd95c
Fix a typo
rubo Feb 24, 2026
e760d5d
Make paths absolute
rubo Feb 24, 2026
5a07052
Add `modexp` precompile
rubo Feb 24, 2026
d6c4906
Add `BLS12_PAIRING_CHECK` precompile
rubo Feb 24, 2026
ba1dd7d
Add `BLS12_G2ADD` precompile
rubo Feb 24, 2026
b7d02cb
Add `BLS12_G2MSM` precompile
rubo Feb 24, 2026
cd466f7
Revise `Makefile`
rubo Feb 24, 2026
143938d
Merge branch 'master' into feature/stateless-zisk
rubo Feb 25, 2026
541baab
Add `BLS12_MAP_FP_TO_G1` precompile
rubo Feb 25, 2026
e2160c1
Add `BLS12_MAP_FP2_TO_G2` precompile
rubo Feb 25, 2026
9753bad
Add `BLS12_G1ADD` precompile
rubo Feb 25, 2026
c34ad37
Add `BLS12_G1MSM` precompile
rubo Feb 25, 2026
d970109
Implement preliminary input serialization
rubo Feb 27, 2026
e835363
Merge branch 'master' into feature/stateless-zisk
rubo Feb 27, 2026
c101661
Revise input formatting
rubo Feb 27, 2026
1ecab29
Refactor and add SecP256k1 functions
rubo Feb 27, 2026
cbaa939
Shut the cspell up
rubo Feb 27, 2026
bef6f51
Change chain id to `uint` and add tx sig recovery (disabled)
rubo Feb 27, 2026
e0dc870
Reformat
rubo Feb 28, 2026
9265125
Refactor and optimize Zisk I/O
rubo Feb 28, 2026
663c8fe
Minor refactor
rubo Feb 28, 2026
2643987
Replace throwing errors with fail-fasts.
rubo Feb 28, 2026
dde4bbb
Simplify the entrypoint
rubo Feb 28, 2026
e1afdea
Switch to little-endian
rubo Feb 28, 2026
a56075f
Refactor Zisk I/O
rubo Feb 28, 2026
ce38d9c
Optimize RLP handling
rubo Feb 28, 2026
e7e7874
Add `KZG_POINT_EVALUATION` precompile function
rubo Feb 28, 2026
f51fe71
Add `P256VERIFY` precompile function
rubo Feb 28, 2026
e06917b
Add Keccak-256 function
rubo Feb 28, 2026
aadec1f
Add SHA-256 function
rubo Feb 28, 2026
2670814
Revise execution result handling
rubo Feb 28, 2026
7a3f4ec
Fix `secp256k1_ecdsa_address_recover_c` signature
rubo Feb 28, 2026
72cc51c
Add `BLAKE2F` precompile function
rubo Feb 28, 2026
04f051d
Revise serialization length handling
rubo Mar 1, 2026
4b9fe52
Micro-optimize Zisk I/O
rubo Mar 1, 2026
caa49ee
Merge branch 'master' into feature/stateless-zisk
rubo Mar 1, 2026
501c9a6
Replace `zkVM` with `zkEVM`
rubo Mar 1, 2026
7dff8ea
Fix `Witness` API usage
rubo Mar 1, 2026
db5e9a1
Fix tester
rubo Mar 1, 2026
cda0ba4
Micro-optimize Zisk I/O
rubo Mar 1, 2026
464b222
Make `StatelessExecutor` static
rubo Mar 1, 2026
00df3f3
Merge branch 'master' into feature/stateless-zisk
rubo Mar 2, 2026
650edc5
Improve tester
rubo Mar 3, 2026
fc35feb
Fix RLP API
rubo Mar 3, 2026
7835da8
Add testing workflow
rubo Mar 3, 2026
0395776
Remove redundant namespace
rubo Mar 3, 2026
04a2412
Dispose decoded headers
rubo Mar 3, 2026
5b77145
Tighten serialization validation
rubo Mar 3, 2026
c234805
Remove redundant stuff
rubo Mar 3, 2026
af0d749
Dispose witness
rubo Mar 3, 2026
9f06eaa
Merge branch 'master' into feature/stateless-zisk
rubo Mar 3, 2026
1235eef
Hardcode `nethermindeth/bflat-riscv64` image
rubo Mar 5, 2026
be19b0c
Use a NuGet package for Zisk bindings
rubo Mar 5, 2026
8e06802
Remove keys from serialization
rubo Mar 5, 2026
2c99f6d
Fix Zisk testing
rubo Mar 5, 2026
e162eb3
Merge branch 'master' into feature/stateless-zisk
rubo Mar 5, 2026
04f0aa4
Remove `StatelessExecution` project
rubo Mar 5, 2026
939ad50
Harden Zisk Dockerfile
rubo Mar 5, 2026
e0c6249
Switch to the latest `nethermindeth/bflat-riscv64`
rubo Mar 6, 2026
d50c8a3
Implement address recovery
rubo Mar 6, 2026
8361a48
Fix formatting
rubo Mar 6, 2026
b6b234f
Add block validation
rubo Mar 6, 2026
3f0cc6b
Merge branch 'master' into feature/stateless-zisk
rubo Mar 7, 2026
16e6ea2
Cancel in-progress test
rubo Mar 7, 2026
316dd42
Remove tx address null check
rubo Mar 7, 2026
f05898a
Refactor test workflow
rubo Mar 7, 2026
6ea8960
Add dependencies to solution
rubo Mar 7, 2026
53cd7e9
Reorder usings
rubo Mar 7, 2026
832e48b
Merge branch 'master' into feature/stateless-zisk
rubo Mar 7, 2026
bf5af0b
Update Nethermind.ZiskBindings package
rubo Mar 8, 2026
d2e2bd2
Remove `Dockerfile.bflat`
rubo Mar 8, 2026
5caee24
Use modern libziskos and implement canonical way to reference precomp…
maximmenshikov Mar 9, 2026
e73fc3b
Update `Nethermind.ZiskBindings` package
rubo Mar 9, 2026
acd2220
Implement `ECREC` precompile and refactor address recovery
rubo Mar 9, 2026
1fcd952
Implement `BN254` precompiles
rubo Mar 9, 2026
2d3ec98
Merge branch 'master' into feature/stateless-zisk
rubo Mar 9, 2026
31f0a0f
Refactor `EthereumEcdsa` for zkEVM
rubo Mar 9, 2026
320297d
Remove links to `Nethermind.Facade`
rubo Mar 10, 2026
a44a374
Improve conditional compilation handling
rubo Mar 10, 2026
0feb4ab
Restore file name
rubo Mar 10, 2026
2eab942
Merge branch 'master' into feature/stateless-zisk
rubo Mar 13, 2026
ad98c10
Implement `BLS12_G1ADD` precompile
rubo Mar 13, 2026
8946c71
Switch to Zisk v0.16.0
rubo Mar 13, 2026
37d7a94
Implement `BLS12_G1MSM` precompile
rubo Mar 13, 2026
6a4a2c2
Unify function name
rubo Mar 13, 2026
a8c4fbb
Shut cspell up 🤮
rubo Mar 13, 2026
a9cf0a6
Merge branch 'master' into feature/stateless-zisk
rubo Mar 14, 2026
10d8b05
Use `ulong` for chain id
rubo Mar 14, 2026
5e99852
Refactor precompiles
rubo Mar 14, 2026
2cab0ae
Merge branch 'master' into feature/stateless-zisk
rubo Mar 16, 2026
9de75da
Revert `TransactionProcessor`
rubo Mar 16, 2026
bda1ba6
Implement `BLS12_G2ADD` precompile
rubo Mar 16, 2026
2b6cc7f
Implement `BLS12_G2MSM` precompile
rubo Mar 16, 2026
a3c538b
Implement `BLS12_MAP_FP_TO_G1` precompile
rubo Mar 17, 2026
6992f0f
Implement `BLS12_MAP_FP2_TO_G2` precompile
rubo Mar 17, 2026
0461c5c
Update README
rubo Mar 17, 2026
c927e91
Merge branch 'master' into feature/stateless-zisk
rubo Mar 17, 2026
060ae92
Implement `BLS12_PAIRING_CHECK` precompile
rubo Mar 18, 2026
a9bc3b1
Refactor EIP-2537 precompiles
rubo Mar 18, 2026
f30aed1
Merge branch 'master' into feature/stateless-zisk
rubo Mar 18, 2026
6d95550
Update Nethermind.ZiskBindings package
rubo Mar 18, 2026
0fc1fe3
Merge `Tester` project into `ZiskGuest`
rubo Mar 19, 2026
4eee306
Move the project to be alongside the main codebase
rubo Mar 19, 2026
2203263
Merge branch 'master' into feature/stateless-zisk
rubo Mar 19, 2026
f7d15b0
Restore `ECRecoverPrecompile` file name
rubo Mar 19, 2026
58ddd96
Implement `MODEXP` precompile
rubo Mar 19, 2026
2b76fb5
Merge branch 'master' into feature/stateless-zisk
rubo Mar 20, 2026
006cb3a
Implement `KZG_POINT_EVALUATION` precompile
rubo Mar 20, 2026
a502c86
Bring back `KzgPolynomialCommitments.BlsModulus`
rubo Mar 20, 2026
c9a49b9
Implement `P256VERIFY` precompile
rubo Mar 20, 2026
4ecf70c
Implement `SHA256` precompile
rubo Mar 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions tools/Stateless/Executor/Executor.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>Nethermind.Stateless.Executor</AssemblyName>
<RootNamespace>Nethermind.Stateless.Execution</RootNamespace>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Nethermind\Nethermind.Core\Nethermind.Core.csproj" />
<ProjectReference Include="..\..\..\src\Nethermind\Nethermind.Facade\Nethermind.Facade.csproj" />
<ProjectReference Include="..\..\..\src\Nethermind\Nethermind.Db\Nethermind.Db.csproj" />
<ProjectReference Include="..\..\..\src\Nethermind\Nethermind.Trie\Nethermind.Trie.csproj" />
<ProjectReference Include="..\..\..\src\Nethermind\Nethermind.Evm\Nethermind.Evm.csproj" />
<ProjectReference Include="..\..\..\src\Nethermind\Nethermind.Specs\Nethermind.Specs.csproj" />
<ProjectReference Include="..\..\..\src\Nethermind\Nethermind.Consensus\Nethermind.Consensus.csproj" />
<ProjectReference Include="..\..\..\src\Nethermind\Nethermind.Logging.NLog\Nethermind.Logging.NLog.csproj" />
<ProjectReference Include="..\..\..\src\Nethermind\Nethermind.Serialization.Rlp\Nethermind.Serialization.Rlp.csproj" />
</ItemGroup>

</Project>
278 changes: 278 additions & 0 deletions tools/Stateless/Executor/StatelessExecutor.cs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions tools/Stateless/Stateless.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Solution>
<Project Path="Executor/Executor.csproj" />
<Project Path="ZiskGuest/ZiskGuest.csproj" />
</Solution>

6 changes: 6 additions & 0 deletions tools/Stateless/ZiskGuest/Dockerfile.bflat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-FileCopyrightText: 2026 Demerzel Solutions Limited
# SPDX-License-Identifier: LGPL-3.0-only

FROM nethermindeth/bflat-riscv64:latest

RUN apt-get update && apt-get install -y --no-install-recommends strace gdb file
20 changes: 20 additions & 0 deletions tools/Stateless/ZiskGuest/Dockerfile.zisk
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: 2026 Demerzel Solutions Limited
# SPDX-License-Identifier: LGPL-3.0-only

FROM rust:latest

RUN apt-get update && apt-get install -y --no-install-recommends \
libomp-dev \
libopenmpi-dev \
libsodium-dev && \
rm -rf /var/lib/apt/lists/*

RUN curl -L https://raw.githubusercontent.com/0xPolygonHermez/zisk/main/ziskup/ziskup | bash -s -- --nokey

ENV PATH="/root/.zisk/bin:${PATH}"

WORKDIR /n

COPY bin/nethermind .

CMD ["tail", "-f", "/dev/null"]
97 changes: 97 additions & 0 deletions tools/Stateless/ZiskGuest/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# SPDX-FileCopyrightText: 2026 Demerzel Solutions Limited
# SPDX-License-Identifier: LGPL-3.0-only

ARTIFACTS_DIR := $(abspath ../../artifacts/bin/ZiskGuest/release)
BIN_DIR := /nethermind/bin
SRC_DIR := /nethermind/src

BFLAT_BUILD := bflat build -x --verbose \
--arch riscv64 \
--os linux \
--stdlib dotnet \
--no-pthread \
--no-pie \
--nostdlibrefs \
--no-stacktrace-data \
--no-globalization
BFLAT_REFS := \
-r {std}/Microsoft.Win32.Primitives.dll \
-r {std}/netstandard.dll \
-r {std}/System.Collections.dll \
-r {std}/System.Collections.Concurrent.dll \
-r {std}/System.Collections.Immutable.dll \
-r {std}/System.ComponentModel.Primitives.dll \
-r {std}/System.Console.dll \
-r {std}/System.Diagnostics.DiagnosticSource.dll \
-r {std}/System.Diagnostics.Process.dll \
-r {std}/System.Diagnostics.StackTrace.dll \
-r {std}/System.Diagnostics.Tracing.dll \
-r {std}/System.IO.Pipes.dll \
-r {std}/System.Linq.dll \
-r {std}/System.Memory.dll \
-r {std}/System.Net.Primitives.dll \
-r {std}/System.Net.Sockets.dll \
-r {std}/System.Reflection.Metadata.dll \
-r {std}/System.Runtime.dll \
-r {std}/System.Runtime.InteropServices.dll \
-r {std}/System.Runtime.Intrinsics.dll \
-r {std}/System.Runtime.Numerics.dll \
-r {std}/System.Security.Cryptography.dll \
-r {std}/System.Text.RegularExpressions.dll \
-r {std}/System.Threading.dll \
-r {std}/System.Threading.Tasks.Parallel.dll \
-r {std}/System.Threading.Thread.dll \
-r {std}/System.Threading.ThreadPool.dll \
-r $(BIN_DIR)/Microsoft.Extensions.ObjectPool.dll \
-r $(BIN_DIR)/Nethermind.Abi.dll \
-r $(BIN_DIR)/Nethermind.Blockchain.dll \
-r $(BIN_DIR)/Nethermind.Consensus.dll \
-r $(BIN_DIR)/Nethermind.Core.dll \
-r $(BIN_DIR)/Nethermind.Crypto.dll \
-r $(BIN_DIR)/Nethermind.Db.dll \
-r $(BIN_DIR)/Nethermind.Evm.dll \
-r $(BIN_DIR)/Nethermind.Evm.Precompiles.dll \
-r $(BIN_DIR)/Nethermind.Facade.dll \
-r $(BIN_DIR)/Nethermind.Int256.dll \
-r $(BIN_DIR)/Nethermind.Logging.dll \
-r $(BIN_DIR)/Nethermind.Serialization.Rlp.dll \
-r $(BIN_DIR)/Nethermind.Specs.dll \
-r $(BIN_DIR)/Nethermind.State.dll \
-r $(BIN_DIR)/Nethermind.Stateless.Executor.dll \
-r $(BIN_DIR)/Nethermind.Trie.dll \
-r $(BIN_DIR)/Nethermind.TxPool.dll \
-r $(BIN_DIR)/BouncyCastle.Cryptography.dll \
-r $(BIN_DIR)/NonBlocking.dll \
-r $(BIN_DIR)/FastEnum.Core.dll
BFLAT_SRC := \
$(SRC_DIR)/Program.cs \
$(SRC_DIR)/Zisk.Memory.cs \
$(SRC_DIR)/Zisk.Precompiles.cs

DOCKER_RUN := docker run --platform linux/amd64 --rm \
-e DOTNET_TYPELOADER_TRACE_INTERFACE_RESOLUTION=0 \
-w $(SRC_DIR) \
--mount type=bind,source="$(ARTIFACTS_DIR)",target=$(BIN_DIR) \
--mount type=bind,source="$(CURDIR)",target=$(SRC_DIR) \
bflat-ricsv64-local

build-docker-bflat:
docker build --platform linux/amd64 -f Dockerfile.bflat -t bflat-ricsv64-local .

build-dotnet:
dotnet build -c release -p:EnableZkvm=true

build-zisk: build-docker-bflat
$(DOCKER_RUN) $(BFLAT_BUILD) --libc zisk $(BFLAT_REFS) $(BFLAT_SRC) \
--extlib https://github.com/NethermindEth/bflat-libziskos:pre-develop-0.16.0
mkdir -p bin; mv -f Program.patched bin/nethermind; rm -f Program Program.o

build-zisk-sim: build-docker-bflat
$(DOCKER_RUN) $(BFLAT_BUILD) --libc zisk_sim $(BFLAT_REFS) $(BFLAT_SRC)
mkdir -p bin; mv -f Program bin/nethermind; rm -f Program.o

run-zisk: build-zisk
docker build --platform linux/amd64 -f Dockerfile.zisk -t zisk .
docker run --rm -it -e RUST_BACKTRACE=full zisk ziskemu -e /n/nethermind

.PHONY: build-docker build-dotnet build-zisk build-zisk-sim run-zisk
33 changes: 33 additions & 0 deletions tools/Stateless/ZiskGuest/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// SPDX-FileCopyrightText: 2026 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using Nethermind.Core.Crypto;
using Nethermind.Stateless.Execution;
using System.Buffers.Binary;

namespace Nethermind.Stateless.ZiskGuest;

Check warning on line 8 in tools/Stateless/ZiskGuest/Program.cs

View workflow job for this annotation

GitHub Actions / Check whitespaces

Unknown word (Zisk)

class Program
{
static int Main()
{
// TODO: Replace with Zisk.ReadInput() and parse the input into the expected format for StatelessExecutor

Check warning on line 14 in tools/Stateless/ZiskGuest/Program.cs

View workflow job for this annotation

GitHub Actions / Check whitespaces

Unknown word (Zisk)
Zisk.WriteLine("hella good");

Check warning on line 15 in tools/Stateless/ZiskGuest/Program.cs

View workflow job for this annotation

GitHub Actions / Check whitespaces

Unknown word (hella)

Check warning on line 15 in tools/Stateless/ZiskGuest/Program.cs

View workflow job for this annotation

GitHub Actions / Check whitespaces

Unknown word (Zisk)

(int status, Hash256 hash) = StatelessExecutor.Execute();

if (status == 0)
{
var size = sizeof(uint);

for (int i = 0, count = hash.Bytes.Length / size; i < count; i++)
{
var start = i * size;

Zisk.SetOutput(i, BinaryPrimitives.ReadUInt32BigEndian(hash.Bytes[start..(start + size)]));

Check warning on line 27 in tools/Stateless/ZiskGuest/Program.cs

View workflow job for this annotation

GitHub Actions / Check whitespaces

Unknown word (Zisk)
}
}

return status;
}
}
21 changes: 21 additions & 0 deletions tools/Stateless/ZiskGuest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Nethermind guest for Zisk

Check warning on line 1 in tools/Stateless/ZiskGuest/README.md

View workflow job for this annotation

GitHub Actions / Check whitespaces

Unknown word (Zisk)

Building the guest app requires Linux and Docker.

### Usage

To build an ELF binary for Zisk, run the following:

Check warning on line 7 in tools/Stateless/ZiskGuest/README.md

View workflow job for this annotation

GitHub Actions / Check whitespaces

Unknown word (Zisk)

```bash
make build-zisk

Check warning on line 10 in tools/Stateless/ZiskGuest/README.md

View workflow job for this annotation

GitHub Actions / Check whitespaces

Unknown word (zisk)
```

The resulting binary can be found in `bin/nethermind`.

To execute Nethermind guest in Zisk, run the following (invokes the previous step automatically):

Check warning on line 15 in tools/Stateless/ZiskGuest/README.md

View workflow job for this annotation

GitHub Actions / Check whitespaces

Unknown word (Zisk)

```bash
make run-zisk

Check warning on line 18 in tools/Stateless/ZiskGuest/README.md

View workflow job for this annotation

GitHub Actions / Check whitespaces

Unknown word (zisk)
```

For details, see the [Makefile](./Makefile).
97 changes: 97 additions & 0 deletions tools/Stateless/ZiskGuest/Zisk.Memory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// SPDX-FileCopyrightText: 2026 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System.Runtime.CompilerServices;

namespace Nethermind.Stateless.ZiskGuest;

public static unsafe partial class Zisk
{
private const ulong INPUT_ADDR = 0x90000000UL;
private const ulong OUTPUT_ADDR = 0xa0010000UL;
private const ulong UART_ADDR = 0xa0000200UL;

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static byte[] ReadInput()
{
byte* sizePtr = (byte*)(INPUT_ADDR + 8);
ulong size = 0;

for (int i = 0; i < 8; i++)
size |= ((ulong)sizePtr[i]) << (i * 8);

if (size == 0) return [];

byte[] result = new byte[size];
byte* dataPtr = (byte*)(INPUT_ADDR + 16);

for (ulong i = 0; i < size; i++)
result[i] = dataPtr[i];

return result;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void SetOutput(int id, uint value)
{
if (id < 0 || id >= 64) return;

uint* baseAddr = (uint*)OUTPUT_ADDR;
uint currentCount = *baseAddr;

if (id + 1 > currentCount)
*baseAddr = (uint)(id + 1);

*(baseAddr + 1 + id) = value;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void WriteChar(char c)
{
*(byte*)UART_ADDR = (byte)c;
}

public static void WriteString(string s)
{
for (int i = 0; i < s.Length; i++)
WriteChar(s[i]);
}

public static void WriteLine(string s)
{
WriteString(s);
WriteChar('\n');
}

/// Read 64-bit unsigned integer from byte array (little-endian)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong ReadUInt64(byte[] data, int offset = 0)
{
if (data.Length < offset + 8) return 0;

ulong result = 0;
for (int i = 0; i < 8; i++)
result |= ((ulong)data[offset + i]) << (i * 8);
return result;
}

/// Read 32-bit unsigned integer from byte array (little-endian)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint ReadUInt32(byte[] data, int offset = 0)
{
if (data.Length < offset + 4) return 0;

uint result = 0;
for (int i = 0; i < 4; i++)
result |= ((uint)data[offset + i]) << (i * 8);
return result;
}

/// Output 64-bit value as two 32-bit outputs
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void SetOutput64(int baseId, ulong value)
{
SetOutput(baseId, (uint)(value & 0xFFFFFFFF));
SetOutput(baseId + 1, (uint)(value >> 32));
}
}
24 changes: 24 additions & 0 deletions tools/Stateless/ZiskGuest/Zisk.Precompiles.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-FileCopyrightText: 2026 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

#pragma warning disable CA1401 // P/Invokes should not be visible
#pragma warning disable SYSLIB1054 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time

using System.Runtime.InteropServices;

namespace Nethermind.Stateless.ZiskGuest;

public static unsafe partial class Zisk
{
public static class Precompiles
{
[DllImport("__Internal")]
public static extern byte bn254_g1_add_c(byte* p1, byte* p2, byte* ret);

[DllImport("__Internal")]
public static extern byte bn254_g1_mul_c(byte* point, byte* scalar, byte* ret);

[DllImport("__Internal")]
public static extern byte bn254_pairing_check_c(byte* pairs, nuint num_points);
}
}
13 changes: 13 additions & 0 deletions tools/Stateless/ZiskGuest/ZiskGuest.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RootNamespace>Nethermind.Stateless.ZiskGuest</RootNamespace>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Executor\Executor.csproj" />
</ItemGroup>

</Project>
Loading