Skip to content

Instantly share code, notes, and snippets.

View corollari's full-sized avatar
🙈
程序猿

Albert corollari

🙈
程序猿
View GitHub Profile
@corollari
corollari / create-deploy-key.sh
Created February 27, 2020 10:58
Script to create a new deployment key to deploy to Github Pages via CI
filename=$(date)
ssh-keygen -t rsa -b 4096 -C "$(git config user.email)" -f "$filename" -N ""
cat "$filename.pub"
echo
cat "$filename"
# See https://github.com/marketplace/actions/github-pages-action#%EF%B8%8F-create-ssh-deploy-key
@corollari
corollari / neo-pubsub.md
Last active March 2, 2020 14:42
A publish-subscribe service for the NEO blockchain

The service

We built a publish-subscribe service for NEO that allows anyone to listen for events happening on the blockchain and act on them. The service is based in websockets and can be used by just connecting to the following endpoints:

wss://pubsub.main.neologin.io?channel=events # Events triggered in smart contract executions (final)
wss://pubsub.main.neologin.io?channel=tx # A transaction has entered in the mempool (but may not be inside a block yet)
wss://pubsub.main.neologin.io?channel=block # A block is propagated (not finalized tho)
wss://pubsub.main.neologin.io?channel=consensus # Consensus messages

Note: If you wish to get events from testnet instead of mainnet just replace the main prefix with test, eg: pubsub.test.neologin.io.

@corollari
corollari / covenant-based-sidechains.md
Last active February 10, 2020 16:09
Ideas on how to construct sidechains for chains that have covenant capabilities

Note: Throughout this paper all references to covenants should be interpreted to refer to generalized covenants, in opposition to the heavily restricted covenants such as the one proposed in OP_SECURETHEBAG & Co.

Drivechains

Drivechains would be easily implementable if covenants are possible, as they would enable the creation of a 2-way peg that would be enforced at the transaction level through scripts that would force the funds being withdrawn from the sidechain to be sent through a chain of N transactions, each one of these being in a different block. More specifically, this would be implemented by creating N scripts that would contain an integer constant and would only be spendable to another copy of the same script with the constant increased or decreased by one, with the exception of the script where the constant reaches the value N, in which case the UTXO would be spendable only to a specific address provided in the beginning of the process. Furthremore, these scripts would prevent the possibil