Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
c6da22a
Update 01-install.rst
Horusfeathers Jul 30, 2020
f8d8331
Update 07-Sidechain-SDK-extension.rst
zennermac Jul 30, 2020
3a405e4
Update 07-Sidechain-SDK-extension.rst
zennermac Jul 30, 2020
afe8b5c
Custom Box Data class creation
zennermac Jul 30, 2020
4e454ae
Custom Box Data Serializer class creation
zennermac Jul 30, 2020
4f598d0
Revert "Custom Box Data Serializer class creation"
zennermac Jul 30, 2020
58fe808
Custom Box Data Serializer class creation
zennermac Jul 30, 2020
5379059
Custom Box Data Serializer class creation too many indents
zennermac Jul 30, 2020
c91b50d
Custom Box Data Serializer class creation setp 3 missing code block
zennermac Jul 30, 2020
2b88cb1
Custom Box Data Serializer class creation setp 3 fixing indents
zennermac Jul 30, 2020
226ab2c
Custom Box class creation
zennermac Jul 30, 2020
fe4c4ee
test for java syntax
zennermac Jul 30, 2020
955d5e7
test for java syntax
zennermac Jul 30, 2020
3118ac0
Custom Box Serializer Class
zennermac Jul 30, 2020
78296b0
Custom Box Serializer Class creation
zennermac Jul 30, 2020
7f9d6f6
Custom Box Serializer Class creation 2
zennermac Jul 30, 2020
bf64003
Transaction extension
zennermac Jul 30, 2020
03c5530
started on application state
zennermac Jul 30, 2020
b96ab1a
Merge pull request #3 from Horusfeathers/patch-1
zennermac Jul 30, 2020
c672c99
fixed mainchain refs where needed
zennermac Jul 30, 2020
71a94a4
Update conf.py
Horusfeathers Aug 6, 2020
346e0c6
Update 08-Car-registry-tutorial.rst
megaluck Aug 6, 2020
42ea5ee
Update 08-Car-registry-tutorial.rst
megaluck Aug 6, 2020
43bbe7e
Update 08-Car-registry-tutorial.rst
megaluck Aug 6, 2020
7329da2
Update 08-Car-registry-tutorial.rst
megaluck Aug 6, 2020
722b87e
Update 08-Car-registry-tutorial.rst
megaluck Aug 6, 2020
355411c
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
69e2e7a
Update index.rst
megaluck Aug 7, 2020
01d7fa0
Update 01-install.rst
megaluck Aug 7, 2020
7bac49b
Update 02-blockchain-representation.rst
megaluck Aug 7, 2020
5b503a5
Update 01-install.rst
megaluck Aug 7, 2020
62bb073
Update 01-install.rst
megaluck Aug 7, 2020
31f1342
Update 01-install.rst
megaluck Aug 7, 2020
941692e
Update 01-install.rst
megaluck Aug 7, 2020
6bee4d9
Update 05-Node-communication.rst
megaluck Aug 7, 2020
1e02e79
Update 02-blockchain-representation.rst
megaluck Aug 7, 2020
f953e4e
Update 06-Base-App.rst
megaluck Aug 7, 2020
98960ef
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
9644466
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
87f9f7f
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
c754a26
Update 06-Base-App.rst
megaluck Aug 7, 2020
8a4fa3a
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
3f3c773
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
20adc8d
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
923a709
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
f629c58
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
20c776d
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
8ecb1ad
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
f3ed9b2
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
47a4f51
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
2db709a
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
183daeb
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
d290c98
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
e97177c
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
91ddb63
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
39d690c
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
dc8f979
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
b8ca861
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
e814ead
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
3797f9d
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
47f4c21
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
0ba2894
Update 08-Car-registry-tutorial.rst
megaluck Aug 7, 2020
6a2c19a
Merge branch 'master' into Horusfeathers-patch-1
Horusfeathers Aug 7, 2020
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: 10 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))

# -- General configuration ------------------------------------------------
# -- General Configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# Add any Sphinx extension module names here as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
Expand All @@ -45,7 +45,7 @@
# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
# The master doctree document.
master_doc = 'index'

# General information about the project.
Expand Down Expand Up @@ -75,7 +75,7 @@
# directories to ignore when looking for source files.
exclude_patterns = ['_build']

# The reST default role (used for this markup: `text`) to use for all
# The RST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None

Expand Down Expand Up @@ -106,8 +106,8 @@
# a list of builtin themes.
html_theme = 'default'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# Theme options are theme-specific and customize the look and feel of a theme.
# For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}

Expand All @@ -127,7 +127,7 @@
html_logo = 'images/Horizen_UBD_white.svg'

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
html_favicon = 'images/Horizen_favicon_32x32.png'

Expand Down Expand Up @@ -197,7 +197,7 @@
htmlhelp_basename = 'Horizen Sidechains SDK'


# -- Options for LaTeX output ---------------------------------------------
# -- Options for LaTeX Output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
Expand Down Expand Up @@ -239,7 +239,7 @@
#latex_domain_indices = True


# -- Options for manual page output ---------------------------------------
# -- Options for Manual Page Output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
Expand All @@ -252,7 +252,7 @@
#man_show_urls = False


# -- Options for Texinfo output -------------------------------------------
# -- Options for Texinfo Output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Horizen Sidechains SDK Documentation
Overview
********

Horizen Sidechain SDK allows developers developers to quickly spin-up their own blockchain, customize business
logic depending on use case, maintain interoperability with the Mainchain native token (which acts as the medium of
Horizen Sidechain SDK allows developers to quickly spin-up their own blockchain, customize business
logic depending on use case, maintain interoperability with the mainchain native token (which acts as the medium of
exchange between the whole ecosystem).

Sidechain SDK offers out-of-the-box support for the common features you'd expect
Expand Down
32 changes: 16 additions & 16 deletions docs/introduction/01-install.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.. _install-sidechain-sdk-tutorial:

########################
Installing Sidechain SDK
Installing the Sidechain SDK
########################

We'll get started by setting up our environment.

*******************
Supported platforms
Supported Platforms
*******************

Sidechains-SDK is available and tested on Linux and Windows (64bit).
Expand All @@ -24,14 +24,14 @@ Horizen Sidechain SDK requires Java 8 or newer (Java 11 recommended), Scala 2.1
Installing on Windows OS:
*************************

1. Install Java JDK version 11 (link)
2. Install Scala 2.12.10+ (link)
3. Install Git (link)
1. Install Java JDK version 11 (`link <https://www.oracle.com/java/technologies/javase-jdk11-downloads.html>`_)
2. Install Scala 2.12.10+ (`link <https://www.scala-lang.org/download/2.12.10.html>`_)
3. Install Git (`link <https://git-scm.com/downloads>`_)
4. Clone the Sidechains-SDK git repository

.. code:: Bash

git clone git@github.com:ZencashOfficial/Sidechains-SDK.git
git clone git@github.com:HorizenOfficial/Sidechains-SDK.git

5. As IDE, please install and use IntelliJ IDEA Community Edition (link) In the IDE, please also install the Intellij Scala plugin: in the Settings->Plugins tab, select it from the marketplace:

Expand All @@ -46,9 +46,9 @@ Installing on Windows OS:
Installing on Linux OS:
***********************

1. Install Java JDK version 11 (link)
2. Install Scala 2.12.10+ (link)
3. Install Git (link)
1. Install Java JDK version 11 (`link <https://www.oracle.com/java/technologies/javase-jdk11-downloads.html>`_)
2. Install Scala 2.12.10+ (`link <https://www.scala-lang.org/download/2.12.10.html>`_)
3. Install Git (`link <https://git-scm.com/downloads>`_)
4. Clone the Sidechains-SDK git repository

.. code:: Bash
Expand All @@ -60,9 +60,9 @@ Installing on Linux OS:
.. image:: /images/intellij.png
:alt: IntelliJ

6. In the IDE, you can now go to File and Open the root directory of the project repository, “\Sidechains-SDK”. The pom.xml file, the Maven’s Project Object Model XML file that contains all the project configuration details should be automatically imported by the IDE. Otherwise, you can just open it.
7. Keep reading this tutorial, and start playing with the code. You will find some sidechain examples in the “examples/simpleapp” directory, that you can customize, start from there! When you are ready to run your standalone sidechain, you can install Maven (link).
8. To produce your specific sidechain jar files, you can change directory to the repository root and run the “mvn package” command.
6. In the IDE, you can now go to File and Open the root directory of the project repository, “\Sidechains-SDK”. The pom.xml file - the Maven Project Object Model XML file that contains all the project configuration details - should be automatically imported by the IDE. Otherwise, you can just open it.
7. Keep reading this tutorial, and start playing with the code. You will find some sidechain examples in the “examples/simpleapp” directory that you can customize. Start from there! When you are ready to run your own sidechain, you can install Maven (link).
8. To produce your specific sidechain jar files, you can change the directory to the repository root and run the “mvn package” command.


*************************
Expand All @@ -71,14 +71,14 @@ Sidechain SDK Components:

As a result of step 8, three jar files will be generated:

* **sdk/target/Sidechains-SDK-0.2.0.jar** - the main SDK jar file, that contains all the necessary classes and components;
* **tools/sctool/target/Sidechains-SDK-ScBootstrappingTools-0.2.0.jar** - executable bootstrap tool. It is used to create the configuration of the new Sidechain. You can find all available commands and examples of usage here
* **sdk/target/Sidechains-SDK-0.2.0.jar** - The main SDK jar file that contains all the necessary classes and components
* **tools/sctool/target/Sidechains-SDK-ScBootstrappingTools-0.2.0.jar** - An executable bootstrap tool. It is used to create the configuration of the new Sidechain. You can find all available commands and examples of usage here

.. code:: Bash

examples/simpleapp/mc_sc_workflow_example.md file;
examples/simpleapp/mc_sc_workflow_example.md;

* **examples/simpleapp/target/Sidechains-SDK-simpleapp-0.2.0.jar** - in contains a Sidechain application example. You can find more details in the examples/simpleapp/readme.md file.
* **examples/simpleapp/target/Sidechains-SDK-simpleapp-0.2.0.jar** - in contains a sidechain application example. You can find more details in the examples/simpleapp/readme.md file.



Expand Down
5 changes: 2 additions & 3 deletions docs/introduction/02-blockchain-representation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Concept of a BOX
****************

A box generalizes the concept of Bitcoin’s UTXOs.
A box is a cryptographic object that can be was created with some secret keys. This box can be opened(spent) by the owner of those secret keys. Once opened by the owner of the secret keys the box may not be opened again.
A box is a cryptographic object that can be created with some secret keys. This box can be open \ (spent) by the owner of those secret keys. Once opened by the owner of the secret keys the box may not be opened again.

Node Main elements & intro to a "NodeView"
******************************************
Expand All @@ -25,8 +25,7 @@ Node Main elements & intro to a "NodeView"
* **Wallet**
* The “Wallet” has two main functionalities:
1. It holds the Secret keys that belong to that specific Node.
2. It keeps track of objects that are of interest to this specific node, e.g. received coins (output boxes whose secret keys are known by the node) and views of them (e.g. balances).

2. It keeps track of objects that are of interest to this specific node, e.g. received coins (output boxes whose secret keys are known by the node) and views of them (e.g. balances).
* **Memory Pool**
* The “Memory pool” is a list of transactions that are known to the node but have not made it to a Sidechain block yet.

Expand Down
5 changes: 5 additions & 0 deletions docs/introduction/03-Cross-chain-transfer-protocol.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ At a high level, it defines two basic operations:
* **forward transfer**
* **backward transfer**


While all sidechains know and follow the mainchain, which is an established and stable reality, the mainchain needs to be made aware of the existence of every sidechain. So, sidechains must be declared in mainchain first.

We can declare a new sidechain by using the following RPC command:
Expand All @@ -32,16 +33,20 @@ As a consequence of the sidechain declaration command, a unique sidechain id wil
Forward Transfer
================


A forward transfer sends coins from the mainchain to a sidechain. The Horizen mainchain supports a forward transfer transaction type, that specifies the sidechain destination (sidechain id and receiver address) and the amounts of ZEN to be sent. From a mainchain perspective, the transferred coins are destroyed, they are only represented in the total balance of that particular sidechain.
On the sidechain side, the SDK provides all the functionalities that support forward transfers, so that a transferred amount is “converted” into a new sidechain box.


Backward Transfer
=================

A backward transfer moves coins back from a sidechain to a mainchain destination.

A backward transfer is initiated by a **withdrawal request** which is a sidechain transaction issued by the coin owner. The request specifies the mainchain destination, and the amount. More precisely, the withdrawal request owner will create a WithdrawalRequestBox that destroys the specified amount of coins in a sidechain. This is not enough to move those coins back to the mainchain though. We need to wait the end of the withdrawal epoch, when all the coins specified in that epoch’s withdrawal requests are listed in a single certificate, that is the propagated to the mainchain.
The certificate includes a succinct cryptographic proof that the rules associated with the declared verifying key have been respected. Certificates are processed by mainchain consensus, which recreates the coins specified by the certificate, only checking that the proof verifies and that the coins received by a sidechain are not more than the amount sent to it.


Summary
=======

Expand Down
4 changes: 2 additions & 2 deletions docs/introduction/04-Latus-Consensus.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ A slot leader eligible for a certain slot, that decides to create and propagate

Forgers are also entitled and incentivized to include sidechain transactions and mainchain synchronization data into Sidechain Blocks.
A limited amount of mainchain block data is added to sidechain blocks, in such a way that all the mainchain transactions that refer to a particular sidechain are included in that sidechain, that a reference to each mainchain block is present in all sidechains, and that enough information is published in a sidechain such that any sidechain node is able to validate the mainchain block references without the need for a direct connection to the mainchain itself. Please note, the forger will need its own direct connection to mainchain nodes, to have a source of mainchain blocks data.
The connection between Mainchain and Sidechain nodes is established via a websocket interface provided by the mainchain node.
The connection between the mainchain and sidechain nodes is established via a websocket interface provided by the mainchain node.

The Latus consensus, including MainchainBlock synchronization and all forging logic and functionality, is implemented out-of-the-box by the SDK Core, and developers do not need to make any change to this. The forging process can be fully managed through the API interface provided by the SDK (see the next topic).
The Latus consensus, including mainchain block synchronization, forging logic and functionality, is implemented out-of-the-box by the core SDK, and developers do not need to make any changes to this. The forging process can be fully managed through the API interface provided by the SDK (see the next topic).

Default Latus consensus parameters
==================================
Expand Down
4 changes: 2 additions & 2 deletions docs/introduction/05-Node-communication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Communication between a user and a sidechain node is supported out of the box v

The API configuration can be found in the sidechain configuration file.

For example see the restApi section of the following file for the SimpleApp.
For example see the restApi section of the following file for the SimpleApp:

.. code:: bash

Expand All @@ -15,7 +15,7 @@ For example see the restApi section of the following file for the SimpleApp.

The available options are:

bindAddress -- “IP:port” address for sending HTTP request,e.g. "127.0.0.1:9085"
bindAddress -- “IP:port” address for sending HTTP request, e.g. "127.0.0.1:9085"

api-key-hash -- Authentication header must be a string that hashes to the field "api-key-hash" specified in each SC node conf file. Auth header could be empty If no api-key-hash is specified

Expand Down
18 changes: 11 additions & 7 deletions docs/introduction/06-Base-App.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,29 @@
Base App
========

SidechainsSDK provides to the developers an out of the box implementation of the Latus Consensus Protocol and the Crosschain Transfer Protocol.
Sidechain SDK provides to the developers an out of the box implementation of the Latus Consensus Protocol and the Crosschain Transfer Protocol.
Additionally to this, the SDK provides basic transactions, network layer, data storage and node configuration, as well as entry points for any custom extension.


Secret / Proof / Proposition
****************************

* **Secret / Proof / Proposition** - SDK uses its own terms for secret key / public key / signed message and provides various types of them.
* **Sidechain SDK** uses its own terms for secret key / public key / signed message and provides various types of them.
* **Secret** - Private key
* **Proof** - Signed message
* SDK provides implementations for Secret / Proof / Proposition

* SDK provides the following implementations for Secret / Proof / Proposition

* Curve 25519
- PrivateKey25519
- PublicKey25519Proposition
- Signature25519

* VRF based on ginger-lib
- VrfSecretKey
- VrfPublicKey
- VrfProof

* Schnorr based on ginger-lib
- SchnorrSecret
- SchnorrPropostion
Expand All @@ -38,7 +41,7 @@ that represents some coins, i.e. that holds an intrinsic defined value. As an ex
some kind of smart contract.
In particular, any box could be logically split in two parts: Box and BoxData (box data is included in the box). The Box itself represents the entity in the blockchain,
i.e. all operations like create/open etc. are performed on boxes. Box data contains information about the entity like value, proposition address and any custom data.
Every box has its own unique boxId (do not be confused with box type id which is used for serialization). That box id is calculated for each box by next function:
Every box has its own unique boxId (not be confused with box type id which is used for serialization). That box id is calculated for each box by next function:

::

Expand All @@ -60,16 +63,17 @@ Every box has its own unique boxId (do not be confused with box type id which is
The following Coin-Box types are provided by SDK:
* **RegularBox** -- contains ZEN coins
* **ForgerBox** -- contains ZEN coins are used for forging
* **WithdrawalRequestBox** -- contain ZEN coins are used to backward transfer, i.e. move coins back to the mainchain
An SDK developer can declare his own Boxes, please refer to SDK extension section.
* **WithdrawalRequestBox** -- contain ZEN coins are used to backward transfer, i.e. move coins back to the mainchain.

An SDK developer can declare custom Boxes, please refer to SDK extension section.

Transactions
************

There are two basic transactions: `MC2SCAggregatedTransaction
<https://github.com/HorizenOfficial/Sidechains-SDK/blob/master/sdk/src/main/java/com/horizen/transaction/MC2SCAggregatedTransaction.java>`_ and `SidechainCoreTransaction
<https://github.com/HorizenOfficial/Sidechains-SDK/blob/master/sdk/src/main/java/com/horizen/transaction/SidechainCoreTransaction.java>`_.
An MC2SCAggregatedTransaction is the implementation of Forward Transfer and can be only added as a part of the MainchainBlock reference data during synchronization with Mainchain.
An MC2SCAggregatedTransaction is the implementation of Forward Transfer and can be only added as a part of the mainchain block reference data during synchronization with mainchain.
When a Forger is going to produce a sidechain block and a new mainchain block appears, the forger will recreate that mainchain block as a reference that will contain sidechain
related data. So, if some Forward Transfer exists in the mainchain block, it will be included into the MC2SCAggregatedTransaction and added as a part of the reference.
The SidechainCoreTransaction is the transaction, which can be created by anyone to send coins inside a sidechain, create forging stakes or perform withdrawal requests
Expand Down
Loading