Automatic Crypto  Coin Control  - .NET Core App

If you have staked any crypto currencies you know that you have to (with many projects) run what is called “Coin Control” to place all your coins back in one input to get rewards faster.  I decided to build out a .NET Core Control Control application that includes a class library that will communicate with any wallet that uses Bitcoin type RPC commands.   I am currently using this on a staking wallet for the crypto LINDA Project ($LINDA)

Coin Control Process

The coin control process can be time consuming since you do not know when you will get a reward and you have to continue to check your wallet. Doing this automatically would help get rewards more consistently and without any lags. 

Screen shot of the Coin Control App (CC) (Microsoft Windows Example). In this case the CC app will run every 30 minutes checking for a reward. Once a reward is found the CC process runs to send all the coins to the main staking address in the wallet and unlocks the wallet for staking again. 

Security

  • Wallet Passphrase is encrypted by a feature in the app and cannot be decrypted.
  • Email password is encrypted by a feature in the app and cannot be decrypted.
  • The app will not send coins to any address if it does not exist in the staking wallet.

Configuration

Configuration is very flexible you setup your RPC Information, your staking address, and (using a feature of the app) encrypt your wallet passphrase to make it secure.

There are security features in the app that only allows the Coin Control sending of transactions to an address that exists in the wallet. If you change the “WalletStakingAddress” to an address that does not exist. The app will show an error and the process is halted.

Logging and Email

The application logs all processes and errors and sends emails once a Coin Control cycle is complete.

Use with Other Staking Wallets

We are testing and using this currently for LINDA. Any wallet that supports the following RPC commands would work with this process.

  • getbalance
  • getnewaddress
  • listunspent
  • listaddressgroupings
  • searchrawtransactions
  • sendtoaddress
  • walletpassphrase
  • walletlock

This process has worked so well that I moved any LINDA Master Nodes to all staking. This way I do not have to monitor any issues with a master node.

Obfuscar - C# Obfuscation

Recently I was looking at couple of products to obfuscate C# code and came across Obfuscar

You can run Obfuscar via a command line or on the Post Build Events in Visual Studio.

There are a few steps to add this to the post build of any project.

1. Add Obfuscar NuGet Package to your solution.

2. Add obfuscar.xml file to your project and change Copy to Output Directory: Always.

In this config I want to obfuscate a DLL for a blockchain project I am working on.

<?xml version='1.0'?>
<Obfuscator>
  <Var name="InPath" value="C:...[path to your project output folder]" />
  <Var name="OutPath" value="$(InPath)\Obfuscator_Output" />
  <Var name="KeepPublicApi" value="false" />
  <Var name="HidePrivateApi" value="true" />
  <Var name="RenameProperties" value="true" />
  <Var name="RenameEvents" value="true" />
  <Var name="RenameFields" value="true" />
  <Var name="UseUnicodeNames" value="true" />
  <Var name="HideStrings" value="true" />
  <Var name="OptimizeMethods" value="true" />
  <Var name="SuppressIldasm" value="true" />
  <Module file="$(InPath)\CoinControl.dll" />
</Obfuscator>

3. In the Visual Studio post build events enter: "$(Obfuscar)" obfuscar.xml

After you run the build (in your debug or release folder) you will have a fully obfuscated binary under a folder named: Obfuscator_Output.

TFS Project not Bound to Source Control

I had a solution with 5 projects but two were in source control but never showed as checked out.

I was looking for a way to "bind" these to TFS that option was not showing up.  This link shows how to do it.

To bind source control projects and solutions to Visual Studio

  1. Highlight the project or solution you wish to bind to Team Foundation source control in Solution Explorer.

  2. From the File menu, choose Source Control, and then choose Change Source Control.

  3. In Change Source Control dialog box, click Bind.

To unbind source control projects and solutions to Visual Studio

  1. Highlight the project or solution you wish to unbind in Team Foundation source control in Solution Explorer.

  2. From the File menu, choose Source Control, and then choose Change Source Control.

  3. In the Change Source Control dialog box, highlight the solution or project you wish to unbind from source control, and in the toolbar, click Unbind.