Ledger infrastructure for modern applications
Sequence is a system of record for managing balances. It lets software teams focus on shipping and scaling their product instead of building and maintaining ledger infrastructure.
Sequence combines the convenience of the cloud with the security of cryptographic transaction signing, making it easy to build, operate, and scale forward-thinking products in finance and commerce.
Assets in accounts... Balances in Sequence are represented by token-like objects called assets. Assets are created, transferred, and retired. To ensure atomicity, a single transaction can include multiple actions involving any number of assets and accounts.
...Controlled by keys in enclavesCryptographic keys, which create and control assets and accounts, are managed in secure enclaves. Key access can be distributed across users, services, and organizations so multiple entities can transact on the same ledger with “least authority.”
ledger.keys.create({
alias: 'my_key'
}).then(key => ...)
key = ledger.keys.create(
alias: 'my_key'
)
Key key = new Key.Builder()
.setAlias("my_key")
.create(ledger);
Transactions in the ledger are authenticated by cryptographic keys. To create a key, provide an alias (a unique identifier).
ledger.assets.create({
alias: 'usd',
keys: [key]
}).then(usd => ...)
usd = ledger.assets.create(
alias: 'usd',
keys: [key]
)
Asset usd = new Asset.Builder()
.setAlias("usd")
.addKey(key)
.create(ledger);
Assets represent different types of balances in the ledger. To create an asset, provide an alias (a unique identifier) and one or more keys. Here we create a USD asset.
ledger.accounts.create({
alias: 'alice',
keys: [key]
}).then(alice => ...)
alice = ledger.accounts.create(
alias: 'alice',
keys: [key]
)
Account alice = new Account.Builder()
.setAlias("alice")
.addKey(key)
.create(ledger);
Accounts represent entities in the ledger and can hold balances of many assets. To create an account, provide an alias (a unique identifier) and one or more keys. Here we create an account for Alice.
ledger.transactions.transact(builder => {
builder.transfer({
assetAlias: 'usd',
amount: 10,
sourceAccountAlias: 'alice',
destinationAccountAlias: 'bob'
})
}).then(tx => ...)
tx = ledger.transactions.transact do |builder|
builder.transfer(
asset_alias: 'usd',
amount: 10,
source_account_alias: 'alice',
destination_account_alias: 'bob'
)
end
Transaction tx = new Transaction.Builder()
.addAction(new Transaction.Builder.Action.Transfer()
.setAssetAlias("usd")
.setAmount(10)
.setSourceAccountAlias("alice")
.setDestinationAccountAlias("bob")
).transact(ledger);
Transactions are atomic ledger updates that issue, transfer, and/or retire assets in the ledger. A transaction is comprised of one or more actions. Here is a transfer of USD from Alice to Bob.
ledger.balances.queryAll({
filter: 'asset_alias=$1 AND account_alias=$2',
filterParams: ['usd', 'alice'],
sumBy: ['asset_alias']
}).then(balances => {
for (let i in balances) {
const balance = balances[i];
...
}
})
ledger.balances.query(
filter: 'asset_alias=$1 AND account_alias=$2',
filter_params: ['usd', 'alice'],
sum_by: ['asset_alias']
).each do |balance|
...
end
Balance.ItemIterable balances = new Balance.QueryBuilder()
.setFilter("asset_alias=$1 AND account_alias=$2")
.addFilterParameter("usd")
.addFilterParameter("alice")
.addSumByField("asset_alias")
.getIterable(ledger);
for (Balance balance : balances) {
...
}
Data structures in Sequence are represented as key-value JSON objects. To retrieve data, you perform a query with optional parameters. By default, each query returns a time-ordered list of objects beginning with the most recent. Here’s a query for the amount of USD in Alice's account.
Technology trusted by market leaders
Atomic and signed transactions form immutable history
Easily add accounts, asset types, contracts, keys, and entities to your ledger
Control assets with business logic executed by the Sequence VM
High throughput and low latency for enterprise scale
Parquet integration, customized reports, and summary analytics
SDKs in several languages, detailed docs, and easy-to-use dashboards