Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions accounts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ path = "../musig"
[dependencies.zkvm]
path = "../zkvm"

[dev-dependencies.blockchain]
path = "../blockchain"

[dev-dependencies]
rand_chacha = "0.2"
hex = "^0.3"
3 changes: 1 addition & 2 deletions accounts/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ use curve25519_dalek::scalar::Scalar;
use keytree::Xprv;
use musig::{Multisignature, Signature};

use zkvm::blockchain::{BlockHeader, BlockchainState, Mempool, MempoolItem};
use zkvm::utreexo;
use blockchain::{utreexo, BlockHeader, BlockchainState, Mempool, MempoolItem};
use zkvm::{
Anchor, ClearValue, Contract, ContractID, Program, Prover, TxEntry, TxHeader, VerifiedTx,
};
Expand Down
3 changes: 3 additions & 0 deletions blockchain/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/target
**/*.rs.bk
Cargo.lock
34 changes: 34 additions & 0 deletions blockchain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[package]
name = "blockchain"
version = "0.1.0"
authors = ["Oleg Andreev <oleganza@gmail.com>"]
edition = "2018"
readme = "README.md"
license = "Apache-2.0"
repository = "https://github.com/stellar/slingshot"
categories = ["cryptography", "blockchain"]
keywords = ["cryptography", "blockchain", "zero-knowledge", "bulletproofs"]
description = "A blockchain protocol for ZkVM transactions"

[dependencies]
failure = "0.1"
byteorder = "1"
merlin = "2"
rand = "0.7"
subtle = "2"
curve25519-dalek = { version = "2", features = ["serde"] }
serde = { version = "1.0", features=["derive"] }
subtle-encoding = "0.3"
hex = "^0.3"
async-trait = "0.1.24"
siphasher = "0.3.1"

[dependencies.zkvm]
path = "../zkvm"

[dependencies.starsig]
path = "../starsig"

[dev-dependencies]
criterion = "0.2"
serde_json = "1.0"
6 changes: 6 additions & 0 deletions blockchain/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Slingshot Blockchain Protocol

This is an implementation of a blockchain synchronization protocol for ZkVM transactions.

This does not include p2p networking or persistent data storage.
Only abstract interfaces are used to be implemented in a concrete application.
1 change: 1 addition & 0 deletions blockchain/rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nightly-2019-11-02
2 changes: 1 addition & 1 deletion zkvm/src/blockchain/block.rs → blockchain/src/block.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use merlin::Transcript;
use serde::{Deserialize, Serialize};

use crate::{Hash, MerkleTree};
use zkvm::{Hash, MerkleTree};

/// Identifier of the block, computed as a hash of the `BlockHeader`.
#[derive(Clone, Copy, PartialEq, Default, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion zkvm/src/blockchain/errors.rs → blockchain/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::errors::VMError;
use crate::utreexo::UtreexoError;
use zkvm::VMError;

/// Blockchain state machine error conditions.
#[derive(Debug, Fail)]
Expand Down
13 changes: 13 additions & 0 deletions zkvm/src/blockchain/mod.rs → blockchain/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
//! Implementation of the blockchain state machine.

#[macro_use]
extern crate failure;
extern crate serde;

#[macro_use]
extern crate zkvm;

extern crate starsig;

mod block;
mod errors;
mod protocol;
mod shortid;
mod state;
pub mod utreexo;

#[cfg(test)]
mod tests;

pub use self::block::*;
pub use self::errors::*;
pub use self::protocol::*;
pub use self::state::*;
Loading