Blueprints is a free and open-source on-chain framework for expressing customized financial positions, created by parametrizing existing primitives. Examples of tokens include:

Although positions expressed by these tokens are vastly different, all of them share a common interface.

As seen in the latter example, the tokens are composable – one position can be an argument of another. This allows infinitely intricate positions to be created from simple primitives.

Benefits of using Blueprints

Testnet

The Blueprints team hosts a public testnet that can be used to test products built on Blueprints.

Architecture overview

This section provides an overview of the Blueprints architecture. Consult the smart contracts' source code for details.

Blueprints

NativeToken, ERC20, and ComposablePrediction are examples of Blueprints. Each of them is implemented in a separate smart contract. Anyone can create and deploy their own Blueprint.

Each smart contract manages its own token space. Tokens minted by a Blueprint have a 256-bit internal token id. The external token id is calculated by hashing the smart contract's address and the internal token id. This assures that, for example, the NativeToken Blueprint cannot mint ERC20 tokens.

Each Blueprint defines a set of valid actions that can be performed. In principle, each address should be able to perform the same actions. An action consists of 4 arrays of tokens.

For example, the Basket Blueprint allows the following actions:

Blueprint Manager

Blueprint Manager is a smart contract which keeps track of balances. Each address is split into 22562^{256} subaccounts which is oftentimes helpful. Blueprint Manager also implements flash accounting – the ability to spend tokens one will receive later in the same transaction.

Oracles

An oracle feed is defined by the oracle address and a 256-bit feed id. The interpretation of the feed id is left to the operator of the oracle. A feed resolves to a 256-bit unsigned integer.

Oracles shouldn't return different readings for the same feed id, but technically there's nothing preventing them from doing so. If consistent readings are desired, you can wrap an oracle in a ConstantOracle.