Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

blockcast

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blockcast - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

8

package.json
{
"name": "blockcast",
"version": "2.0.1",
"version": "2.0.2",
"description": "A multi-transaction protocol for storing data in the Bitcoin blockchain.",

@@ -12,3 +12,3 @@ "main": "./src/index.js",

"type": "git",
"url": "https://github.com/williamcotton/blockcast.git"
"url": "https://github.com/blockai/blockcast.git"
},

@@ -27,5 +27,5 @@ "keywords": [

"bugs": {
"url": "https://github.com/williamcotton/blockcast/issues"
"url": "https://github.com/blockai/blockcast/issues"
},
"homepage": "https://github.com/williamcotton/blockcast",
"homepage": "https://github.com/blockai/blockcast",
"devDependencies": {

@@ -32,0 +32,0 @@ "blockcypher-unofficial": "^1.5.0",

@@ -10,3 +10,3 @@ blockcast

Posting a message
Posting data
---

@@ -43,3 +43,3 @@

```javascript
var commonBlockchain = require("mem-common-blockchain")({
var memCommonBlockchain = require("mem-common-blockchain")({
type: "local"

@@ -50,5 +50,5 @@ });

// commonBlockchain = require('blockcypher-unofficial')({
// network: "testnet"
// });
testnetCommonBlockchain = require('blockcypher-unofficial')({
network: "testnet"
});
```

@@ -62,3 +62,3 @@

commonWallet: commonWallet,
commonBlockchain: commonBlockchain
commonBlockchain: memCommonBlockchain
}, function(error, response) {

@@ -69,3 +69,3 @@ console.log(response);

Scan for a document from a single transaction
Scan for data from a single transaction
---

@@ -77,5 +77,6 @@

blockcast.scanSingle({
txid: '',
commonBlockchain: commonBlockchain
}, function(err, document) {
txid: 'fe44cae45f69dd1d6115815356a73b9c5179feff1b276d99ac0e283156e1cd01',
commonBlockchain: testnetCommonBlockchain
}, function(err, body) {
var document = JSON.parse(body);
console.log(document);

@@ -89,16 +90,11 @@ });

Documents are compressed using DEFLATE and then embedded across up to 16 Bitcoin transactions in OP_RETURN outputs along with custom headers allowing for documents no larger than 607 bytes.
Documents are compressed using DEFLATE and then embedded across up to 16 Bitcoin transactions in OP_RETURN outputs allowing for total compressed size of no larger than 1277 bytes.
This is enough space to contain a number of document digest formats, URIs and URNs. This allows for cross-platform content addressable systems such as BitTorrent and IPFS. Used by [openpublish](https://github.com/blockai/openpublish/)
Each blockcast post has a primary transaction identified by the magic header ```0x1f00```. The compressed data can be rebuilt by following the chain of previous transactions back through their inputs and appending data stored in OP_RETURN.
How can it be better?
---
```OP_RETURN 0x1f00032d8d5b4bc4301085ff4ac973d14c9a34c9beb982c20aa28222bee5ea06bb6d4cb3ec45fcef4ed59799e19cf39df92253262b52484b6c4d5b3cbb4e704a1def406a6bc1784a95604a071e7aea```
* Support 80 byte OP_RETURN
* Use backwards pointer (native input txid) instead of forwards pointer (spentTxid)
* Exponential fee for unlimited, yet impractical, data sizes.
* Remove per transactions byte headers and use start bytes+length or start bytes/end bytes.
* skip DEFLATE if it is bigger than the data being embedded
The total number of tranactions is stored as the first byte immediately following the magic header. In the above example, ```0x1f0003```, the total transaction count is 3, meaning that two more transactions bust be sequentially scanned in order to reconstruct the full compressed data.
Please fork this project and help make it better!
This is enough space to contain a number of document digest formats, URIs and URNs. This allows for cross-platform content addressable formats between systems like BitTorrent and IPFS. Used by [openpublish](https://github.com/blockai/openpublish/).

@@ -105,0 +101,0 @@ Why Bitcoin?

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc