Skip to content

Commit

Permalink
Merge branch 'master' into feature-BIT-181
Browse files Browse the repository at this point in the history
  • Loading branch information
dario-ramos authored Jul 17, 2018
2 parents e1d9beb + 4ab9959 commit d6aed0f
Show file tree
Hide file tree
Showing 16 changed files with 499 additions and 634 deletions.
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "bitprim-cs"]
path = bitprim-cs
url = https://github.com/bitprim/bitprim-cs
branch = master
24 changes: 13 additions & 11 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ build: off
branches:
only:
- master
- dev
- /^v\d+\.\d+\.\d+$/
- /^release-\d+\.\d+\.\d+$/
- /^feature-ci-.+$/
- /^feature_ci_.+$/


skip_branch_with_pr: true

platform:
- x64
Expand All @@ -35,8 +33,6 @@ configuration:
- Release

environment:
access_token:
secure: ErUbaWTVjfp8LLH3y6Zh+20sXGFrmIyIb2xMPDsRwtPDSoTCCmFmD6zEJ1b2R6NE

VS150COMNTOOLS: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\Tools\\"

Expand All @@ -46,15 +42,21 @@ environment:

install:
- git submodule init
- git submodule update
- git submodule update --remote
- cinst docfx

build_script:
- docfx

on_success:
- git clone "https://%GIT_ACCESS_TOKEN%@github.com/bitprim/bitprim.github.io.git"
- git config --global user.email "[email protected]"
- git config --global user.name "bitprim-ci"
- cd _site
- xcopy *.* C:\projects\bitprim-docs\bitprim.github.io\docfx\ /s /e /y
- cd ../bitprim.github.io
- git add .
- git commit -m "Updated documentation site"
- git push

- ps: |
./deploy.ps1
test: off
2 changes: 1 addition & 1 deletion bitprim-cs
80 changes: 80 additions & 0 deletions content/developer_guide/dotnet/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Installation

## Prerequisites

* 64-bit machine.
* Conan package manager, version 1.1.0 or newer. See [Conan Installation](http://docs.conan.io/en/latest/installation.html#install-with-pip-recommended).

In case there are no pre-built binaries for your platform, conan will automatically try to build from source code. In such a scenario, the following requirements must be added to the previous ones:

* C++11 Conforming Compiler.
* CMake building tool, version 3.4 or newer.

## Installation

You can install the Bitprim C# binding via Nuget.

There are two packages available:

For Bitcoin Cash (BCH) you need to use https://www.nuget.org/packages/bitprim-bch/
and for Bitcoin Legacy (BTC) you need to use https://www.nuget.org/packages/bitprim-btc/

If you use Visual Studio, you can use the UI or the Package Manager.

### UI

* Right click on your project
* Select *Manage Nuget Packages*
* Search for bitprim-bch or bitprim-btc
* Click Install

### Package Manager

* Open Package Manager
* Run the following command

```
Install-Package bitprim-bch
or
Install-Package bitprim-btc
```

If you are using dotnet cli:

```
dotnet add package bitprim-bch
or
dotnet add package bitprim-btc
```

## Building from source

If you want to build from source, you need the following prerequisites:

* .Net Framework 4.6.1
* .Net Core 2.0
* Powershell (Windows only)

Run the following commands:

```
git clone https://github.com/bitprim/bitprim-cs.git
cd bitprim-cs
if you are on Windows, run:
powershell ./build.ps1
if you are in Linux or osx :
chmod +x build.sh
./build.sh
```

If you have problems running build.ps1 please check this link
[https://cakebuild.net/docs/tutorials/powershell-security](https://cakebuild.net/docs/tutorials/powershell-security)
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ The platform invoke mechanism was chosen in order to support as many operating

## Basic structure

---
The api is fully written in C#.

See [the source in Github](https://github.com/bitprim/bitprim-cs/tree/master):

* **idiomatic classes**: Object oriented abstractions over Bitcoin concepts: Chain, Transaction, Block, Header, and so on. The Executor class is responsible for handling node execution.
* **native classes**: These are all static classes, since each of these contains a set of DllImports of the native C functions.


## .Net standard Support

The api implements .net standard 2.0 support to allow multiple consumers.

## Multiples coins

Our API implements bindings for Bitcoin Cash (BCH) and Bitcoin Legacy (BCT). Litecoin (LTC) is in progress.

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#How to create addresses

If you want to receive coins you need to generate an address.

In this tutorial you will learn:

* How to generate a seed
* How to generare a private key
* How to generate a public key
* How to generate an address


## Generate Seed

First you need a seed to generate the private key. The seed must be a random string with a high degree of entropy.
For this, we use the following method.

```c#

```

## Generate Private key

Now we can generate the private key. The private key has 256 bits in length. And can be encoded in different formats:

* Raw
* Hex
* WIF
* WIF-Compressed

```c#

```


## Generate Public key

The public key is derived from the private key using elliptic curve calculations. The public key can be compressed or uncompressed.

```c#
```



## Generate Address

Now we can generate our public address to share with anyone.
If K is the public key, the resulting address A is:

```
A = Base58Check(RIPEMD160(SHA256(K)))
```


```c#
```

Loading

0 comments on commit d6aed0f

Please sign in to comment.