Releases: bitcoin-sv/merchantapi-reference
mAPI v1.5.0 Release
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
mAPI v1.4.0a Release
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
mAPI v1.3.0 Release
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
mAPI v1.3.0-beta Release
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
mapi-v1.2.0
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.
mapi-v1.2.0-beta
update spec link
mapi-v1.1.0
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