Merchant API reference implementation

Overview

mAPI

More details available in the BRFC Spec for Merchant API.

The old golang (v1.1) implementation is no longer being maintained and has been moved to the golang-v1.1 branch.

Swagger UI

The REST API can also be seen in the Swagger UI.

Support

For support and general discussion of both standards and reference implementations please join the following telegram group.

Requirements

mAPI requires access to Bitcoin SV node version 1.0.6 or newer. See Managing nodes for details how to connect to a bitcoin node.

For running in production, you should should use Docker. Docker images are created as part of the build. See Deploying docker images for details how to run them.

A SSL server certificate is required for installation. You can obtain the certificate from your IT support team. There are are also services that issue free SSL certificates such as letsencrypt.org. The certificate must be issued for the host with fully qualified domain name. To use the server side certificate, you need to export it (including corresponding private key) it in PFX file format (*.pfx).

For setting up development environment see bellow

REST interface

The reference implementation exposes different REST API interfaces

  • an interface for submitting transactions implemented according BRFC Spec
  • an admin interface for managing connections to bitcoin nodes and fee quotes

Public interface

Public interface can be used to submit transactions and query transactions status. It is accessible to both authenticated and unauthenticated users, but authenticated users might get special fee rates.

1. getFeeQuote

GET /mapi/feeQuote

2. submitTransaction

POST /mapi/tx

To submit a transaction in JSON format use Content-Type: application/json with the following request body:

{
  "rawtx":        "[transaction_hex_string]",
  "callbackUrl":  "https://your.service.callback/endpoint",
  "callbackToken" : "Authorization: <your_authorization_header>",
  "merkleProof" : true,
  "dsCheck" : true
}

To submit transaction in binary format use Content-Type: application/octet-stream with the binary serialized transaction in the request body. You can specify callbackUrl, callbackToken, merkleProof and dsCheck in the query string.

If a double spend notification or merkle proof is requested in Submit transaction, the response is sent to the specified callbackURL. Where recipients are using SPV Channels, this would require the recipient to have a channel setup and ready to receive messages. Check Callback Notifications for details.

3. queryTransactionStatus

GET /mapi/tx/{hash:[0-9a-fA-F]+}

4. sendMultiTransaction

POST /mapi/txs

To submit a list of transactions in JSON format use Content-Type: application/json with the following request body:

[
  {

    "rawtx":        "[transaction_hex_string]",
    "callbackUrl":  "https://your.service.callback/endpoint",
    "callbackToken" : "Authorization: <your_authorization_header>",
    "merkleProof" : true,
    "dsCheck" : true
  },
  ....
]

You can also omit callbackUrl, callbackToken, merkleProof and dsCheck from the request body and provide the values in the query string.

To submit transaction in binary format use Content-Type: application/octet-stream with the binary serialized transactions in the request body. Use query string to specify the remaining parameters.

Callback Notifications

Merchants can request callbacks for merkle proofs and/or double spend notifications in Submit transaction.

Double Spend example:

POST /mapi/tx

Request:

Request Body:

{
    "rawtx": "01000000015d7d8ffefc2b95a68a95d8e3c50715f8affc0e56ef58a05c773789e6fa3eb537010000006a47304402206c1ba36989bdca944c4ac1e74c23afaaf93fb6ded3a3d6e01f2c28667373c26e0220676085f6fe30071022ea5c8e790e7d9cf52671d0bc3c4d374991be65b6e11bc34121027ae06a5b3fe1de495fa9d4e738e48810b8b06fa6c959a5305426f78f42b48f8cffffffff018c949800000000001976a91482932cf55b847ffa52832d2bbec2838f658f226788ac00000000",
    "callbackUrl":"https://your-server/api/v1/channel/533",
    "callbackToken":"CNaecHA44nGNJCvvccx3TSxwb4F490574knnkf44S19W6cNmbumVa6k3ESQw",
    "merkleProof":false,
    "dsCheck": true
}

Response:

{
    "payload": "{\"apiVersion\":\"1.2.0\",\"timestamp\":\"2020-11-13T08:04:25.9291559Z\",\"txid\":\"0d0ad5677eb0862f94b3eda7f13633f91cf7c4c8c14e1451ffd333d52ff8e207\",\"returnResult\":\"failure\",\"resultDescription\":\"Missing inputs\",\"minerId\":\"030d1fe5c1b560efe196ba40540ce9017c20daa9504c4c4cec6184fc702d9f274e\",\"currentHighestBlockHash\":\"100677f99bdd7d4f0b8ea3f35d575d0f69a80f89b5b5f14e11005f57e5e63ef5\",\"currentHighestBlockHeight\":151,\"txSecondMempoolExpiry\":0,\"conflictedWith\":[{\"txid\":\"9f817649adde97338bcda695ee13ae1c71960eac60e49671fed0bdcf45581d94\",\"size\":191,\"hex\":\"01000000015d7d8ffefc2b95a68a95d8e3c50715f8affc0e56ef58a05c773789e6fa3eb537010000006a47304402206a9372778ff1ea314cfb2ec4e6bc93a57fe67c5ca915d004850f8079c876977c022066e3581cbec0eb2d525d4d83d01fff4f4e0b13a477f4f6a07d9168cc40bbabe54121027ae06a5b3fe1de495fa9d4e738e48810b8b06fa6c959a5305426f78f42b48f8cffffffff0198929800000000001976a91482932cf55b847ffa52832d2bbec2838f658f226788ac00000000\"}]}",
    "signature": "3044022048739a74a7f14b870d410f02c60dafcee2899348c7cd1184977e9ac5096ba63a022038ca0066645d1201ba0f385bd88da4c9bc7410582ae7bb3e248d79b7dbcfd205",
    "publicKey": "030d1fe5c1b560efe196ba40540ce9017c20daa9504c4c4cec6184fc702d9f274e",
    "encoding": "UTF-8",
    "mimetype": "application/json"
}

Merkle proof callback can be requested by specifying:

{
 "merkleProof": true
}

If callback was requested on transaction submit, merchant should receive a notification of doublespend and/or merkle proof via callback URL. mAPI process all requested notifications and sends them out in batches. Callbacks have three possible callbackReason: "doubleSpend", "doubleSpendAttempt" and "merkleProof". DoubleSpendAttempt implies, that double spend was detected in mempool.

Double spend callback example:

{	
  "callbackPayload": "{\"doubleSpendTxId\":\"f1f8d3de162f3558b97b052064ce1d0c45805490c210bdbc4d4f8b44cd0f143e\", \"payload\":\"01000000014979e6d8237d7579a19aa657a568a3db46a973f737c120dffd6a8ba9432fa3f6010000006a47304402205fc740f902ccdadc2c3323f0258895f597fb75f92b13d14dd034119bee96e5f302207fd0feb68812dfa4a8e281f9af3a5b341a6fe0d14ff27648ae58c9a8aacee7d94121027ae06a5b3fe1de495fa9d4e738e48810b8b06fa6c959a5305426f78f42b48f8cffffffff018c949800000000001976a91482932cf55b847ffa52832d2bbec2838f658f226788ac00000000\"}",
  "apiVersion": "1.2.0",
  "timestamp": "2020-11-03T13:24:31.233647Z",
  "minerId": "030d1fe5c1b560efe196ba40540ce9017c20daa9504c4c4cec6184fc702d9f274e",
  "blockHash": "34bbc00697512058cb040e1c7bbba5d03a2e94270093eb28114747430137f9b7",
  "blockHeight": 153,
  "callbackTxId": "8750e986a296d39262736ed8b8f8061c6dce1c262844e1ad674a3bc134772167",
  "callbackReason": "doubleSpend"
}

Double spend attempt callback example:

{	
  "callbackPayload": "{\"doubleSpendTxId\":\"7ea230b1610768374285150537323add313c1b9271b1b8110f5ddc629bf77f46\", \"payload\":\"0100000001e75284dc47cb0beae5ebc7041d04dd2c6d29644a000af67810aad48567e879a0000000006a47304402203d13c692142b4b50737141145795ccb5bb9f5f8505b2d9b5a35f2f838b11feb102201cee2f2fe33c3d592f5e990700861baf9605b3b0199142bbc69ae88d1a28fa964121027ae06a5b3fe1de495fa9d4e738e48810b8b06fa6c959a5305426f78f42b48f8cffffffff018c949800000000001976a91482932cf55b847ffa52832d2bbec2838f658f226788ac00000000\"}",
  "apiVersion": "1.2.0",
  "timestamp": "2020-11-03T13:24:31.233647Z",
  "minerId": "030d1fe5c1b560efe196ba40540ce9017c20daa9504c4c4cec6184fc702d9f274e",
  "blockHash": "34bbc00697512058cb040e1c7bbba5d03a2e94270093eb28114747430137f9b7",
  "blockHeight": 153,
  "callbackTxId": "8750e986a296d39262736ed8b8f8061c6dce1c262844e1ad674a3bc134772167",
  "callbackReason": "doubleSpendAttempt"
}

Merkle proof callback example:

{	  
  "callbackPayload": "{\"flags\":2,\"index\":1,\"txOrId\":\"acad8d40b3a17117026ace82ef56d269283753d310ddaeabe7b5d226e8dbe973\",\"target\": {\"hash\":\"0e9a2af27919b30a066383d512d64d4569590f935007198dacad9824af643177\",\"confirmations\":1,\"height\":152,\"version\":536870912,\"versionHex\":"20000000",\"merkleroot\":\"0298acf415976238163cd82b9aab9826fb8fbfbbf438e55185a668d97bf721a8\",\"num_tx\":2,\"time\":1604409778,\"mediantime\":1604409777,\"nonce\":0,\"bits\":\"207fffff\",\"difficulty\":4.656542373906925E-10,\"chainwork\":\"0000000000000000000000000000000000000000000000000000000000000132\",\"previousblockhash\":\"62ae67b463764d045f4cbe54f1f7eb63ccf70d52647981ffdfde43ca4979a8ee\"},\"nodes\":[\"5b537f8fba7b4057971f7e904794c59913d9a9038e6900669d08c1cf0cc48133\"]}",
  "apiVersion":"1.2.0",
  "timestamp":"2020-11-03T13:22:42.1341243Z",
  "minerId":"030d1fe5c1b560efe196ba40540ce9017c20daa9504c4c4cec6184fc702d9f274e",
  "blockHash":"0e9a2af27919b30a066383d512d64d4569590f935007198dacad9824af643177",
  "blockHeight":152,
  "callbackTxId":"acad8d40b3a17117026ace82ef56d269283753d310ddaeabe7b5d226e8dbe973",
  "callbackReason":"merkleProof"
}

Authorization/Authentication and Special Rates

Merchant API providers would likely want to offer special or discounted rates to specific customers. To do this they would need to add an extra layer to enable authorization/authentication on public interface. Current implementation supports JSON Web Tokens (JWT) issued to specific users. The users can include that token in their HTTP header and as a result receive lower fee rates.

If no token is used and the call is done anonymously, then the default rate is supplied. If a JWT token (issued by merchant API or other identity provider) is used, then the caller will receive the corresponding fee rate. At the moment, for this version of the merchant API implementation, the token must be issued and sent to the customer manually.

Authorization/Authentication Example

$ curl -H "Authorization:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOiIyMDIwLTEwLTE0VDExOjQ0OjA3LjEyOTAwOCswMTowMCIsIm5hbWUiOiJsb3cifQ.LV8kz02bwxZ21qgqCvmgWfbGZCtdSo9px47wQ3_6Zrk" localhost:5051/mapi/feeQuote

JWT Token Manager

The reference implementation contains a token manager that can be used to generate and verify validity of the tokens. Token manager currently only supports symmetric encryption HS256.

The following command line options can be specified when generating a token

Options:
  -n, --name <name> (REQUIRED)        Unique name of the subject token is being issued to
  -d, --days <days> (REQUIRED)        Days the token will be valid for
  -k, --key <key> (REQUIRED)          Secret shared use to sign the token. At lest 16 characters
  -i, --issuer <issuer> (REQUIRED)    Unique issuer of the token (for example URI identifiably the miner)
  -a, --audience <audience>           Audience tha this token should be used for [default: merchant_api]

For example, you can generate the token by running

$ TokenManager generate -n specialuser -i http://mysite.com -k thisisadevelopmentkey -d 1000

Token:{"alg":"HS256","typ":"JWT"}.{"sub":"specialuser","nbf":1599494789,"exp":1685894789,"iat":1599494789,"iss":"http://mysite.com","aud":"merchant_api"}
Valid until UTC: 4. 06. 2023 16:06:29

The following should be used as authorization header:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzcGVjaWFsdXNlciIsIm5iZiI6MTU5OTQ5NDc4OSwiZXhwIjoxNjg1ODk0Nzg5LCJpYXQiOjE1OTk0OTQ3ODksImlzcyI6Imh0dHA6Ly9teXNpdGUuY29tIiwiYXVkIjoibWVyY2hhbnRfYXBpIn0.xbtwEKdbGv1AasXe_QYsmb5sURyrcr-812cX-Ps98Yk

Now any specialuser using this token will be offered special fee rates when uploaded. The special fees needs to be uploaded through admin interface

To validate a token, you can use validate command:

$ TokenManager validate -k thisisadevelopmentkey -t eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzcGVjaWFsdXNlciIsIm5iZiI6MTU5OTQ5NDc4OSwiZXhwIjoxNjg1ODk0Nzg5LCJpYXQiOjE1OTk0OTQ3ODksImlzcyI6Imh0dHA6Ly9teXNpdGUuY29tIiwiYXVkIjoibWVyY2hhbnRfYXBpIn0.xbtwEKdbGv1AasXe_QYsmb5sURyrcr-812cX-Ps98Yk

Token signature and time constraints are OK. Issuer and audience were not validated.

Token:
{"alg":"HS256","typ":"JWT"}.{"sub":"specialuser","nbf":1599494789,"exp":1685894789,"iat":1599494789,"iss":"http://mysite.com","aud":"merchant_api"}

Admin interface

Admin interface can be used to add, update or remove connections to this node. It is only accessible to authenticated users. Authentication is performed through Api-Key HTTP header. The provided value must match the one provided in configuration variable RestAdminAPIKey.

Managing fee quotes

To create a new fee quote use the following:

POST api/v1/FeeQuote

Example with curl - add feeQuote valid from 01/10/2020 for anonymous user:

$ curl -H "Api-Key: [RestAdminAPIKey]" -H "Content-Type: application/json" -X POST https://localhost:5051/api/v1/FeeQuote -d "{ \"validFrom\": \"2020-10-01T12:00:00\", \"identity\": null, \"identityProvider\": null, \"fees\": [{ \"feeType\": \"standard\", \"miningFee\" : { \"satoshis\": 100, \"bytes\": 200 }, \"relayFee\" : { \"satoshis\": 100, \"bytes\": 200 } }, { \"feeType\": \"data\", \"miningFee\" : { \"satoshis\": 100, \"bytes\": 200 }, \"relayFee\" : { \"satoshis\": 100, \"bytes\": 200 } }] }"

To get list of all fee quotes, matching one or more criterias use the following

GET api/v1/FeeQuote

You can filter fee quotes by providing additional optional criteria in query string:

  • identity - return only fee quotes for users that authenticate with a JWT token that was issued to specified identity
  • identityProvider - return only fee quotes for users that authenticate with a JWT token that was issued by specified token authority
  • anonymous - specify true to return only fee quotes for anonymous user.
  • current - specify true to return only fee quotes that are currently valid.
  • valid - specify true to return only fee quotes that are valid in interval with QuoteExpiryMinutes

To get list of all fee quotes (including expired ones) for all users use GET api/v1/FeeQuote without filters.

To get a specific fee quote by id use:

GET api/v1/FeeQuote/{id}

Note: it is not possible to delete or update a fee quote once it is published, but you can make it obsolete by publishing a new fee quote.

Managing nodes

The reference implementation can talk to one or more instances of bitcoind nodes.

Each node that is being added to the Merchant API has to have zmq notifications enabled (pubhashblock, pubinvalidtx, pubdiscardedfrommempool). When enabling zmq notificationas on node, care should be taken that the URI that will be used for zmq notification is accessible from the host where the MerchantAPI will be running (WARNING: localhost (127.0.0.1) should only be used if bitcoin node and MerchantAPI are running on same host)

To create new connection to a new bitcoind instance use:

POST api/v1/Node

Add node with curl:

curl -H "Api-Key: [RestAdminAPIKey]" -H "Content-Type: application/json" -X POST https://localhost:5051/api/v1/Node -d "{ \"id\" : \"[host:port]\", \"username\": \"[username]\", \"password\": \"[password]\", \"remarks\":\"[remarks]\" }"

To update parameters for an existing bitcoind instance use:

PUT api/v1/Node/{nodeId}

To update node's password created with curl before use Content-Type: application/json and authorization Api-Key: [RestAdminAPIKey] with the following JSON request body:

{
    "id": "[host:port]",
    "username": "[username]",
    "password": "[newPassword]",
    "remarks": "[remarks]"
}

To remove connection to an existing bitcoind instance use:

DELETE api/v1/Node/{nodeId}

To get a list of parameters for a specific node use:

GET api/v1/Node/{nodeId}

To get a list of parameters for all nodes use:

GET api/v1/Node

NOTE: when returning connection parameters, password is not return for security reasons.

Status check

To check status of ZMQ subscriptions use:

GET api/v1/status/zmq

How callbacks are being processed

For each transaction that is submitted to mAPI it can be set if the submiter should receive a notification of doublespend or merkle proof via callback URL. mAPI processes all requested notifications and sends them out as described below:

  • all notifications are sent out in batches
  • each batch contains a limited number of notifications for single host (configurable with NOTIFICATION_MAX_NOTIFICATIONS_IN_BATCH)
  • response time for each host is tracked and two separate pools of tasks are used for delivering instant notifications: One pool for fast hosts and second pool for slow hosts. (threshold for slow/fast pools can be configured with NOTIFICATION_SLOW_HOST_THRESHOLD_MS)
  • when an event is received from the node an attempt is made to insert notification it into queue for instant delivery
  • if a callback fails or if instant delivery queues are full, the notifications is scheduled for delivery in background.
  • background delivery queue is used for periodically processing failed notifications. Single task is used for background delivery

Build and deploy

Building docker images

Build docker images for MerchantAPI App & Data running this commands in folder /src/Deploy

On Linux: ./build.sh
On Windows: build.bat

Deploying docker images

  1. Create config folder and save SSL server certificate file (<certificate_file_name>.pfx) into to the config folder. This server certificate is required to setup TLS (SSL).

  2. Copy .crt files with with root and intermediate CA certificates that issued SSL server certificates which are used by callback endpoint. Each certificate must be exported as a Base-64 encoded X.509 file with a crt extension type. This step is required if callback endpoint uses SSL server certificate issued by untrusted CA (such as self signed certificate).

  3. Create and copy providers.json file into config folder. Sample provider.json :

    {
      "IdentityProviders": {
        "Providers": [
          {
          "Issuer": "http://mysite.com",
          "Audience": "http://myaudience.com",
          "Algorithm": "HS256",
          "SymmetricSecurityKey": "thisisadevelopmentkey"
          }
        ]
      }
    }
    Parameter Description
    Issuer Token issuer
    Audience Token audience
    Algorithm (optional) Signing algorithm allowed for token (if not set HS256 will be used)
    SymmetricSecurityKey Symmetric security key that token should be signed with
  4. Populate all environment variables in .env file in target folder:

    Parameter Description
    HTTPSPORT port where the application will listen/run
    CERTIFICATEPASSWORD the password of the *.pfx file in the config folder
    CERTIFICATEFILENAME <certificate_file_name.pfx>
    QUOTE_EXPIRY_MINUTES Specify fee quote expiry time
    ZMQ_CONNECTION_TEST_INTERVAL_SEC how often does ZMQ subscription service test that the connection with node is still alive. Default: 60 seconds
    RESTADMIN_APIKEY Authorization key for accessing administration interface
    DELTA_BLOCKHEIGHT_FOR_DOUBLESPENDCHECK Number of old blocks that are checked for double spends
    CLEAN_UP_TX_AFTER_DAYS Number of days transactions and blocks are kept in database. Default: 3 days
    CLEAN_UP_TX_PERIOD_SEC Time period of transactions cleanup check. Default: 1 hour
    WIF_PRIVATEKEY Private key that is used to sign responses with (must be omited if minerid settings are specified, and vice versa)
    NOTIFICATION_NOTIFICATION_INTERVAL_SEC Period when background service will retry to send notifications with error
    NOTIFICATION_INSTANT_NOTIFICATION_TASKS Maximum number of concurrent tasks for sending notifications to callback endpoints (must be between 2-100)
    NOTIFICATION_INSTANT_NOTIFICATIONS_QUEUE_SIZE Maximum number of notifications waiting in instant queue before new notifications will be scheduled for slow background delivery
    NOTIFICATION_MAX_NOTIFICATIONS_IN_BATCH Maximum number of notifications per host being processed by delivery task at once
    NOTIFICATION_SLOW_HOST_THRESHOLD_MS Callback response time threshold that determines which host is deemed slow/fast
    NOTIFICATION_INSTANT_NOTIFICATIONS_SLOW_TASK_PERCENTAGE Percent of notification tasks from NOTIFICATION_INSTANT_NOTIFICATION_TASKS that will be reserved for slow hosts
    NOTIFICATION_NO_OF_SAVED_EXECUTION_TIMES Maximum number of callback response times saved for each host. Used for calculating average response time for a host
    NOTIFICATION_NOTIFICATIONS_RETRY_COUNT Number of retries for failed notifications, before quiting with retries
    NOTIFICATION_SLOW_HOST_RESPONSE_TIMEOUT_MS Callback response timeout for slow host
    NOTIFICATION_FAST_HOST_RESPONSE_TIMEOUT_MS Callback response timeout for fast host
    MINERID_SERVER_URL URL pointing to MinerID REST endpoint
    MINERID_SERVER_ALIAS Alias be used when communicating with the endpoint
    MINERID_SERVER_AUTHENTICATION HTTP authentication header that be used to when communicating with the endpoint
  5. Run this command in target folder to start mAPI application:

    docker-compose up -d

The docker images are automatically pulled from Docker Hub. Database updates are triggered upon application start or when tests are run.

Setting up a development environment

For development, you will need the following

  1. .NET core SDK 3.1 installed in your environnement.
  2. and instance of PostgreSQL database. You can download it from here or use a Docker image.
  3. access to instance of running BSV node with RPC interface and ZMQ notifications enabled

Perform the following set up steps:

  1. Update DBConnectionString(connection string used by mAPI) and DBConnectionStringMaster (same as DBConnectionString, but with user that has admin privileges - is used to upgrade database) setting in src/MerchantAPI/APIGateway/APIGateway.Rest/appsettings.Development.json and src/MerchantAPI/APIGateway/APIGateway.Test.Functional/appsettings.Development.json so that they point to your PostgreSQL server
  2. Update BitcoindFullPath in src/MerchantAPI/APIGateway/APIGateway.Test.Functional/appsettings.Development.json so that it points to bitcoind executable used during functional tests
  3. Run scripts from src/crea/merchantapi2/src/MerchantAPI/APIGateway.Database/APIGateway/Database/scripts to create database.

Run

cd src/MerchantAPI/APIGateway/APIGateway.Rest
dotnet run

Test

Run individual tests or run all tests with:

cd src/MerchantAPI/APIGateway/APIGateway.Test.Functional/
dotnet test

Configuration

Following table lists all configuration settings with mappings to environment variables. For description of each setting see Populate all environment variables under Deploying docker images

Application Setting Environment variable
QuoteExpiryMinutes QUOTE_EXPIRY_MINUTES
RestAdminAPIKey RESTADMIN_APIKEY
DeltaBlockHeightForDoubleSpendCheck DELTA_BLOCKHEIGHT_FOR_DOUBLESPENDCHECK
CleanUpTxAfterDays CLEAN_UP_TX_AFTER_DAYS
CleanUpTxPeriodSec CLEAN_UP_TX_PERIOD_SEC
WifPrivateKey WIF_PRIVATEKEY
ZmqConnectionTestIntervalSec ZMQ_CONNECTION_TEST_INTERVAL_SEC
Notification region
NotificationIntervalSec NOTIFICATION_NOTIFICATION_INTERVAL_SEC
InstantNotificationsTasks NOTIFICATION_INSTANT_NOTIFICATION_TASKS
InstantNotificationsQueueSize NOTIFICATION_INSTANT_NOTIFICATIONS_QUEUE_SIZE
MaxNotificationsInBatch NOTIFICATION_MAX_NOTIFICATIONS_IN_BATCH
SlowHostThresholdInMs NOTIFICATION_SLOW_HOST_THRESHOLD_MS
InstantNotificationsSlowTaskPercentage NOTIFICATION_INSTANT_NOTIFICATIONS_SLOW_TASK_PERCENTAGE
NoOfSavedExecutionTimes NOTIFICATION_NO_OF_SAVED_EXECUTION_TIMES
NotificationsRetryCount NOTIFICATION_NOTIFICATIONS_RETRY_COUNT
SlowHostResponseTimeoutMS NOTIFICATION_SLOW_HOST_RESPONSE_TIMEOUT_MS
FastHostResponseTimeoutMS NOTIFICATION_FAST_HOST_RESPONSE_TIMEOUT_MS
MinerIdServer region
Url MINERID_SERVER_URL
Alias MINERID_SERVER_ALIAS
Authentication MINERID_SERVER_AUTHENTICATION

Following table lists additional configuration settings:

Setting Description
ConnectionStrings region
DBConnectionString connection string for access to PostgreSQL database
DBConnectionStringMaster is same as DBConnectionString, but with user that has admin privileges
Comments
  • Bump Microsoft.AspNetCore.Authentication.JwtBearer from 3.1.7 to 3.1.18 in /src/MerchantAPI/APIGateway/APIGateway.Rest

    Bump Microsoft.AspNetCore.Authentication.JwtBearer from 3.1.7 to 3.1.18 in /src/MerchantAPI/APIGateway/APIGateway.Rest

    Bumps Microsoft.AspNetCore.Authentication.JwtBearer from 3.1.7 to 3.1.18.

    Release notes

    Sourced from Microsoft.AspNetCore.Authentication.JwtBearer's releases.

    .NET Core 3.1.18

    Release

    .NET Core 3.1.17

    Release

    .NET Core 3.1.16

    Release

    .NET Core 3.1.15

    Release

    .NET Core 3.1.14

    Release

    .NET Core 3.1.13

    Release

    .NET Core 3.1.12

    Repos

    .NET Core 3.1.11

    Repos

    .NET Core 3.1.10

    Repos

    .NET Core 3.1.8

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump Microsoft.AspNetCore.Authentication.JwtBearer from 3.1.7 to 3.1.18 in /src/MerchantAPI/TokenManager

    Bump Microsoft.AspNetCore.Authentication.JwtBearer from 3.1.7 to 3.1.18 in /src/MerchantAPI/TokenManager

    Bumps Microsoft.AspNetCore.Authentication.JwtBearer from 3.1.7 to 3.1.18.

    Release notes

    Sourced from Microsoft.AspNetCore.Authentication.JwtBearer's releases.

    .NET Core 3.1.18

    Release

    .NET Core 3.1.17

    Release

    .NET Core 3.1.16

    Release

    .NET Core 3.1.15

    Release

    .NET Core 3.1.14

    Release

    .NET Core 3.1.13

    Release

    .NET Core 3.1.12

    Repos

    .NET Core 3.1.11

    Repos

    .NET Core 3.1.10

    Repos

    .NET Core 3.1.8

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • issue-4: Remove double quotes from txid response

    issue-4: Remove double quotes from txid response

    https://github.com/bitcoin-sv/merchantapi-reference/issues/4

    Changes:

    • Remove not needed double quote around the txid response from SubmitTransaction
    opened by attilaaf 1
  • SubmitTransaction returns embedded double quoted txid.

    SubmitTransaction returns embedded double quoted txid.

    Problem:

    SubmitTransaction returns embedded double quoted txid. The spec excludes the double quotes. https://github.com/bitcoin-sv-specs/brfc-merchantapi#returns-1

    Sample response on successful POST /mapi/tx

    {
        "payload": "{\"apiVersion\":\"0.1.0\",\"timestamp\":\"2020-06-10T06:00:22.176Z\",\"txid\":\"\\\"3135d9b89f0295a26f726abac282111b8686f1fbd5093c9e40fe96c4cfe05faf\\\"\",\"returnResult\":\"success\",\"resultDescription\":\"\",\"minerId\":null,\"currentHighestBlockHash\":\"000000000000000002fc98b91a5adcbda91b37abf68ec2be4d1caddae2e621ab\",\"currentHighestBlockHeight\":638720,\"txSecondMempoolExpiry\":0}",
        "signature": null,
        "publicKey": null,
        "encoding": "UTF-8",
        "mimetype": "application/json"
    }
    

    Notice the nested double quotes around the txid value

    Expected result:

    txid contains a transaction id without the unnecessary double quotes.

    \"txid\":\"3135d9b89f0295a26f726abac282111b8686f1fbd5093c9e40fe96c4cfe05faf\"

    Actual Result:

    txid contains a transaction id with unnecessary double quotes.

    \"txid\":\"\\\"3135d9b89f0295a26f726abac282111b8686f1fbd5093c9e40fe96c4cfe05faf\\\"\"

    {
        "payload": "{\"apiVersion\":\"0.1.0\",\"timestamp\":\"2020-06-10T06:00:22.176Z\",\"txid\":\"\\\"3135d9b89f0295a26f726abac282111b8686f1fbd5093c9e40fe96c4cfe05faf\\\"\",\"returnResult\":\"success\",\"resultDescription\":\"\",\"minerId\":null,\"currentHighestBlockHash\":\"000000000000000002fc98b91a5adcbda91b37abf68ec2be4d1caddae2e621ab\",\"currentHighestBlockHeight\":638720,\"txSecondMempoolExpiry\":0}",
        "signature": null,
        "publicKey": null,
        "encoding": "UTF-8",
        "mimetype": "application/json"
    }
    
    opened by attilaaf 1
  • WARNING: DATA RACE when trying to 3 use 3 bitcoin nodes

    WARNING: DATA RACE when trying to 3 use 3 bitcoin nodes

    Problem:

    WARNING: DATA RACE when trying to 3 use 3 bitcoin nodes.

    Expected result:

    No DATA RACE and the user is able to submit their transaction without error.

    Actual Result:

    Unable to submit sample transaction without the result giving a failure and a "Mixed results" string.

    POST /mapi/tx

    Content-type: application/json Request body:

     {
      "rawTx": "0100000001df7ffab6c59dfc18764c42ffdc771124781267cc706377431d050040a88d4125030000006a473044022017c3c38d7be9b190f792714de48b0f852b6bcde4df1dc603bff94b02f32a8deb02200517d8342b8752bff0ea6130924dc2602ae18f6c0526f731da5d3e6a2b02dcaa412102119ebe4639964590bcf358539740f8ea4b6546b8416cbbbf6de12fafd3a13d1affffffff01000000000000000014006a026d020e706f737420746f206d656d6f212000000000"
    } 
    

    Config file:

    $ cat settings.conf
    # The server can listen on http or https or both.
    # Depending on these settings, the server
    # will bind to a specific interface or all interfaces
    #   httpAddress=:9004
    #   httpsAddress=192.168.1.2:8334
    
    # For https connections, you can also provide certificates
    #   certFile=./fullchain.pem
    #   keyFile=./privkey.pem
    httpAddress=:8065
    httpsAddress= # Don't start https
    
    # The JWT key is used for all tokens.  To revoke all tokens, change this key.
    # To generate a new jwtKey, run the following script:
    #   node -e "console.log(require('crypto').randomBytes(32).toString('hex'));"
    jwtKey=
    
    # GetFeeQuote returns a feeQuote with an expiry time, this value will
    # set the value of that expiry time (in minutes)
    quoteExpiryMinutes=10
    
    bitcoin_count=3
    bitcoin_1_host=localhost
    bitcoin_1_port=8332
    bitcoin_1_username=secretuser
    bitcoin_1_password=password
    bitcoin_2_host=hostname2
    bitcoin_2_port=8332
    bitcoin_2_username=secretuser
    bitcoin_2_password=password
    bitcoin_3_host=hostname3
    bitcoin_3_port=8332
    bitcoin_3_username=secretuser
    bitcoin_3_password=password
    

    Logs:

    May 30 01:35:40 ip-172-31-26-17 go[1344]: 2020/05/30 01:35:40 INFO: HTTP server listening on :8065
    May 30 01:35:58 ip-172-31-26-17 go[1344]: ==================
    May 30 01:35:58 ip-172-31-26-17 go[1344]: WARNING: DATA RACE
    May 30 01:35:58 ip-172-31-26-17 go[1344]: Read at 0x00c0002f47e0 by goroutine 37:
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/multiplexer.(*MPWrapper).Invoke.func1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/multiplexer/mp.go:82 +0x301
    May 30 01:35:58 ip-172-31-26-17 go[1344]: Previous write at 0x00c0002f47e0 by goroutine 36:
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/multiplexer.(*MPWrapper).Invoke.func1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/multiplexer/mp.go:83 +0x24f
    May 30 01:35:58 ip-172-31-26-17 go[1344]: Goroutine 37 (running) created at:
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/multiplexer.(*MPWrapper).Invoke()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/multiplexer/mp.go:62 +0x1c6
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/handler.SubmitTransaction()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/handler/SubmitTransaction.go:77 +0x6e5
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x4ca
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/handler.AuthMiddleware.func1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/handler/AuthMiddleware.go:19 +0x497
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x51
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   github.com/gorilla/mux.CORSMethodMiddleware.func1.1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /root/go/pkg/mod/github.com/gorilla/[email protected]/middleware.go:51 +0x13f
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x51
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   github.com/gorilla/mux.(*Router).ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /root/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:212 +0x13e
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.serverHandler.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2807 +0xce
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.(*conn).serve()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:1895 +0x837
    May 30 01:35:58 ip-172-31-26-17 go[1344]: Goroutine 36 (finished) created at:
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/multiplexer.(*MPWrapper).Invoke()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/multiplexer/mp.go:62 +0x1c6
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/handler.SubmitTransaction()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/handler/SubmitTransaction.go:77 +0x6e5
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x4ca
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/handler.AuthMiddleware.func1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/handler/AuthMiddleware.go:19 +0x497
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x51
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   github.com/gorilla/mux.CORSMethodMiddleware.func1.1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /root/go/pkg/mod/github.com/gorilla/[email protected]/middleware.go:51 +0x13f
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x51
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   github.com/gorilla/mux.(*Router).ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /root/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:212 +0x13e
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.serverHandler.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2807 +0xce
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.(*conn).serve()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:1895 +0x837
    May 30 01:35:58 ip-172-31-26-17 go[1344]: ==================
    May 30 01:35:58 ip-172-31-26-17 go[1344]: WARNING: DATA RACE
    May 30 01:35:58 ip-172-31-26-17 go[1344]: Read at 0x00c0002f4a20 by goroutine 37:
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/multiplexer.contains()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/multiplexer/mp.go:38 +0x67
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/multiplexer.(*MPWrapper).Invoke.func1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/multiplexer/mp.go:82 +0x34b
    May 30 01:35:58 ip-172-31-26-17 go[1344]: Previous write at 0x00c0002f4a20 by goroutine 36:
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/multiplexer.(*MPWrapper).Invoke.func1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/multiplexer/mp.go:83 +0x202
    May 30 01:35:58 ip-172-31-26-17 go[1344]: Goroutine 37 (running) created at:
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/multiplexer.(*MPWrapper).Invoke()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/multiplexer/mp.go:62 +0x1c6
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/handler.SubmitTransaction()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/handler/SubmitTransaction.go:77 +0x6e5
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x4ca
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/handler.AuthMiddleware.func1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/handler/AuthMiddleware.go:19 +0x497
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x51
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   github.com/gorilla/mux.CORSMethodMiddleware.func1.1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /root/go/pkg/mod/github.com/gorilla/[email protected]/middleware.go:51 +0x13f
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x51
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   github.com/gorilla/mux.(*Router).ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /root/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:212 +0x13e
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.serverHandler.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2807 +0xce
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.(*conn).serve()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:1895 +0x837
    May 30 01:35:58 ip-172-31-26-17 go[1344]: Goroutine 36 (finished) created at:
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/multiplexer.(*MPWrapper).Invoke()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/multiplexer/mp.go:62 +0x1c6
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/handler.SubmitTransaction()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/handler/SubmitTransaction.go:77 +0x6e5
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x4ca
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/handler.AuthMiddleware.func1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/handler/AuthMiddleware.go:19 +0x497
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x51
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   github.com/gorilla/mux.CORSMethodMiddleware.func1.1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /root/go/pkg/mod/github.com/gorilla/[email protected]/middleware.go:51 +0x13f
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x51
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   github.com/gorilla/mux.(*Router).ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /root/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:212 +0x13e
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.serverHandler.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2807 +0xce
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.(*conn).serve()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:1895 +0x837
    May 30 01:35:58 ip-172-31-26-17 go[1344]: ==================
    May 30 01:35:58 ip-172-31-26-17 go[1344]: WARNING: DATA RACE
    May 30 01:35:58 ip-172-31-26-17 go[1344]: Read at 0x00c0002f4a20 by goroutine 35:
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/multiplexer.contains()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/multiplexer/mp.go:38 +0x67
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/multiplexer.(*MPWrapper).Invoke.func1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/multiplexer/mp.go:82 +0x34b
    May 30 01:35:58 ip-172-31-26-17 go[1344]: Previous write at 0x00c0002f4a20 by goroutine 36:
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/multiplexer.(*MPWrapper).Invoke.func1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/multiplexer/mp.go:83 +0x202
    May 30 01:35:58 ip-172-31-26-17 go[1344]: Goroutine 35 (running) created at:
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/multiplexer.(*MPWrapper).Invoke()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/multiplexer/mp.go:62 +0x1c6
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/handler.SubmitTransaction()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/handler/SubmitTransaction.go:77 +0x6e5
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x4ca
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/handler.AuthMiddleware.func1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/handler/AuthMiddleware.go:19 +0x497
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x51
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   github.com/gorilla/mux.CORSMethodMiddleware.func1.1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /root/go/pkg/mod/github.com/gorilla/[email protected]/middleware.go:51 +0x13f
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x51
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   github.com/gorilla/mux.(*Router).ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /root/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:212 +0x13e
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.serverHandler.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2807 +0xce
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.(*conn).serve()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:1895 +0x837
    May 30 01:35:58 ip-172-31-26-17 go[1344]: Goroutine 36 (finished) created at:
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/multiplexer.(*MPWrapper).Invoke()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/multiplexer/mp.go:62 +0x1c6
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/handler.SubmitTransaction()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/handler/SubmitTransaction.go:77 +0x6e5
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x4ca
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   merchant_api/handler.AuthMiddleware.func1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /home/ubuntu/merchantapi/handler/AuthMiddleware.go:19 +0x497
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x51
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   github.com/gorilla/mux.CORSMethodMiddleware.func1.1()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /root/go/pkg/mod/github.com/gorilla/[email protected]/middleware.go:51 +0x13f
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.HandlerFunc.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2012 +0x51
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   github.com/gorilla/mux.(*Router).ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /root/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:212 +0x13e
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.serverHandler.ServeHTTP()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:2807 +0xce
    May 30 01:35:58 ip-172-31-26-17 go[1344]:   net/http.(*conn).serve()
    May 30 01:35:58 ip-172-31-26-17 go[1344]:       /usr/lib/go-1.14/src/net/http/server.go:1895 +0x837
    May 30 01:35:58 ip-172-31-26-17 go[1344]: ==================
    May 30 01:35:58 ip-172-31-26-17 go[1344]: 2020/05/30 01:35:58 ERROR http://localhost:8332: Transaction already in the mempool
    
    opened by attilaaf 0
  • Added Access-Control-Allow-Headers CORS header

    Added Access-Control-Allow-Headers CORS header

    When accessing this REST API from within a browser, we will receive a pre-flight CORS request and we must return an "Access-Control-Allow-Headers" header.

    opened by ordishs 0
  • Bump Newtonsoft.Json from 13.0.1 to 13.0.2 in /src/MerchantAPI/APIGateway/APIGateway.Infrastructure

    Bump Newtonsoft.Json from 13.0.1 to 13.0.2 in /src/MerchantAPI/APIGateway/APIGateway.Infrastructure

    Bumps Newtonsoft.Json from 13.0.1 to 13.0.2.

    Release notes

    Sourced from Newtonsoft.Json's releases.

    13.0.2

    • New feature - Add support for DateOnly and TimeOnly
    • New feature - Add UnixDateTimeConverter.AllowPreEpoch property
    • New feature - Add copy constructor to JsonSerializerSettings
    • New feature - Add JsonCloneSettings with property to disable copying annotations
    • Change - Add nullable annotation to JToken.ToObject(Type, JsonSerializer)
    • Change - Reduced allocations by reusing boxed values
    • Fix - Fixed MaxDepth when used with ToObject inside of a JsonConverter
    • Fix - Fixed deserializing mismatched JToken types in properties
    • Fix - Fixed merging enumerable content and validate content
    • Fix - Fixed using $type with arrays of more than two dimensions
    • Fix - Fixed rare race condition in name table when deserializing on device with ARM processors
    • Fix - Fixed deserializing via constructor with ignored base type properties
    • Fix - Fixed MaxDepth not being used with ISerializable deserialization
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Best place for dialogue

    Best place for dialogue

    Hi

    I suggested an addition to the mAPI spec in https://github.com/bitcoin-sv-specs/brfc-merchantapi/issues/8 but have not heard anything. It is the correct place to give feedback? Is bitcoin-sv/merchantapi-reference better to handle discussions? Is there an email list for mAPI?

    opened by mathiasrw 0
  • Make `POST /mapi/tx` idempotent (and return the SPV proof if tx is already known/confirmed)

    Make `POST /mapi/tx` idempotent (and return the SPV proof if tx is already known/confirmed)

    App developers have problems with re-broadcasting and have to attach extra logic to handle the case of a new transaction versus the same (but already confirmed) transaction.

    A way to fix this problem is to provide a unified idempotent endpoint that does the following in 1 api call:

    1. If it's a new transaction (unconfirmed), then accept and return the same data as now; and
    2. If it's a transaction that was settled (confirmed) from before, then still return a returnResult: success and instead also include the SPV proof and transaction details.

    This is basically combining the POST /mapi/tx and GET /mapi/tx/:txid endpoints into one. This will lead to a more reliable experience for developers and reduce integration difficulty.

    opened by attilaaf 1
  • Request: Add `txid` for all responses in the merchant api payload, even those requests which were unsuccessful.

    Request: Add `txid` for all responses in the merchant api payload, even those requests which were unsuccessful.

    In particular for POST /mapi/tx please can we have txid in the response as well? It will be a lot easier to audit and log to have this data in the payload even in the case of non success cases.

    Example:

    {"payload":"{"apiVersion":"0.1.0","timestamp":"2021-01-13T05:43:26.390Z","txid":"","returnResult":"failure","resultDescription":"ERROR: 257: txn-already-known","minerId":"0211ccfc29e3058b770f3cf3eb34b0b2fd2293057a994d4d275121be4151cdf087","currentHighestBlockHash":"00000000000002e3479d1d15e72a90a5109656d3bae06d4fbd5ab45e6de405c3","currentHighestBlockHeight":1404493,"txSecondMempoolExpiry":0}","signature":"3045022100bdf965099c8f964b79f6f1f962ad7de4dbdbb38d6475fc05abfa777f67b4d3f30220520d2a3b1957f60bb319930cebc83ce54f739ca5097e574c20a34caa776b9777","publicKey":"0211ccfc29e3058b770f3cf3eb34b0b2fd2293057a994d4d275121be4151cdf087","encoding":"UTF-8","mimetype":"application/json"},"status":"Accepted"},"level":"debug","timestamp":"2021-01-13 05:43:26"}

    ^^ Notice how txid is empty

    Thanks in advance!

    opened by attilaaf 2
Releases(v1.5.0)
  • v1.5.0(Dec 6, 2022)

    mAPI v1.5.0 Specification and Reference Implementation is now available.

    mAPI v1.5.0 is a recommended upgrade from mAPI v1.4.0.

    Dependency mAPI v1.5.0 not using DSNT, or using IPv4 for DSNT requires BSV Node v1.0.10.

    mAPI v1.5.0 using IPv6 for DSNT requires BSV Node v1.0.13.

    mAPI Specification Specification: https://github.com/bitcoin-sv-specs/brfc-merchantapi

    Features mAPI v1.5.0 has an extensive list of changes from previous versions.

    Improved Resilience This release of the mAPI specification and reference implementation improves resilience against adversities.

    If mAPI accepts transactions which are subsequently lost from node's Mempool (for whatever reason), mAPI automatically resubmits the transactions.

    Standardised Errors If the mAPI user gets a HTTP code 4xx response to submit transaction, they should attempt to fix the user error before resubmitting the transaction.

    If the mAPI user gets a HTTP code 5xx response to submit transaction, they can resubmit the transaction after waiting for the issue at the server end to become resolved.

    In addition, a new field 'FailureRetryable' in the submit transaction response indicates whether the user is able to resubmit the transaction, which relives the user from having to parse the detailed submission response. This field is particularly useful when submitting multiple transactions as response results may be mixed.

    If the user resubmits a transaction with the same parameters, which has already been responded to, and is within the CLEAN_UP_TX_AFTER_DAYS and CLEAN_UP_TX_AFTER_MEMPOOL_EXPIRED_DAYS configuration settings, mAPI will return the original response again (idempotence).

    If the mAPI user submits a transaction which is already on the blockchain but unknown to mAPI, mAPI will trigger a callback if specified.

    If mAPI is configured to communicate with multiple nodes, any mixed results are mapped to the best result for the user.

    Additional Operations If mAPI identifies missing inputs in a transaction which it has stored, mAPI may be configured to resubmit the missing input transactions before the new transaction with the intention of reducing unsuccessful submissions.

    Query transactions optionally returns the Merkle proof for a transaction.

    A new endpoint, query transaction outputs is provided to obtain information about transaction outputs.

    Additional validation is performed on transactions submitted which specify DSNT outputs.

    DSNT outputs may specify the use of IPv6 for communication.

    For further details about DSNT, please refer to https://github.com/bitcoin-sv-specs/protocol/blob/master/updates/double-spend-notifications.md

    mAPI Reference Implementation Binaries and source code with config files: https://github.com/bitcoin-sv/merchantapi-reference

    Binaries: https://hub.docker.com/r/bitcoinsv/mapi

    Additional Operations mAPI administrators may control the list of unconfirmed transactions maintained for authenticated users, with new endpoints.

    mAPI administrators may see the state of submitted transactions, Node's ZMQ and mAPI's block parser.

    mAPI administrators may monitor mAPIs operation using Prometheus and Grafana.

    Extended Configuration There are more configurable timeouts and options in this version.

    In this version, the default behaviour has been changed from logging transactions to not doing so.

    This can be managed using the LOG_LEVEL_DEFAULT configuration option.

    Bug Fixes Several features have been added and bugs have been fixed.

    Features and Bugs

    • Additional validation of transactions using DSNT
    • Aggregate different error messages from multiple nodes
    • Add block parser status endpoint
    • Resubmitting same transaction gets same response
    • Improve Resilience
    • Callback IP addresses support IPv6
    • Improve logging info
    • Emit Grafana output
    • Standardize errors
    • Resubmit a transaction's missing inputs
    • Performance resilience changes
    • Add Merkle proof to query transaction response
    • Emit warning for incompatible bitcoind configuration settings
    • Return HTTP 500 if node is unavailable
    • Make REST responses consistent
    • Add gettxouts endpoint
    • Manage idempotent transactions
    • Add failureRetryable to transaction responses
    Source code(tar.gz)
    Source code(zip)
    default.env(2.00 KB)
    docker-compose.yml(6.65 KB)
    README.md(42.09 KB)
    sample.env(2.20 KB)
  • v1.4.0(Nov 25, 2021)

    mAPI v1.4.0 is a recommended upgrade from mAPI v1.3.0.

    Dependency mAPI v1.4.0 requires BSV Node v1.0.10 or newer.

    mAPI Specification Specification: https://github.com/bitcoin-sv-specs/brfc-merchantapi

    Features Miner Policy Quotes This release of mAPI specification introduces support for obtaining policy quotes from miners.

    These are a superset of the mAPI v1.3.0 fee quotes, which are maintained for backward compatibility.

    Policies are configured by the mAPI Administrator for each account and include Node options to skip some policy checks when transactions are submitted, such as:

    "maxtxsizepolicy": 999999, "datacarriersize": 100000, "maxscriptsizepolicy": 100000, "maxscriptnumlengthpolicy": 100000, "maxstackmemoryusagepolicy": 100000, "limitancestorcount": 100000, "limitcpfpgroupmemberscount": 10, "acceptnonstdoutputs": true, "datacarrier": true, "maxstdtxvalidationduration": 99, "maxnonstdtxvalidationduration": 100, "dustrelayfee": 150, "dustlimitfactor": 10, "skipscriptflags": ["CLEANSTACK", "DERSIG"]

    Note: BSV Node v1.0.11 onwards does not support "dustrelayfee" and "dustlimitfactor" policies and they must not be set. Doing so will cause an error when the user submits a transaction.

    Double-spend Processing In addition to mAPI using ZMQ subscriptions for local node double-spend detection, any remote node in the BSV network that detects a double spend of a transaction which contains a DSNT output (a double spend notification record), will notify the specified DSNT servers (such as mAPI) about the detected double spend through a HTTP callback and handshake.

    Please refer to https://github.com/bitcoin-sv-specs/protocol/blob/master/updates/double-spend-notifications.md for further details.

    mAPI Reference Implementation Binaries and source code: https://github.com/bitcoin-sv/merchantapi-reference

    Features

    • Supports policyQuote as well as feeQuote
    • Provides DSNT information for transaction builder
    • Administrator may configure accounts to specify Node options to skip some policy checks when transactions are submitted
    • Made ready for blocks greater than 4 GB
    • Performance Optimization
    Source code(tar.gz)
    Source code(zip)
    default.env(1.01 KB)
    docker-compose.yml(3.84 KB)
    README.md(26.84 KB)
    sample.env(1.10 KB)
  • v1.3.0(May 24, 2021)

    mAPI software – Upgrade to v1.3.0 Release

    Version 1.3.0 release is a recommended upgrade from version 1.3.0 beta release; With this release of mAPI we are introducing support for receiving double spend notifications from remote nodes.

    In addition to local nodes, that are connected directly to mAPI through ZMQ subscription, any remote node in the BSV network that detects a double spend of a transaction, that contains a double spend notification address, can now notify mAPI about detected double spend through HTTP callback. Please refer to https://github.com/bitcoin-sv-specs/protocol for further details.

    Double spend notifications have also been improved with detection of double spends on unconfirmed parents. mAPI will notify merchants should it detect double spends, not only for their transaction, but also if the double spend is detected on one of its unconfirmed parents.

    Merkle proof notifications can now use standard TSC format which returns hex encoded block header in callback notifications.

    Additional improvements include, support for callback reason parameters in callback URLs, support for custom database server deployment and additional configuration options for better integration.

    Content details listed below:

    Double spend notification for unconfirmed parents.

    • Support for callback endpoint for double spend notifications from a remote node.
    • Add support for TSC merkle proof format.
    • Enable support for callback reason parameter in callback URL.
    • Support custom database server deployment.
    • Configuration option to disable fee check.
    • Option to supply ZMQ endpoint when registering node with mAPI.
    • Option to run mAPI over HTTP for development purposes.

    Binaries and source code can be downloaded here: https://github.com/bitcoin-sv/merchantapi-reference

    Source code(tar.gz)
    Source code(zip)
  • v1.3.0-beta(May 18, 2021)

    Policy Quote API endpoints - allowing miners to specify more than just fee quotes, including fee rates, ancestor limits and other node level default settings

    Service Level Agreements

    Double Spend notifications (including for unconfirmed parents)

    Alignment with the new Technical Standards Committee (TSC) Merkle proof standards

    Resilience and re-submit scenarios

    Categorization of Errors

    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Nov 17, 2020)

    mAPI v1.2.0 Release ​ This release of mAPI (formerly called Merchant API) introduces a number of changes to further enhance miner services to network users. In particular, we confirm mAPI's capabilities to improve SIT ( Safe Instant Transactions ) by identifying double spend scenarios and introducing callback notification features. ​ On transaction submission, the merchant or intermediary can optionally request merkle proofs to be delivered through a designated callback channel. mAPI 1.2.0 implements the first use case for the newly released CE (Community Edition) of SPV Channels, offering end-to-end encryption of messages to connected or partially connected clients. ​ In addition, the v1.2.0 upgrade includes improvements on administering node connections, fee quotes and quote authorisation through a revamped token issuer. The new feature of an API gateway, with REST Admin Interface, provides the additional usability, security and robustness required to administer a fully functional mAPI service. ​ Content details listed below:

    • Add new parameters on submit transaction for:
    • Notifications of double spends
    • Requesting merkle proof callback
    • Callback URL
    • Message encryption parameter
    • Application of SPV Channels for secure and reliable message exchange on callbacks
    • API gateway implementation for processing of submit transaction, query transaction status and fee quotes
    • API gateway REST Admin Interface
    • Revamped token issuer functionality
    • Revamped Create Fee Quote functionality
    • Revamped node connections configuration ​ To download mAPI version 1.2.0 click here ​ Should you have any support questions, please direct them via [email protected] ​ Thank you for your continued support of Bitcoin SV. ​ Sent on behalf of Steve Shadders and the Bitcoin SV Infrastructure Team.
    Source code(tar.gz)
    Source code(zip)
    default.env(737 bytes)
    docker-compose.yml(2.87 KB)
    README.md(25.42 KB)
  • v1.1.0(Sep 16, 2020)

    Changelog

    ed3d356 Merge pull request #8 from jadwahab/master (v1.1.0) f8bce01 update readme 801b36d Merge branch 'master' of github.com:bitcoin-sv/merchantapi-reference faa6b83 add goreleaser 31c6890 [swagger] move to swagger/ dir ad62482 [multi tx submit] change format to obj with rawtx 6b63bc5 [multi tx submit] change endpoint 1d81fda Revert "[add] multi tx status" 30344ed fix tx length calc 52239fa [docker] add version and commit to build bin 9a760bd addd previous input validation f55b79d upgrade deps 4e70456 [apiVersion] injected at build 16fed19 Merge branch 'master' of github.com:bitcoin-sv/merchantapi-reference 04eaadf [add] blockchaintracker package [settings] added bitcoin zmqport [refactor] move server out of main.go [blockchaintracker] now used in getfeequote, submittx, multisubmittx 01776dc [refactor] blockinfo separately 24e2856 [update] build script [add] version and commit tag in main b5cfda7 [add] multi tx status 7524a39 [add] multi tx submit efe1928 [refactor] libsv for cryptolib 9d2795e [fix] result description message bdc4fd4 [add] return txid in query tx status ad73f07 [add] v1.1 types/structs [add] comments to exported types 7e7b2da [add] v1.1 api call def to readme a7936f8 [add] jwt token config instructions

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(486 bytes)
    mapi_1.1.0_Darwin_x86_64.tar.gz(3.64 MB)
    mapi_1.1.0_Linux_i386.tar.gz(3.41 MB)
    mapi_1.1.0_Linux_x86_64.tar.gz(3.49 MB)
    mapi_1.1.0_Windows_i386.tar.gz(3.35 MB)
    mapi_1.1.0_Windows_x86_64.tar.gz(3.44 MB)
Owner
Bitcoin SV
Bitcoin SV
Kava - Reference implementation of Kava, a blockchain for cross-chain DeFi. Built using the cosmos-sdk

DeFi for Crypto. Telegram | Medium | Discord Reference implementation of Kava, a

null 0 Apr 4, 2022
Go language implementation of a blockchain based on the BDLS BFT protocol. The implementation was adapted from Ethereum and Sperax implementation

BDLS protocol based PoS Blockchain Most functionalities of this client is similar to the Ethereum golang implementation. If you do not find your quest

Yongge Wang 1 Oct 14, 2022
Go-block-api - Golang implementation of Ethereum Block API

Go Ethereum Block API Golang implementation of Ethereum Block API This API can s

zgur.ETH 1 Jan 13, 2022
Pure Go implementation of the NaCL set of API's

go-nacl This is a pure Go implementation of the API's available in NaCL: https://nacl.cr.yp.to. Compared with the implementation in golang.org/x/crypt

Kevin Burke 531 Dec 16, 2022
XDC.Network Rosetta API Implementation

Rosetta XDC.Network ROSETTA XDC.Network IS CONSIDERED ALPHA SOFTWARE. USE AT YOUR OWN RISK! COINBASE ASSUMES NO RESPONSIBILITY OR LIABILITY IF THERE I

null 3 Nov 28, 2022
Go implementation of BLAKE2 (b) cryptographic hash function (optimized for 64-bit platforms).

Go implementation of BLAKE2b collision-resistant cryptographic hash function created by Jean-Philippe Aumasson, Samuel Neves, Zooko Wilcox-O'Hearn, an

Dmitry Chestnykh 90 Jul 11, 2022
An implementation of JOSE standards (JWE, JWS, JWT) in Go

Go JOSE Package jose aims to provide an implementation of the Javascript Object Signing and Encryption set of standards. This includes support for JSO

Square 2k Jan 8, 2023
Go implementation of SipHash-2-4, a fast short-input PRF created by Jean-Philippe Aumasson and Daniel J. Bernstein.

SipHash (Go) Go implementation of SipHash-2-4, a fast short-input PRF created by Jean-Philippe Aumasson and Daniel J. Bernstein (http://131002.net/sip

Dmitry Chestnykh 248 Dec 25, 2022
A simplified blockchain implementation in Golang

A simplified blockchain implementation in Golang

Ivan Kuznetsov 3.7k Dec 31, 2022
A full node Bitcoin (BSV) implementation written in Go

bsvd bsvd is a full node Bitcoin (BSV) implementation written in Go (golang). This project is a port of the bchd codebase to Bitcoin (BSV). It provide

null 42 Dec 25, 2022
`age-plugin-yubikey` implementation, encrypt things with a Yubikey/any PIV card

This is an age plugin for PIV cards/Yubikey. Your secret is kept safe on the tamperproof hardware, while letting you use the age command-line.

Tv 22 Aug 10, 2022
Interblockchain communication protocol (IBC) implementation in Golang.

ibc-go Interblockchain communication protocol (IBC) implementation in Golang built as a SDK module. Components Core The core/ directory contains the S

COSMOS 310 Jan 7, 2023
Implementation of the Filecoin protocol, written in Go

Project Lotus - 莲 Lotus is an implementation of the Filecoin Distributed Storage Network. For more details about Filecoin, check out the Filecoin Spec

Filecoin 2.5k Jan 9, 2023
Go implementation of Ethereum proof of stake

Prysm: An Ethereum Consensus Implementation Written in Go This is the core repository for Prysm, a Golang implementation of the Ethereum Consensus spe

Prysmatic Labs 2.9k Jan 1, 2023
Go implementation of the Data At Rest Encryption (DARE) format.

Secure IO Go implementation of the Data At Rest Encryption (DARE) format. Introduction It is a common problem to store data securely - especially on u

Object Storage for the Era of the Hybrid Cloud 309 Dec 18, 2022
Celer cBridge relay node implementation in Golang

cBridge Relay Node Official implementation of cBridge relay node in Golang. Prerequisites Prepare Machine To run a cBridge relay node, it is recommend

Celer Network 62 Sep 27, 2022
A simple implementation of SHA-256 Algorith in Go Language

SHA-256 in Go This is not a serious/efficient implementation of SHA-256 in Go. You can use the official package for that. This is just for learning pu

Krona Emmanuel 6 Sep 22, 2022
Go Implementation of the Spacemesh protocol full node. 💾⏰💪

A Programmable Cryptocurrency go-spacemesh ?? ⏰ ?? Thanks for your interest in this open source project. This repo is the go implementation of the Spa

Spacemesh 590 Dec 29, 2022
A Commander for Go implementation of official Ethereum Client

Young A Commander for Go implementation of official Ethereum Client by zhong-my. Overview Young Dependencies Young stands on the shoulder of many grea

Zhong MingYang 1 Oct 14, 2021