
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@connext/vector-protocol
Advanced tools
Protocol is where the core Vector framework is defined. Protocol takes in params via method calls, uses them to make updates to its replicated state with a channel peer, and stores resulting commmitments in store.
Protocol is where the core Vector framework is defined. Protocol takes in params via method calls, uses them to make updates to its replicated state with a channel peer, and stores resulting commmitments in store.
Contents:
In ~/vector (root), run:
make protocol to build the protocolmake test-protocol to run the module testsVector aims to be an extremely simple state channel protocol. Both parties follow a single flow to make updates:
We use the following design principles:
Vector uses leader election -> consensus to manage updates to both peers' replicated stores. To keep things simple (at the cost of some additional messaging overhead), we have chosen not to use a CRDT + turn taking pattern like those seen in StateChannels.
All updates in a channel fall into one of four types of operations:
All updates are single-round-trip and associated with a monotonically incrementing nonce.
The protocol does not make assumptions about message delivery to the counterparty. Each update additionally contains information about the n-1 (previous) update. This means that if, for whatever reason, the counterparty failed to properly synchronize the last update, it is possible for them "recover" and do so within the single round trip of the next update. In other words, the protocol will always recover if a peer's state gets out of sync.
All generated updates are matched to corresponding validators, that ensure that the peer's updates were generated and signed correctly.
The protocol is not where the RPC interface lives, which instead exists at the engine layer. This is done to allow extra-protocol functions (i.e. saving withdrawal commitments) to be executed via a channel provider, as well as allowing the RPC interface to be more usecase driven (i.e. including a chan_withdraw method)
The protocol allows for generic transfer logic governed by the onchain TransferDefinitions included in the TransferRegistry. The protocol is unaware of the transfer specifics, and relies on the onchain logic to provide the correct state and resolver encodings, validate the created state, and correctly resolve the balances.
At the core of Vector lies sync. Unlike other state channel systems, there is only a single protocol -- sync is used both when a sender wants to propose a new update to the replicated state, and also when peer state has diverged. Because updates are monotonic (nonce += 1), there are only a very limited number of cases within which party states possibly diverge.
For this reason, sync takes a higher degree of control over message delivery than other state channel protocols do. Outbound messages are retried on a timer if they fail, inbound ones are idempotent. Higher-nonced inbound messages are checked against the ChannelState latest nonce and dropped if they are duplicates, or saved to store if they aren't.
The protocol can be visualized as follows:
All channel updates fall into one of 4 types. Each update type is responsible for generating and storing one double-signed commitment.
Note that there is no specific update for withdraw. Instead, withdrawals can be constructed in an easy and generalizeable way using create and resolve (see here).
The setup update is responsible for creating a channel commitment at nonce 1 and establishing several channel constants:
channelAddress: the CREATE2 address at which a proxy to the ChannelMastercopy.sol contract will be deployedalice / bob: the channel participants, which is a high-fidelity vs. low-fidelity participant in the channel. The assignment of these roles plays a critical role in channel deposits.timeout: the time (in seconds) channel participants get in each of the dispute phasesThe setup update allows both participants to safely dispute a channel and reclaim funds from the multisig even if initial onchain deposits were never reconciled into the channel balance. For example, imagine a channel setup commitment is generated and Alice deposits into the channel then generates a single-signed commitment that Bob never countersigns. Using the double-signed setup commitment, Alice can safely dispute and defund the channel.
An offchain deposit update is designed to reconcile deposits that have been successfully mined onchain (either by calling the depositA function for alice, or simply sending funds to the multisig for bob) with the offchain balance.
To do this safely, the following must occur:
assetId array.processedDepositsA and processedDepositsB must be updated to reflect that all onchain deposits have been reconciled offchain.ChannelCommitment must be generated and signed by both parties.state.latestUpdate.A create update is designed to add a new active conditional transfer into the channel state.
The create update must do the following:
balance on one (or both) sides by the amount that will be locked in the transfer (indexed by assetId).TransferState by calling the create function on the associated transfer definition. This function returns a boolean value indicating the validity of the created stateTransferState and update the merkleRoot in the channel state.ChannelCommitment.state.latestUpdate.A resolve update should occur when both parties want to remove a conditional transfer from the active transfers, and reintroduce its balances back to the main channel balance.
The resolve update must do the following:
resolve function on the transfer definition (which will also ensure the transfer is able to be resolved).TransferState from the active transfers, and update the merkleRoot in the channel state.ChannelCommitmentstate.latestUpdateFAQs
Protocol is where the core Vector framework is defined. Protocol takes in params via method calls, uses them to make updates to its replicated state with a channel peer, and stores resulting commmitments in store.
The npm package @connext/vector-protocol receives a total of 74 weekly downloads. As such, @connext/vector-protocol popularity was classified as not popular.
We found that @connext/vector-protocol demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.