XRPL Plugins #113
Replies: 6 comments 2 replies
-
I think plugins would be a great way to prove out amendments in tandem to sidechains. One proposed amendment to the XRPL that most seem to agree upon is some sort of fee escalation for memo size. However, nobody can land the plane on what that implementation specifically should look like. Seems to me like a plugin framework would allow for several different fee escalation variants to be stood up and experimented with. |
Beta Was this translation helpful? Give feedback.
-
Looks super interesting! |
Beta Was this translation helpful? Give feedback.
-
I see great potential here especially for drafting new functionalities and making proposal makings more accessible for the community! |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Should this conversation be closed in favor of the new spec? #116 |
Beta Was this translation helpful? Give feedback.
-
Closed in favor of #116 |
Beta Was this translation helpful? Give feedback.
-
Updated version: XLS 42d: XRPL Plugins
XRPL Plugins
Problem
Currently, very few people have the knowhow to build new features for
rippled
, such as new transaction types. This limits ecosystem growth and makes feature development less decentralized.The guiding question of this proposal: How can we make it easier for developers to modify
rippled
to build sidechains?There are two main ideas behind this project:
rippled
in order to add new features.rippled
to add new features.This project will be useful for several groups of devs:
rippled
featureOverview
The general idea of this proposal is to be able to add new plugin features (transaction types, ledger objects, RPC requests) without needing to recompile
rippled
or needing to know anything about C++. Any dev can just takerippled
out-of-the-box, follow a few steps with their language of choice, and write a new feature.The C++ architecture will be as follows:
.so
/.dll
/.dylib
), which is...rippled
at runtime, without needing to recompile rippledWe will initially implement this project in 4 languages: C++, Python, Rust and Javascript.
The non-C++ architecture (with Python as an example) will be as follows:
.so
/.dll
/.dylib
) via some wrapper C++ code (which has the Python interpreter embedded in it), which is...rippled
(C++) at runtimeThis proposal is only for sidechains and experimental features, and recommends that mainnet features are still written in C++.
Note: The rest of this document currently only covers transactors and ledger objects, not RPC requests. There will be a separate design for that at a later point in time, as it would also be useful to have plugin versions of those features. It will follow the same general idea.
Background
Anatomy of a Transactor
The term transactor refers to the code in rippled that processes a transaction.
Every transactor is mainly made up of 5 functions:
There are several other methods that transactors call, but they only rarely need to be modified.
Other parts of a transaction include:
TxFormats
)TxType
)TxFlags
)SFields
in a transactionSFields
in a transaction (Serialized Types
)Anatomy of a Ledger Object
Ledger objects are much simpler, since they are only data structures and don't have any functionality.
The parts of a ledger object are:
LedgerFormats
)LedgerEntryType
)Implementation Details
The implementation details are still being worked out in prototypes. Once they are more solidified, a full XLS spec will be written and published.
Example Plugins
Here are a few fully-functional transactor examples ported from existing rippled functionality:
Python
SetRegularKey
Note: this transactor ignores the case where a user's first
SetRegularKey
is free, for the purpose of simplicity and readability.Original C++ transactor, for reference
Rust
SetRegularKey
Original C++ transactor, for reference
Adding Additional Language Support
Only two pieces would need to be modified to add support for an additional language:
Current Source Code
You can find the current version of the plugin transactor code in this repo. Note that it is still in the prototype phase and thus the code is incomplete, very messy, and sparsely documented.
Questions for the Community
Beta Was this translation helpful? Give feedback.
All reactions